diff options
author | Stan Hu <stanhu@gmail.com> | 2016-06-14 22:01:43 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-06-14 22:01:43 +0000 |
commit | 5ac17fb2fa5b3f3ef8c4bed16f97d402858efe6f (patch) | |
tree | d85c6434cf2cb358356d41dbe7c9d869f03e7e31 /app/views/shared | |
parent | 06784ee782ff8a3212e1c6f1361fc43d36ae44e5 (diff) | |
parent | b22ba26caa233bc6cb56bc0b82f493713f657909 (diff) | |
download | gitlab-ce-5ac17fb2fa5b3f3ef8c4bed16f97d402858efe6f.tar.gz |
Merge branch 'manual-todos-issuable-sidebar' into 'master'
Manually create todo for issuable
## What does this MR do?
Adds a button to the sidebar in issues & merge requests to allow users to manually create a todo item themselves.
## What are the relevant issue numbers?
Closes #15045
## Screenshots (if relevant)



See merge request !4502
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/issuable/_sidebar.html.haml | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index fb906de829a..539c4f3630a 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -1,9 +1,21 @@ +- todo = has_todo(issuable) %aside.right-sidebar{ class: sidebar_gutter_collapsed_class } .issuable-sidebar - can_edit_issuable = can?(current_user, :"admin_#{issuable.to_ability_name}", @project) .block.issuable-sidebar-header - %a.gutter-toggle.pull-right.js-sidebar-toggle{href: '#'} + - 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" } } = 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", id: (todo.id unless todo.nil?), issuable: issuable.id, issuable_type: issuable.class.name.underscore, url: namespace_project_todos_path(@project.namespace, @project) } } + %span.js-issuable-todo-text + - if todo.nil? + Add Todo + - else + Mark Done + = icon('spin spinner', class: 'hidden js-issuable-todo-loading') = 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 |