summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-13 17:53:27 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-13 17:53:27 +0000
commit13e987a6def05bbb163db773ad715a829c2c87e3 (patch)
treef02b5aa8a70bd2e10f85b6bb7d8565841d24948e
parent4a665e3f5d98cc2dd4bc512f420c04128300081c (diff)
parent67c17df2219f04faa19066bd0996687360ba68b1 (diff)
downloadgitlab-ce-13e987a6def05bbb163db773ad715a829c2c87e3.tar.gz
Merge branch 'project-dropdown' into 'master'
Add dropdown to quickly create issue or branch from project page because just 'new issue' link is not valid for all users. A lot of people use external issue tracker. So I grouped several links under one button ![Screenshot_2015-07-13_18.40.43](https://gitlab.com/gitlab-org/gitlab-ce/uploads/9db7394c16d1a8718c8a6a15fd2c98cc/Screenshot_2015-07-13_18.40.43.png) ![Screenshot_2015-07-13_18.40.41](https://gitlab.com/gitlab-org/gitlab-ce/uploads/d880532bb15370bb3f8e76bd06b411ad/Screenshot_2015-07-13_18.40.41.png) cc @JobV @marin @jacobvosmaer @sytses See merge request !971
-rw-r--r--app/views/projects/_dropdown.html.haml32
-rw-r--r--app/views/projects/_home_panel.html.haml2
2 files changed, 34 insertions, 0 deletions
diff --git a/app/views/projects/_dropdown.html.haml b/app/views/projects/_dropdown.html.haml
new file mode 100644
index 00000000000..dfdf9fb7ac4
--- /dev/null
+++ b/app/views/projects/_dropdown.html.haml
@@ -0,0 +1,32 @@
+- if current_user
+ %span.dropdown
+ %a.dropdown-toggle.btn.btn-new{href: '#', "data-toggle" => "dropdown"}
+ %i.fa.fa-bars
+ %ul.dropdown-menu
+ - if @project.issues_enabled && can?(current_user, :create_issue, @project)
+ %li
+ = link_to url_for_new_issue, title: "New Issue" do
+ New issue
+ - if @project.merge_requests_enabled && can?(current_user, :create_merge_request, @project)
+ %li
+ = link_to new_namespace_project_merge_request_path(@project.namespace, @project), title: "New Merge Request" do
+ New merge request
+ - if @project.snippets_enabled && can?(current_user, :create_snippet, @project)
+ %li
+ = link_to new_namespace_project_snippet_path(@project.namespace, @project), title: "New Snippet" do
+ New snippet
+ - if can?(current_user, :admin_project_member, @project)
+ %li
+ = link_to namespace_project_project_members_path(@project.namespace, @project), title: "New project member" do
+ New project member
+ - if can? current_user, :push_code, @project
+ %li.divider
+ %li
+ = link_to new_namespace_project_branch_path(@project.namespace, @project) do
+ New git branch
+ %li
+ = link_to new_namespace_project_tag_path(@project.namespace, @project) do
+ %i.fa.fa-tag
+ New git tag
+
+
diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml
index 95c84c96c41..64055a9ccf2 100644
--- a/app/views/projects/_home_panel.html.haml
+++ b/app/views/projects/_home_panel.html.haml
@@ -23,4 +23,6 @@
= link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: @ref, format: 'zip'), class: 'btn', rel: 'nofollow' do
%i.fa.fa-download
+ = render 'projects/dropdown'
+
= render "shared/clone_panel"