summaryrefslogtreecommitdiff
path: root/app/views/dashboard
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-02 14:02:12 +0100
committerDouwe Maan <douwe@gitlab.com>2015-12-02 14:02:12 +0100
commit5a59712b8ac29450dfef0af0dd381529f0d9d7ae (patch)
treeae61ff7f3b2901b909b6d4088047f191dd534b65 /app/views/dashboard
parent09e712c0fb721059e4b2619eb9fc104257fc492d (diff)
downloadgitlab-ce-5a59712b8ac29450dfef0af0dd381529f0d9d7ae.tar.gz
Add "New X" buttons to dashboard and group issue, MR and milestone indexes
Diffstat (limited to 'app/views/dashboard')
-rw-r--r--app/views/dashboard/issues.html.haml31
-rw-r--r--app/views/dashboard/merge_requests.html.haml23
-rw-r--r--app/views/dashboard/milestones/index.html.haml21
3 files changed, 62 insertions, 13 deletions
diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml
index cd602e897b7..829c3c83769 100644
--- a/app/views/dashboard/issues.html.haml
+++ b/app/views/dashboard/issues.html.haml
@@ -4,14 +4,31 @@
- if current_user
= auto_discovery_link_tag(:atom, issues_dashboard_url(format: :atom, private_token: current_user.private_token), title: "#{current_user.name} issues")
+.project-issuable-filter
+ .controls
+ .pull-left
+ - if current_user
+ .hidden-xs.pull-left
+ = link_to issues_dashboard_url(format: :atom, private_token: current_user.private_token), class: 'btn' do
+ %i.fa.fa-rss
-.append-bottom-20
- .pull-right
- - if current_user
- .hidden-xs.pull-left.prepend-top-20
- = link_to issues_dashboard_url(format: :atom, private_token: current_user.private_token), class: '' do
- %i.fa.fa-rss
+ - if @projects.any? { |project| can?(current_user, :create_issue, project) }
+ .dropdown.inline.prepend-left-10
+ %button.dropdown-toggle.btn.btn-new{type: 'button', 'data-toggle' => 'dropdown'}
+ %i.fa.fa-plus
+ New Issue
+ %b.caret
+ %ul.dropdown-menu.dropdown-menu-align-right
+ - @projects.each do |project|
+ - if can?(current_user, :create_issue, project)
+ %li
+ = link_to new_namespace_project_issue_path(project.namespace, project) do
+ = project.name_with_namespace
= render 'shared/issuable/filter', type: :issues
-= render 'shared/issues'
+.gray-content-block.second-block
+ List all issues from all projects you have access to.
+
+.prepend-top-default
+ = render 'shared/issues'
diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml
index d1f332fa0d3..2e91c8dec8a 100644
--- a/app/views/dashboard/merge_requests.html.haml
+++ b/app/views/dashboard/merge_requests.html.haml
@@ -1,6 +1,25 @@
- page_title "Merge Requests"
- header_title "Merge Requests", merge_requests_dashboard_path(assignee_id: current_user.id)
-.append-bottom-20
+.project-issuable-filter
+ .controls
+ - if @projects.any? { |project| can?(current_user, :create_merge_request, project) }
+ .dropdown.inline
+ %button.dropdown-toggle.btn.btn-new{type: 'button', 'data-toggle' => 'dropdown'}
+ %i.fa.fa-plus
+ New Merge Request
+ %b.caret
+ %ul.dropdown-menu.dropdown-menu-align-right
+ - @projects.each do |project|
+ - if can?(current_user, :create_merge_request, project)
+ %li
+ = link_to new_namespace_project_merge_request_path(project.namespace, project) do
+ = project.name_with_namespace
+
= render 'shared/issuable/filter', type: :merge_requests
-= render 'shared/merge_requests'
+
+.gray-content-block.second-block
+ List all merge requests from all projects you have access to.
+
+.prepend-top-default
+ = render 'shared/merge_requests'
diff --git a/app/views/dashboard/milestones/index.html.haml b/app/views/dashboard/milestones/index.html.haml
index 635251e2374..9aea75e50db 100644
--- a/app/views/dashboard/milestones/index.html.haml
+++ b/app/views/dashboard/milestones/index.html.haml
@@ -1,12 +1,25 @@
- page_title "Milestones"
-- header_title "Milestones", dashboard_milestones_path
+- header_title "Milestones", dashboard_milestones_path
+.project-issuable-filter
+ .controls
+ - if @projects.any? { |project| can?(current_user, :admin_milestone, project) }
+ .dropdown.inline
+ %button.dropdown-toggle.btn.btn-new{type: 'button', 'data-toggle' => 'dropdown'}
+ %i.fa.fa-plus
+ New Milestone
+ %b.caret
+ %ul.dropdown-menu.dropdown-menu-align-right
+ - @projects.each do |project|
+ - if can?(current_user, :admin_milestone, project)
+ %li
+ = link_to new_namespace_project_milestone_path(project.namespace, project) do
+ = project.name_with_namespace
-= render 'shared/milestones_filter'
+ = render 'shared/milestones_filter'
.gray-content-block
- .oneline
- List all milestones from all projects you have access to.
+ List all milestones from all projects you have access to.
.milestones
%ul.content-list