2015-06-11 03:40:26 -04:00
|
|
|
- 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'
|
2015-06-11 12:27:03 -04:00
|
|
|
|
|
|
|
:javascript
|
2016-01-25 16:20:24 -05:00
|
|
|
var opts = {
|
2016-03-18 07:08:03 -04:00
|
|
|
merge_check_url: "#{merge_check_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
|
2015-06-11 12:27:03 -04:00
|
|
|
check_enable: #{@merge_request.unchecked? ? "true" : "false"},
|
2016-03-18 07:08:03 -04:00
|
|
|
ci_status_url: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
|
2016-10-07 18:10:06 -04:00
|
|
|
ci_environments_status_url: "#{ci_environments_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
|
2016-03-04 18:22:39 -05:00
|
|
|
gitlab_icon: "#{asset_path 'gitlab_logo.png'}",
|
2016-11-28 05:13:32 -05:00
|
|
|
ci_status: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.status : ''}",
|
2016-04-06 12:04:22 -04:00
|
|
|
ci_message: {
|
|
|
|
normal: "Build {{status}} for \"{{title}}\"",
|
|
|
|
preparing: "{{status}} build for \"{{title}}\""
|
|
|
|
},
|
2016-03-18 07:08:03 -04:00
|
|
|
ci_enable: #{@project.ci_service ? "true" : "false"},
|
2016-04-06 12:04:22 -04:00
|
|
|
ci_title: {
|
|
|
|
preparing: "{{status}} build",
|
|
|
|
normal: "Build {{status}}"
|
|
|
|
},
|
2016-12-28 11:53:05 -05:00
|
|
|
ci_sha: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.short_sha : ''}",
|
|
|
|
ci_pipeline: #{@merge_request.head_pipeline.try(:id).to_json},
|
|
|
|
commits_path: "#{project_commits_path(@project)}",
|
|
|
|
pipeline_path: "#{project_pipelines_path(@project)}",
|
2016-07-22 20:28:39 -04:00
|
|
|
pipelines_path: "#{pipelines_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}"
|
2016-01-25 16:20:24 -05:00
|
|
|
};
|
2016-03-16 10:52:56 -04:00
|
|
|
|
2016-04-22 05:50:04 -04:00
|
|
|
if (typeof merge_request_widget !== 'undefined') {
|
|
|
|
merge_request_widget.cancelPolling();
|
|
|
|
merge_request_widget.clearEventListeners();
|
|
|
|
}
|
|
|
|
|
2016-10-04 10:03:13 -04:00
|
|
|
merge_request_widget = new window.gl.MergeRequestWidget(opts);
|