diff options
author | Stan Hu <stanhu@gmail.com> | 2015-05-22 13:17:37 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-05-25 13:16:33 +0300 |
commit | a7d8a7bd3d4b6f7b388d8976201cbdf3b36ab7aa (patch) | |
tree | 9d62c322ee3a1b66faadaffc9417cd7d21feb29b /app/views | |
parent | f042b085f64223ffe7b9d26f003ee2db76af27a6 (diff) |
Disable "New Issue" and "New Merge Request" buttons when features are disabled in project settings
Closes #1676
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/_dropdown.html.haml | 37 | ||||
-rw-r--r-- | app/views/projects/milestones/show.html.haml | 2 |
2 files changed, 1 insertions, 38 deletions
diff --git a/app/views/projects/_dropdown.html.haml b/app/views/projects/_dropdown.html.haml deleted file mode 100644 index d623a3716ed..00000000000 --- a/app/views/projects/_dropdown.html.haml +++ /dev/null @@ -1,37 +0,0 @@ -- if current_user - .dropdown.pull-right - %a.dropdown-toggle.btn.btn-sm{href: '#', "data-toggle" => "dropdown"} - %i.fa.fa-bars - %ul.dropdown-menu - - if @project.issues_enabled && can?(current_user, :write_issue, @project) - %li - = link_to url_for_new_issue(@project, only_path: true), title: "New Issue" do - %i.fa.fa-fw.fa-exclamation-circle - New issue - - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project) - %li - = link_to new_namespace_project_merge_request_path(@project.namespace, @project), title: "New Merge Request" do - %i.fa.fa-fw.fa-tasks - New merge request - - if @project.snippets_enabled && can?(current_user, :write_snippet, @project) - %li - = link_to new_namespace_project_snippet_path(@project.namespace, @project), title: "New Snippet" do - %i.fa.fa-fw.fa-file-text-o - 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 - %i.fa.fa-fw.fa-users - 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-fw.fa-code-fork - New branch - %li - = link_to new_namespace_project_tag_path(@project.namespace, @project) do - %i.fa.fa-fw.fa-tag - New tag - - diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml index bba2b8764ac..22172a31289 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -61,7 +61,7 @@ Participants %span.badge= @users.count - - if @project.issues_enabled + - if can?(current_user, :write_issue, @project) .pull-right = link_to new_namespace_project_issue_path(@project.namespace, @project, issue: { milestone_id: @milestone.id }), class: "btn btn-grouped", title: "New Issue" do %i.fa.fa-plus |