Changeset - 5572eb8d4feb
[Not reviewed]
stable
0 4 0
Mads Kiilerich (mads) - 4 years ago 2022-06-27 20:50:23
mads@kiilerich.com
html: clarify type of button elements - make it clear if we really want "submit"

This might fix some real problems.
4 files changed with 8 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/base.js
Show inline comments
 
@@ -674,20 +674,22 @@ function _comment_div_append_form($comme
 
                text: _TM['Unable to post']
 
            }).replaceAll($status.contents());
 
            $('<div>', {
 
                'class': 'btn-group'
 
            }).append(
 
                $('<button>', {
 
                    'type': 'button',
 
                    'class': 'btn btn-default btn-xs',
 
                    text: _TM['Retry']
 
                }).click(function() {
 
                    $status.text(_TM['Submitting ...']);
 
                    $preview.addClass('submitting').children('.panel').removeClass('panel-danger');
 
                    ajaxPOST(AJAX_COMMENT_URL, postData, success, failure);
 
                }),
 
                $('<button>', {
 
                    'type': 'button',
 
                    'class': 'btn btn-default btn-xs',
 
                    text: _TM['Cancel']
 
                }).click(function() {
 
                    comment_div_state($comment_div, f_path, line_no);
 
                })
 
            ).appendTo($status);
kallithea/templates/admin/user_groups/user_group_edit_perms.html
Show inline comments
 
@@ -64,13 +64,13 @@ ${h.form(url('edit_user_group_perms_upda
 
                             </a>
 
                            %else:
 
                             ${g2p.user_group.users_group_name}
 
                            %endif
 
                        </td>
 
                        <td>
 
                            <button class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${g2p.user_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.user_group.users_group_name)}', '${g2p.user_group.users_group_name}')">
 
                            <button type="button" class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${g2p.user_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.user_group.users_group_name)}', '${g2p.user_group.users_group_name}')">
 
                            <i class="icon-minus-circled"></i>${_('Revoke')}
 
                            </button>
 
                        </td>
 
                    </tr>
 
                %endfor
 
                ## New entries added by addPermAction here.
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">
 
    <button data-target="${'diff-container-%s' % (id(file_diff_data))}" class="diff-collapse-button btn btn-link btn-sm">&uarr; ${_('Collapse Diff')} &uarr;</button>
 
    <button type='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/data_table/_dt_elements.html
Show inline comments
 
@@ -67,13 +67,13 @@
 

	
 
<%def name="repo_actions(repo_name)">
 
      <a href="${webutils.url('edit_repo',repo_name=repo_name)}" title="${_('Edit')}" class="btn btn-default btn-xs">
 
        <i class="icon-pencil"></i>${_('Edit')}
 
      </a>
 
      ${webutils.form(webutils.url('delete_repo', repo_name=repo_name))}
 
        <button name="${'remove_%s' % repo_name}" class="btn btn-default btn-xs"
 
        <button type="submit" name="${'remove_%s' % repo_name}" class="btn btn-default btn-xs"
 
            onclick="return confirm('${_('Confirm to delete this repository: %s') % repo_name}');">
 
          <i class="icon-trashcan"></i>${_('Delete')}
 
        </button>
 
      ${webutils.end_form()}
 
</%def>
 

	
 
@@ -89,25 +89,25 @@
 

	
 
<%def name="user_actions(user_id, username)">
 
   <a href="${webutils.url('edit_user',id=user_id)}" title="${_('Edit')}" class="btn btn-default btn-xs">
 
     <i class="icon-pencil"></i>${_('Edit')}
 
   </a>
 
  ${webutils.form(webutils.url('delete_user', id=user_id))}
 
    <button id="${'remove_user_%s' % user_id}" name="${'remove_user_%s' % repo_name}" class="btn btn-default btn-xs" title="${_('Delete')}"
 
    <button type="submit" id="${'remove_user_%s' % user_id}" name="${'remove_user_%s' % repo_name}" class="btn btn-default btn-xs" title="${_('Delete')}"
 
        onclick="return confirm('${_('Confirm to delete this user: %s') % username}');">
 
      <i class="icon-trashcan"></i>${_('Delete')}
 
    </button>
 
  ${webutils.end_form()}
 
</%def>
 

	
 
<%def name="user_group_actions(user_group_id, user_group_name)">
 
    <a href="${webutils.url('edit_users_group', id=user_group_id)}" title="${_('Edit')}" class="btn btn-default btn-xs">
 
      <i class="icon-pencil"></i>${_('Edit')}
 
    </a>
 
    ${webutils.form(webutils.url('delete_users_group', id=user_group_id))}
 
      <button id="${'remove_group_%s' % user_group_id}" name="${'remove_user_%s' % repo_name}" class="btn btn-default btn-xs" title="${_('Delete')}"
 
      <button type="submit" id="${'remove_group_%s' % user_group_id}" name="${'remove_user_%s' % repo_name}" class="btn btn-default btn-xs" title="${_('Delete')}"
 
          onclick="return confirm('${_('Confirm to delete this user group: %s') % user_group_name}');">
 
        <i class="icon-trashcan"></i>${_('Delete')}
 
      </button>
 
    ${webutils.end_form()}
 
</%def>
 

	
 
@@ -120,13 +120,13 @@
 

	
 
<%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)">
 
    <a href="${webutils.url('edit_repo_group',group_name=repo_group_name)}" title="${_('Edit')}" class="btn btn-default btn-xs">
 
      <i class="icon-pencil"></i>${_('Edit')}
 
    </a>
 
    ${webutils.form(webutils.url('delete_repo_group', group_name=repo_group_name))}
 
      <button id="${'remove_%s' % repo_group_name}" name="${'remove_%s' % repo_group_name}" class="btn btn-default btn-xs" title="${_('Delete')}"
 
      <button type="submit" id="${'remove_%s' % repo_group_name}" name="${'remove_%s' % repo_group_name}" class="btn btn-default btn-xs" title="${_('Delete')}"
 
          onclick="return confirm('${ungettext('Confirm to delete this group: %s with %s repository','Confirm to delete this group: %s with %s repositories',gr_count) % (repo_group_name, gr_count)}')">
 
        <i class="icon-trashcan"></i>${_('Delete')}
 
      </button>
 
    ${webutils.end_form()}
 
</%def>
 

	
0 comments (0 inline, 0 general)