Mercurial > kallithea
changeset 6811:3fca87aa2b15
templates: don't use ordinary elements as links or buttons by adding btn styling
Bootstrap recommends using <button>, so most of the time we should use that.
Extracted by Mads Kiilerich.
line wrap: on
line diff
--- a/kallithea/templates/admin/auth/auth_settings.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/admin/auth/auth_settings.html Tue Jun 27 21:49:33 2017 +0200 @@ -38,9 +38,9 @@ <ul class="list-group"> %for plugin_path in c.available_plugins: <li class="list-group-item"> - <span data-plugin_id="${plugin_path}" class="toggle-plugin btn btn-default btn-xs ${'active' if plugin_path in c.enabled_plugin_names else ''}"> + <button type="button" data-plugin_id="${plugin_path}" class="toggle-plugin btn btn-default btn-xs ${'active' if plugin_path in c.enabled_plugin_names else ''}"> ${_('Enabled') if plugin_path in c.enabled_plugin_names else _('Disabled')} - </span> + </button> ${plugin_path} </li> %endfor
--- a/kallithea/templates/admin/notifications/notifications.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/admin/notifications/notifications.html Tue Jun 27 21:49:33 2017 +0200 @@ -26,7 +26,7 @@ <a class="btn btn-default btn-sm" href="${h.url.current(type=c.pull_request_type)}">${_('Pull Requests')}</a> </div> %if c.notifications: - <span id='mark_all_read' class="btn btn-default btn-sm pull-right">${_('Mark All Read')}</span> + <button type="button" id='mark_all_read' class="btn btn-default btn-sm pull-right">${_('Mark All Read')}</button> %endif </div> <div id="notification_data" class="panel-body">
--- a/kallithea/templates/admin/notifications/notifications_data.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/admin/notifications/notifications_data.html Tue Jun 27 21:49:33 2017 +0200 @@ -9,9 +9,9 @@ </span> <span class="pull-right"> %if not notification.read: - <span id="${notification.notification.notification_id}" class="btn btn-default btn-xs read-notification"><i class="icon-ok"></i>${_('Mark as read')}</span> + <button type="button" id="${notification.notification.notification_id}" class="btn btn-default btn-xs read-notification"><i class="icon-ok"></i> ${_('Mark as read')}</button> %endif - <span id="${notification.notification.notification_id}" class="btn btn-default btn-xs delete-notification"><i class="icon-minus-circled"></i>${_('Delete')}</span> + <button type="button" id="${notification.notification.notification_id}" class="btn btn-default btn-xs delete-notification"><i class="icon-minus-circled"></i> ${_('Delete')}</button> </span> </div> %endfor
--- a/kallithea/templates/admin/notifications/show_notification.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/admin/notifications/show_notification.html Tue Jun 27 21:49:33 2017 +0200 @@ -27,7 +27,7 @@ <span class="pull-left"> ${c.notification.description} </span> - <span id="${c.notification.notification_id}" class="delete-notification btn btn-default pull-right"><i class="icon-minus-circled"></i>${_('Delete')}</span> + <button type="button" id="${c.notification.notification_id}" class="delete-notification btn btn-default pull-right"><i class="icon-minus-circled"></i>${_('Delete')}</button> </div> <div> %if c.notification.subject:
--- a/kallithea/templates/admin/repo_groups/repo_group_edit_perms.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/admin/repo_groups/repo_group_edit_perms.html Tue Jun 27 21:49:33 2017 +0200 @@ -30,9 +30,9 @@ </td> <td> %if r2p.user.username !='default': - <span class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}', '${r2p.user.username}')"> + <button type="button" class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}', '${r2p.user.username}')"> <i class="icon-minus-circled"></i> ${_('Revoke')} - </span> + </button> %endif </td> %else: @@ -67,9 +67,9 @@ %endif </td> <td> - <span class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${g2p.users_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.users_group.users_group_name)}', '${g2p.users_group.users_group_name}')"> + <button type="button" class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${g2p.users_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.users_group.users_group_name)}', '${g2p.users_group.users_group_name}')"> <i class="icon-minus-circled"></i> ${_('Revoke')} - </span> + </button> </td> </tr> %endfor @@ -77,9 +77,9 @@ <tr class="new_members last_new_member" id="add_perm_input"><td colspan="6"></td></tr> <tr> <td colspan="6"> - <span id="add_perm"> + <button type="button" id="add_perm" class="btn btn-default btn-xs"> <i class="icon-plus"></i> ${_('Add new')} - </span> + </button> </td> </tr> <tr>
--- a/kallithea/templates/admin/repos/repo_edit_permissions.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/admin/repos/repo_edit_permissions.html Tue Jun 27 21:49:33 2017 +0200 @@ -38,9 +38,9 @@ </td> <td> %if r2p.user.username !='default': - <span class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}', '${r2p.user.username}')"> + <button type="button" class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}', '${r2p.user.username}')"> <i class="icon-minus-circled"></i> ${_('Revoke')} - </span> + </button> %endif </td> </tr> @@ -63,9 +63,9 @@ %endif </td> <td> - <span class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${g2p.users_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.users_group.users_group_name)}', '${g2p.users_group.users_group_name}')"> + <button type="button" class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${g2p.users_group.users_group_id}, 'user_group', '${'id%s'%id(g2p.users_group.users_group_name)}', '${g2p.users_group.users_group_name}')"> <i class="icon-minus-circled"></i> ${_('Revoke')} - </span> + </button> </td> </tr> %endfor @@ -73,9 +73,9 @@ <tr class="new_members last_new_member" id="add_perm_input"><td colspan="6"></td></tr> <tr> <td colspan="6"> - <span id="add_perm"> + <button type="button" id="add_perm" class="btn btn-default btn-xs"> <i class="icon-plus"></i> ${_('Add new')} - </span> + </button> </td> </tr> </table>
--- a/kallithea/templates/admin/settings/settings_hooks.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/admin/settings/settings_hooks.html Tue Jun 27 21:49:33 2017 +0200 @@ -24,11 +24,11 @@ ${h.hidden('hook_ui_key',hook.ui_key,id='hook_ui_key_'+input_id)} ${h.hidden('hook_ui_value',hook.ui_value,id='hook_ui_value_'+input_id)} ${h.text('hook_ui_value_new',hook.ui_value,id=input_id,size=60,class_='form-control')} - <span class="btn btn-default btn-xs" + <button type="button" class="btn btn-default btn-xs" onclick="delete_hook(${hook.ui_id},'${'id%s' % hook.ui_id }')"> <i class="icon-minus-circled"></i> ${_('Delete')} - </span> + </button> </div> %endfor </div>
--- a/kallithea/templates/admin/settings/settings_vcs.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/admin/settings/settings_vcs.html Tue Jun 27 21:49:33 2017 +0200 @@ -62,7 +62,7 @@ ${h.text('paths_root_path',size=60,readonly="readonly",class_='form-control')} <span id="path_unlock" data-toggle="tooltip" class="input-group-btn" title="${_('Click to unlock. You must restart Kallithea in order to make this setting take effect.')}"> - <span class="btn btn-default btn-sm"><i id="path_unlock_icon" class="icon-lock"></i></span> + <button type="button" class="btn btn-default btn-sm"><i id="path_unlock_icon" class="icon-lock"></i></button> </span> </div> <span class="help-block">${_('Filesystem location where repositories are stored. After changing this value, a restart and rescan of the repository folder are both required.')}</span>
--- a/kallithea/templates/admin/user_groups/user_group_edit_perms.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/admin/user_groups/user_group_edit_perms.html Tue Jun 27 21:49:33 2017 +0200 @@ -30,9 +30,9 @@ </td> <td> %if r2p.user.username !='default': - <span class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}', '${r2p.user.username}')"> + <button type="button" class="btn btn-default btn-xs" onclick="ajaxActionRevoke(${r2p.user.user_id}, 'user', '${'id%s'%id(r2p.user.username)}', '${r2p.user.username}')"> <i class="icon-minus-circled"></i> ${_('Revoke')} - </span> + </button> %endif </td> %else: @@ -67,9 +67,9 @@ %endif </td> <td> - <span 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 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')} - </span> + </button> </td> </tr> %endfor @@ -77,9 +77,9 @@ <tr class="new_members last_new_member" id="add_perm_input"><td colspan="6"></td></tr> <tr> <td colspan="6"> - <span id="add_perm" class="btn"> + <button id="add_perm" class="btn btn-default btn-xs"> <i class="icon-plus"></i> ${_('Add new')} - </span> + </button> </td> </tr> </table>
--- a/kallithea/templates/changeset/changeset_file_comment.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/changeset/changeset_file_comment.html Tue Jun 27 21:49:33 2017 +0200 @@ -26,7 +26,7 @@ %if co.author_id == request.authuser.user_id or h.HasRepoPermissionLevel('admin')(c.repo_name): %if co.deletable(): - <div onClick="confirm('${_('Delete comment?')}') && deleteComment(${co.comment_id})" class="pull-right buttons delete-comment btn btn-default btn-xs">${_('Delete')}</div> + <button type="button" onClick="confirm('${_('Delete comment?')}') && deleteComment(${co.comment_id})" class="pull-right buttons delete-comment btn btn-default btn-xs">${_('Delete')}</button> %endif %endif </div>
--- a/kallithea/templates/compare/compare_diff.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/compare/compare_diff.html Tue Jun 27 21:49:33 2017 +0200 @@ -38,7 +38,7 @@ %if not c.compare_home: <a class="btn btn-default btn-sm" href="${c.swap_url}"><i class="icon-arrows-cw"></i> ${_('Swap')}</a> %endif - <div id="compare_revs" class="btn btn-default btn-sm"><i class="icon-git-compare"></i> ${_('Compare Revisions')}</div> + <button type="button" id="compare_revs" class="btn btn-default btn-sm"><i class="icon-git-compare"></i> ${_('Compare Revisions')}</button> </span> </div> </div>
--- a/kallithea/templates/files/files_add.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/files/files_add.html Tue Jun 27 21:49:33 2017 +0200 @@ -40,11 +40,11 @@ <span id="filename_container" class="file reviewer_ac"> <input class="form-control input-small" type="text" value="" size="30" name="filename" id="filename" placeholder="${_('Enter filename...')}"> <input type="hidden" value="${c.f_path}" name="location" id="location"> - ${_('or')} <div class="btn btn-default btn-sm" id="upload_file_enable">${_('Upload File')}</div> + ${_('or')} <button type="button" class="btn btn-default btn-sm" id="upload_file_enable">${_('Upload File')}</button> </span> <span id="upload_file_container" class="reviewer_ac" style="display:none"> <input class="form-control" type="file" size="20" name="upload_file" id="upload_file"> - ${_('or')} <span class="btn btn-default btn-sm" id="file_enable">${_('Create New File')}</span> + ${_('or')} <button type="button" class="btn btn-default btn-sm" id="file_enable">${_('Create New File')}</button> </span> </h3> <div id="body" class="panel panel-default">
--- a/kallithea/templates/pullrequests/pullrequest_data.html Mon Aug 14 00:40:04 2017 +0200 +++ b/kallithea/templates/pullrequests/pullrequest_data.html Tue Jun 27 21:49:33 2017 +0200 @@ -61,7 +61,7 @@ <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))} - <div class="btn btn-default btn-xs" + <button type="button" class="btn btn-default btn-xs" id="remove_${pr.pull_request_id}" name="remove_${pr.pull_request_id}" title="${_('Delete Pull Request')}" @@ -69,8 +69,8 @@ && ((${len(pr.comments)} == 0) || confirm('${_('Confirm again to delete this pull request with %s comments') % len(pr.comments)}')) "> - <i class="icon-minus-circled"></i> - </div> + <i class="icon-minus-circled text-danger"></i> + </button> ${h.end_form()} %endif </td>