Commit c0220198 authored by Jacob Schatz's avatar Jacob Schatz

removing last chunk of MR ajax changes, rest will be in another MR

parent 63363e47
...@@ -466,6 +466,16 @@ class MergeRequest < ActiveRecord::Base ...@@ -466,6 +466,16 @@ class MergeRequest < ActiveRecord::Base
::Gitlab::GitAccess.new(user, project).can_push_to_branch?(target_branch) ::Gitlab::GitAccess.new(user, project).can_push_to_branch?(target_branch)
end end
def state_human_name
if merged?
"Merged"
elsif closed?
"Closed"
else
"Open"
end
end
def target_sha def target_sha
@target_sha ||= target_project. @target_sha ||= target_project.
repository.commit(target_branch).sha repository.commit(target_branch).sha
......
- content_for :note_actions do - content_for :note_actions do
- if can?(current_user, :update_issue, @issue) - if can?(current_user, :update_issue, @issue)
= link_to 'Reopen Issue', issue_path(@issue, issue: {state_event: :reopen}, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "btn btn-nr btn-grouped btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen Issue' - if @issue.closed?
= link_to 'Close Issue', issue_path(@issue, issue: {state_event: :close}, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "btn btn-nr btn-grouped btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close Issue' = link_to 'Reopen Issue', issue_path(@issue, issue: {state_event: :reopen}, status_only: true), method: :put, class: 'btn btn-nr btn-grouped btn-reopen js-note-target-reopen', title: 'Reopen Issue'
- else
= link_to 'Close Issue', issue_path(@issue, issue: {state_event: :close}, status_only: true), method: :put, class: 'btn btn-nr btn-grouped btn-close js-note-target-close', title: 'Close Issue'
#notes #notes
= render 'projects/notes/notes_with_form' = render 'projects/notes/notes_with_form'
.mr-state-widget.mr-state-widget-closed{class: merge_request_widget_visibility(@merge_request, 'closed')} .mr-state-widget
= render 'projects/merge_requests/widget/heading' = render 'projects/merge_requests/widget/heading'
.mr-widget-body .mr-widget-body
%h4 %h4
......
.mr-state-widget.mr-state-widget-locked{class: merge_request_widget_visibility(@merge_request, 'locked')} .mr-state-widget
= render 'projects/merge_requests/widget/heading' = render 'projects/merge_requests/widget/heading'
.mr-widget-body .mr-widget-body
%h4 %h4
......
.mr-state-widget.mr-state-widget-merged{class: merge_request_widget_visibility(@merge_request, 'merged')} .mr-state-widget
= render 'projects/merge_requests/widget/heading' = render 'projects/merge_requests/widget/heading'
.mr-widget-body .mr-widget-body
%h4 %h4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment