summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-01-12 14:55:54 -0500
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-01-12 14:55:54 -0500
commit63363e47f4228e15585b0908d91c8749b1067d37 (patch)
treeb4c348cfc4ca83ce58d58794815151ed513ceada /app
parente6f34237bc85f6347a895526179498c56c866970 (diff)
downloadgitlab-ce-63363e47f4228e15585b0908d91c8749b1067d37.tar.gz
reverting more MR ajax files, will appear in different commit
Diffstat (limited to 'app')
-rw-r--r--app/views/projects/merge_requests/widget/_open.html.haml39
-rw-r--r--app/views/projects/merge_requests/widget/_show.html.haml14
-rw-r--r--app/views/projects/merge_requests/widget/open/_archived.html.haml2
3 files changed, 30 insertions, 25 deletions
diff --git a/app/views/projects/merge_requests/widget/_open.html.haml b/app/views/projects/merge_requests/widget/_open.html.haml
index 2257a166460..55dbae598d3 100644
--- a/app/views/projects/merge_requests/widget/_open.html.haml
+++ b/app/views/projects/merge_requests/widget/_open.html.haml
@@ -1,23 +1,24 @@
-.mr-state-widget.mr-state-widget-opened{class: merge_request_widget_visibility(@merge_request, "opened","reopened")}
+.mr-state-widget
= render 'projects/merge_requests/widget/heading'
- .mr-widget-body.merge-request-archived{class: ("hidden" unless @project.archived?)}
- = render 'projects/merge_requests/widget/open/archived'
- .mr-widget-body.merge-request-blank{class: ("hidden" unless @merge_request.commits.blank?)}
- = render 'projects/merge_requests/widget/open/nothing'
- .mr-widget-body.merge-request-branch-missing{class: ("hidden" unless @merge_request.branch_missing?)}
- = render 'projects/merge_requests/widget/open/missing_branch'
- .mr-widget-body.merge-request-unchecked{class: ("hidden" unless @merge_request.unchecked?)}
- = render 'projects/merge_requests/widget/open/check'
- .mr-widget-body.merge-request-cannot-be-merged{class: ("hidden" unless @merge_request.cannot_be_merged?)}
- = render 'projects/merge_requests/widget/open/conflicts'
- .mr-widget-body.merge-request-work-in-progress{class: ("hidden" unless @merge_request.work_in_progress?)}
- = render 'projects/merge_requests/widget/open/wip'
- .mr-widget-body.merge-request-merge-when-build-succeeds{class: ("hidden" unless @merge_request.merge_when_build_succeeds?)}
- = render 'projects/merge_requests/widget/open/merge_when_build_succeeds'
- .mr-widget-body.not-allowed{class: ("hidden" if @merge_request.can_be_merged_by?(current_user))}
- = render 'projects/merge_requests/widget/open/not_allowed'
- .mr-widget-body.merge-request-archived.can-be-merged{class: ("hidden" unless @merge_request.can_be_merged?)}
- = render 'projects/merge_requests/widget/open/accept'
+ .mr-widget-body
+ - if @project.archived?
+ = render 'projects/merge_requests/widget/open/archived'
+ - elsif @merge_request.commits.blank?
+ = render 'projects/merge_requests/widget/open/nothing'
+ - elsif @merge_request.branch_missing?
+ = render 'projects/merge_requests/widget/open/missing_branch'
+ - elsif @merge_request.unchecked?
+ = render 'projects/merge_requests/widget/open/check'
+ - elsif @merge_request.cannot_be_merged?
+ = render 'projects/merge_requests/widget/open/conflicts'
+ - elsif @merge_request.work_in_progress?
+ = render 'projects/merge_requests/widget/open/wip'
+ - elsif @merge_request.merge_when_build_succeeds?
+ = render 'projects/merge_requests/widget/open/merge_when_build_succeeds'
+ - elsif !@merge_request.can_be_merged_by?(current_user)
+ = render 'projects/merge_requests/widget/open/not_allowed'
+ - elsif @merge_request.can_be_merged?
+ = render 'projects/merge_requests/widget/open/accept'
- if @closes_issues.present?
.mr-widget-footer
diff --git a/app/views/projects/merge_requests/widget/_show.html.haml b/app/views/projects/merge_requests/widget/_show.html.haml
index d8f81dab067..a489d4f9b24 100644
--- a/app/views/projects/merge_requests/widget/_show.html.haml
+++ b/app/views/projects/merge_requests/widget/_show.html.haml
@@ -1,13 +1,17 @@
-= render 'projects/merge_requests/widget/open'
-= render 'projects/merge_requests/widget/merged'
-= render 'projects/merge_requests/widget/closed'
-= render 'projects/merge_requests/widget/locked'
+- if @merge_request.open?
+ = render 'projects/merge_requests/widget/open'
+- elsif @merge_request.merged?
+ = render 'projects/merge_requests/widget/merged'
+- elsif @merge_request.closed?
+ = render 'projects/merge_requests/widget/closed'
+- elsif @merge_request.locked?
+ = render 'projects/merge_requests/widget/locked'
:javascript
var merge_request_widget;
merge_request_widget = new MergeRequestWidget({
- url_to_automerge_check: "#{merge_check_namespace_project_merge_request_path(@project.namespace, @project, @merge_request, format: :json)}",
+ url_to_automerge_check: "#{merge_check_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
check_enable: #{@merge_request.unchecked? ? "true" : "false"},
url_to_ci_check: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
ci_enable: #{@project.ci_service ? "true" : "false"},
diff --git a/app/views/projects/merge_requests/widget/open/_archived.html.haml b/app/views/projects/merge_requests/widget/open/_archived.html.haml
index 0d61e56d8fb..ab30fa6b243 100644
--- a/app/views/projects/merge_requests/widget/open/_archived.html.haml
+++ b/app/views/projects/merge_requests/widget/open/_archived.html.haml
@@ -1,4 +1,4 @@
-%h4
+%h4
Project is archived
%p
This merge request cannot be merged because archived projects cannot be written to.