diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-02-28 19:28:58 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-02-28 19:28:58 +0000 |
commit | 85f493390a9e5ce7cce2c7936e1e91c8327e83d5 (patch) | |
tree | 8c64a1cef808be03f98402baf5d085b1508505aa /app/views/shared/issuable/_sidebar.html.haml | |
parent | 261f5a68edc37eca25b9f49f2d3d75261bd794a7 (diff) | |
download | gitlab-ce-85f493390a9e5ce7cce2c7936e1e91c8327e83d5.tar.gz |
Improve a11y in sidebar
Diffstat (limited to 'app/views/shared/issuable/_sidebar.html.haml')
-rw-r--r-- | app/views/shared/issuable/_sidebar.html.haml | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 6c730e16f67..37f28a662f7 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -9,16 +9,16 @@ - if current_user %span.issuable-header-text.hide-collapsed.pull-left Todo - %a.gutter-toggle.pull-right.js-sidebar-toggle{ role: "button", href: "#", aria: { label: "Toggle sidebar" } } + %a.gutter-toggle.pull-right.js-sidebar-toggle{ role: "button", href: "#", "aria-label" => "Toggle sidebar" } = sidebar_gutter_toggle_icon - if current_user - %button.btn.btn-default.issuable-header-btn.pull-right.js-issuable-todo{ type: "button", aria: { label: (todo.nil? ? "Add todo" : "Mark done") }, data: { todo_text: "Add todo", mark_text: "Mark done", issuable_id: issuable.id, issuable_type: issuable.class.name.underscore, url: namespace_project_todos_path(@project.namespace, @project), delete_path: (dashboard_todo_path(todo) if todo) } } + %button.btn.btn-default.issuable-header-btn.pull-right.js-issuable-todo{ type: "button", "aria-label" => (todo.nil? ? "Add todo" : "Mark done"), data: { todo_text: "Add todo", mark_text: "Mark done", issuable_id: issuable.id, issuable_type: issuable.class.name.underscore, url: namespace_project_todos_path(@project.namespace, @project), delete_path: (dashboard_todo_path(todo) if todo) } } %span.js-issuable-todo-text - if todo Mark done - else Add todo - = icon('spin spinner', class: 'hidden js-issuable-todo-loading') + = icon('spin spinner', class: 'hidden js-issuable-todo-loading', 'aria-hidden': 'true') = form_for [@project.namespace.becomes(Namespace), @project, issuable], remote: true, format: :json, html: { class: 'issuable-context-form inline-update js-issuable-update' } do |f| .block.assignee @@ -26,10 +26,10 @@ - if issuable.assignee = link_to_member(@project, issuable.assignee, size: 24) - else - = icon('user') + = icon('user', 'aria-hidden': 'true') .title.hide-collapsed Assignee - = icon('spinner spin', class: 'block-loading') + = icon('spinner spin', class: 'block-loading', 'aria-hidden': 'true') - if can_edit_issuable = link_to 'Edit', '#', class: 'edit-link pull-right' .value.hide-collapsed @@ -37,7 +37,7 @@ = link_to_member(@project, issuable.assignee, size: 32, extra_class: 'bold') do - if issuable.instance_of?(MergeRequest) && !issuable.can_be_merged_by?(issuable.assignee) %span.pull-right.cannot-be-merged{ data: { toggle: 'tooltip', placement: 'left' }, title: 'Not allowed to merge' } - = icon('exclamation-triangle') + = icon('exclamation-triangle', 'aria-hidden': 'true') %span.username = issuable.assignee.to_reference - else @@ -54,7 +54,7 @@ .block.milestone .sidebar-collapsed-icon - = icon('clock-o') + = icon('clock-o', 'aria-hidden': 'true') %span - if issuable.milestone %span.has-tooltip{ title: milestone_remaining_days(issuable.milestone), data: { container: 'body', html: 1, placement: 'left' } } @@ -63,7 +63,7 @@ None .title.hide-collapsed Milestone - = icon('spinner spin', class: 'block-loading') + = icon('spinner spin', class: 'block-loading', 'aria-hidden': 'true') - if can_edit_issuable = link_to 'Edit', '#', class: 'edit-link pull-right' .value.hide-collapsed @@ -81,16 +81,16 @@ // Fallback while content is loading .title.hide-collapsed Time tracking - = icon('spinner spin') + = icon('spinner spin', 'aria-hidden': 'true') - if issuable.has_attribute?(:due_date) .block.due_date .sidebar-collapsed-icon - = icon('calendar') + = icon('calendar', 'aria-hidden': 'true') %span.js-due-date-sidebar-value = issuable.due_date.try(:to_s, :medium) || 'None' .title.hide-collapsed Due date - = icon('spinner spin', class: 'block-loading') + = icon('spinner spin', class: 'block-loading', 'aria-hidden': 'true') - if can?(current_user, :"admin_#{issuable.to_ability_name}", @project) = link_to 'Edit', '#', class: 'edit-link pull-right' .value.hide-collapsed @@ -110,7 +110,7 @@ .dropdown %button.dropdown-menu-toggle.js-due-date-select{ type: 'button', data: { toggle: 'dropdown', field_name: "#{issuable.to_ability_name}[due_date]", ability_name: issuable.to_ability_name, issue_update: issuable_json_path(issuable) } } %span.dropdown-toggle-text Due date - = icon('chevron-down') + = icon('chevron-down', 'aria-hidden': 'true') .dropdown-menu.dropdown-menu-due-date = dropdown_title('Due date') = dropdown_content do @@ -120,12 +120,12 @@ - selected_labels = issuable.labels .block.labels .sidebar-collapsed-icon.js-sidebar-labels-tooltip{ title: issuable_labels_tooltip(issuable.labels_array), data: { placement: "left", container: "body" } } - = icon('tags') + = icon('tags', 'aria-hidden': 'true') %span = selected_labels.size .title.hide-collapsed Labels - = icon('spinner spin', class: 'block-loading') + = icon('spinner spin', class: 'block-loading', 'aria-hidden': 'true') - if can_edit_issuable = link_to 'Edit', '#', class: 'edit-link pull-right' .value.issuable-show-labels.hide-collapsed{ class: ("has-labels" if selected_labels.any?) } @@ -141,7 +141,7 @@ %button.dropdown-menu-toggle.js-label-select.js-multiselect.js-label-sidebar-dropdown{ type: "button", data: {toggle: "dropdown", default_label: "Labels", field_name: "#{issuable.to_ability_name}[label_names][]", ability_name: issuable.to_ability_name, show_no: "true", show_any: "true", namespace_path: @project.try(:namespace).try(:path), project_path: @project.try(:path), issue_update: issuable_json_path(issuable), labels: (namespace_project_labels_path(@project.namespace, @project, :json) if @project) } } %span.dropdown-toggle-text{ class: ("is-default" if selected_labels.empty?) } = multi_label_name(selected_labels, "Labels") - = icon('chevron-down') + = icon('chevron-down', 'aria-hidden': 'true') .dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable = render partial: "shared/issuable/label_page_default" - if can? current_user, :admin_label, @project and @project @@ -152,7 +152,7 @@ - subscribed = issuable.subscribed?(current_user, @project) .block.light.subscription{ data: { url: toggle_subscription_path(issuable) } } .sidebar-collapsed-icon - = icon('rss') + = icon('rss', 'aria-hidden': 'true') %span.issuable-header-text.hide-collapsed.pull-left Notifications - subscribtion_status = subscribed ? 'subscribed' : 'unsubscribed' |