diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-07-13 18:42:07 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-07-13 18:42:07 +0200 |
commit | 78a94027eabad9f70fe525530a39da4d0dbf7105 (patch) | |
tree | 6dcd1d3f9b58bb46517bb1ee5e17a4d3d95950ed | |
parent | 4f0455c96bc918040de25e03f1a0ff39d9517dc6 (diff) | |
download | gitlab-ce-78a94027eabad9f70fe525530a39da4d0dbf7105.tar.gz |
Add dropdown to quickly create issue or branch from project page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | app/views/projects/_dropdown.html.haml | 33 | ||||
-rw-r--r-- | app/views/projects/_home_panel.html.haml | 2 |
2 files changed, 35 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..cfdb899453b --- /dev/null +++ b/app/views/projects/_dropdown.html.haml @@ -0,0 +1,33 @@ +- 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 + %i.fa.fa-code-fork + Git branch + %li + = link_to new_namespace_project_tag_path(@project.namespace, @project) do + %i.fa.fa-tag + 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" |