diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-11-21 11:11:52 +0000 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-11-21 11:11:52 +0000 |
commit | e4af2b3db578fb04c5363ca6fbca9e90e78986c8 (patch) | |
tree | c4d3de0f4d09c5a30cb8d0bd01fd952d141eabde | |
parent | 1b34a24ffd63ac9a5a37ac0edbf3a3f2ca6d1810 (diff) | |
parent | e683d9c087cc503cd8cb11214ddf265897e726c0 (diff) | |
download | gitlab-ce-e4af2b3db578fb04c5363ca6fbca9e90e78986c8.tar.gz |
Merge branch 'milestones_labels' into 'master'
Possibility to create Milestones or Labels when Issues are disabled
https://dev.gitlab.org/gitlab/gitlabhq/issues/1682
See merge request !1270
-rw-r--r-- | app/controllers/projects/milestones_controller.rb | 4 | ||||
-rw-r--r-- | app/views/projects/_issues_nav.html.haml (renamed from app/views/projects/issues/_head.html.haml) | 22 | ||||
-rw-r--r-- | app/views/projects/issues/index.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/labels/index.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/merge_requests/index.html.haml | 9 | ||||
-rw-r--r-- | app/views/projects/milestones/index.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/milestones/show.html.haml | 2 |
7 files changed, 28 insertions, 15 deletions
diff --git a/app/controllers/projects/milestones_controller.rb b/app/controllers/projects/milestones_controller.rb index d338cdedfaf..f362f449e70 100644 --- a/app/controllers/projects/milestones_controller.rb +++ b/app/controllers/projects/milestones_controller.rb @@ -103,7 +103,9 @@ class Projects::MilestonesController < Projects::ApplicationController end def module_enabled - return render_404 unless @project.issues_enabled + unless @project.issues_enabled || @project.merge_requests_enabled + return render_404 + end end def milestone_params diff --git a/app/views/projects/issues/_head.html.haml b/app/views/projects/_issues_nav.html.haml index 1d2f3ed8118..1e14a2deb8c 100644 --- a/app/views/projects/issues/_head.html.haml +++ b/app/views/projects/_issues_nav.html.haml @@ -1,7 +1,12 @@ %ul.nav.nav-tabs - = nav_link(controller: :issues) do - = link_to project_issues_path(@project), class: "tab" do - Browse Issues + - if project_nav_tab? :issues + = nav_link(controller: :issues) do + = link_to project_issues_path(@project), class: "tab" do + Browse Issues + - if project_nav_tab? :merge_requests + = nav_link(controller: :merge_requests) do + = link_to project_merge_requests_path(@project), class: "tab" do + Merge Requests = nav_link(controller: :milestones) do = link_to 'Milestones', project_milestones_path(@project), class: "tab" = nav_link(controller: :labels) do @@ -34,3 +39,14 @@ = link_to new_project_issue_path(@project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "btn btn-new pull-left", title: "New Issue", id: "new_issue_link" do %i.fa.fa-plus New Issue + + - if current_controller?(:merge_requests) + %li.pull-right + .pull-right + %button.btn.btn-default.sidebar-expand-button + %i.icon.fa.fa-list + + - if can? current_user, :write_merge_request, @project + = link_to new_project_merge_request_path(@project), class: "pull-right btn btn-new", title: "New Merge Request" do + %i.fa.fa-plus + New Merge Request diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml index 4ec362b3063..8db6241f21f 100644 --- a/app/views/projects/issues/index.html.haml +++ b/app/views/projects/issues/index.html.haml @@ -1,4 +1,4 @@ -= render "head" += render "projects/issues_nav" .row .fixed.fixed.sidebar-expand-button.hidden-lg.hidden-md.hidden-xs %i.fa.fa-list.fa-2x diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml index 06568278de8..c7c17c7797e 100644 --- a/app/views/projects/labels/index.html.haml +++ b/app/views/projects/labels/index.html.haml @@ -1,4 +1,4 @@ -= render "projects/issues/head" += render "projects/issues_nav" - if can? current_user, :admin_label, @project = link_to new_project_label_path(@project), class: "pull-right btn btn-new" do diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index be638d7cac1..cd1e48ca976 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/merge_requests/index.html.haml @@ -1,10 +1,5 @@ -- if can? current_user, :write_merge_request, @project - = link_to new_project_merge_request_path(@project), class: "pull-right btn btn-new", title: "New Merge Request" do - %i.fa.fa-plus - New Merge Request -%h3.page-title - Merge Requests -%hr += render "projects/issues_nav" + .row .fixed.sidebar-expand-button.hidden-lg.hidden-md %i.fa.fa-list.fa-2x diff --git a/app/views/projects/milestones/index.html.haml b/app/views/projects/milestones/index.html.haml index 03367b7cdbf..0db0b114d63 100644 --- a/app/views/projects/milestones/index.html.haml +++ b/app/views/projects/milestones/index.html.haml @@ -1,4 +1,4 @@ -= render "projects/issues/head" += render "projects/issues_nav" .milestones_content %h3.page-title Milestones diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml index 8263f7530a2..f08ccc1d570 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -1,4 +1,4 @@ -= render "projects/issues/head" += render "projects/issues_nav" %h3.page-title Milestone ##{@milestone.iid} .pull-right |