2015-09-11 14:41:01 +05:30
|
|
|
- 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
|
2016-06-02 11:05:42 +05:30
|
|
|
var opts = {
|
|
|
|
merge_check_url: "#{merge_check_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
|
2015-09-11 14:41:01 +05:30
|
|
|
check_enable: #{@merge_request.unchecked? ? "true" : "false"},
|
2016-06-02 11:05:42 +05:30
|
|
|
ci_status_url: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
|
|
|
|
gitlab_icon: "#{asset_path 'gitlab_logo.png'}",
|
2016-06-16 23:09:34 +05:30
|
|
|
ci_status: "#{@merge_request.pipeline ? @merge_request.pipeline.status : ''}",
|
2016-06-02 11:05:42 +05:30
|
|
|
ci_message: {
|
|
|
|
normal: "Build {{status}} for \"{{title}}\"",
|
|
|
|
preparing: "{{status}} build for \"{{title}}\""
|
|
|
|
},
|
2015-09-11 14:41:01 +05:30
|
|
|
ci_enable: #{@project.ci_service ? "true" : "false"},
|
2016-06-02 11:05:42 +05:30
|
|
|
ci_title: {
|
|
|
|
preparing: "{{status}} build",
|
|
|
|
normal: "Build {{status}}"
|
|
|
|
},
|
|
|
|
builds_path: "#{builds_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}"
|
|
|
|
};
|
2015-09-11 14:41:01 +05:30
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
if (typeof merge_request_widget !== 'undefined') {
|
|
|
|
clearInterval(merge_request_widget.fetchBuildStatusInterval);
|
|
|
|
merge_request_widget.cancelPolling();
|
|
|
|
merge_request_widget.clearEventListeners();
|
|
|
|
}
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
merge_request_widget = new MergeRequestWidget(opts);
|