Changeset - 19f40a5088d4
[Not reviewed]
default
0 6 0
domruf - 8 years ago 2017-06-27 21:49:33
dominikruf@gmail.com
templates: don't abuse elements as links or buttons

Bootstrap recommends using <button>, so most of the time we should use that.

Except if we don't want the additional padding of a button (like for the expand
'button' on the changelog page).
6 files changed with 10 insertions and 11 deletions:
0 comments (0 inline, 0 general)
kallithea/public/css/style.css
Show inline comments
 
@@ -2176,12 +2176,17 @@ body .btn.btn-default {
 
    border-bottom: 1px solid #c6c6c6;
 
}
 
body .btn.btn-default:hover {
 
    background-image: none;
 
}
 

	
 
/* use our link color for btn-link */
 
.btn-link {
 
    color: #577632;
 
}
 

	
 
ins, div.options a:hover {
 
    text-decoration: none;
 
}
 

	
 
img,
 
nav.navbar #quick li a:hover span.normal,
 
@@ -2975,18 +2980,12 @@ input.perm_filter {
 
******************************************************************************/
 
.diff-collapse {
 
    text-align: center;
 
    margin-bottom: 15px;
 
}
 

	
 
.diff-collapse-button {
 
    cursor: pointer;
 
    color: #666;
 
    font-size: 16px;
 
}
 

	
 
table.code-difftable {
 
    border-collapse: collapse;
 
    border-radius: 0px !important;
 
    width: 100%;
 
}
 
table.code-difftable td {
kallithea/templates/admin/repo_groups/repo_group_edit_perms.html
Show inline comments
 
@@ -74,13 +74,13 @@ ${h.form(url('edit_repo_group_perms', gr
 
                    </tr>
 
                %endfor
 
                ## New entries added by addPermAction here.
 
                <tr class="new_members last_new_member" id="add_perm_input"><td colspan="6"></td></tr>
 
                <tr>
 
                    <td colspan="6">
 
                        <button type="button" id="add_perm" class="btn btn-default btn-xs">
 
                        <button type="button" id="add_perm" class="btn btn-link btn-xs">
 
                            <i class="icon-plus"></i> ${_('Add new')}
 
                        </button>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td colspan="6">
kallithea/templates/admin/repos/repo_edit_permissions.html
Show inline comments
 
@@ -70,13 +70,13 @@ ${h.form(url('edit_repo_perms_update', r
 
                    </tr>
 
                %endfor
 
                ## New entries added by addPermAction here.
 
                <tr class="new_members last_new_member" id="add_perm_input"><td colspan="6"></td></tr>
 
                <tr>
 
                    <td colspan="6">
 
                        <button type="button" id="add_perm" class="btn btn-default btn-xs">
 
                        <button type="button" id="add_perm" class="btn btn-link btn-xs">
 
                            <i class="icon-plus"></i> ${_('Add new')}
 
                        </button>
 
                    </td>
 
                </tr>
 
            </table>
 
        </div>
kallithea/templates/admin/user_groups/user_group_edit_perms.html
Show inline comments
 
@@ -74,13 +74,13 @@ ${h.form(url('edit_user_group_perms_upda
 
                    </tr>
 
                %endfor
 
                ## New entries added by addPermAction here.
 
                <tr class="new_members last_new_member" id="add_perm_input"><td colspan="6"></td></tr>
 
                <tr>
 
                    <td colspan="6">
 
                        <button id="add_perm" class="btn btn-default btn-xs">
 
                        <button id="add_perm" class="btn btn-link btn-xs">
 
                            <i class="icon-plus"></i> ${_('Add new')}
 
                        </button>
 
                    </td>
 
                </tr>
 
            </table>
 
        </div>
kallithea/templates/changeset/diff_block.html
Show inline comments
 
## -*- coding: utf-8 -*-
 

	
 
<%def name="diff_block(a_repo_name, a_ref_type, a_ref_name, a_rev,
 
                       cs_repo_name, cs_ref_name, cs_ref_type, cs_rev,
 
                       file_diff_data)">
 
<div class="diff-collapse">
 
    <span data-target="${'diff-container-%s' % (id(file_diff_data))}" class="diff-collapse-button">&uarr; ${_('Collapse Diff')} &uarr;</span>
 
    <button data-target="${'diff-container-%s' % (id(file_diff_data))}" class="diff-collapse-button btn btn-link btn-sm">&uarr; ${_('Collapse Diff')} &uarr;</button>
 
</div>
 
%for id_fid, url_fid, op, a_filename, cs_filename, diff, stats in file_diff_data:
 
    ${diff_block_diffblock(id_fid, url_fid, op, diff,
 
        a_repo_name, a_rev, a_ref_type, a_ref_name, a_filename,
 
        cs_repo_name, cs_rev, cs_ref_type, cs_ref_name, cs_filename,
 
        'diff-container-%s' % id(file_diff_data))}
kallithea/templates/pullrequests/pullrequest_data.html
Show inline comments
 
@@ -58,13 +58,13 @@
 
          ${pr.other_repo.repo_name}#${other_ref_name}
 
        </a>
 
      </td>
 
      <td>
 
        %if pr.owner_id == request.authuser.user_id:
 
          ${h.form(url('pullrequest_delete', repo_name=pr.other_repo.repo_name, pull_request_id=pr.pull_request_id))}
 
          <button type="button" class="btn btn-default btn-xs"
 
          <button type="button" class="btn btn-link btn-xs"
 
                  id="remove_${pr.pull_request_id}"
 
                  name="remove_${pr.pull_request_id}"
 
                  title="${_('Delete Pull Request')}"
 
                  onclick="return confirm('${_('Confirm to delete this pull request')}')
 
                      && ((${len(pr.comments)} == 0) ||
 
                          confirm('${_('Confirm again to delete this pull request with %s comments') % len(pr.comments)}'))
0 comments (0 inline, 0 general)