_show.html.haml 1.15 KB
Newer Older
1 2 3 4 5 6 7 8
- 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'
9 10

:javascript
11
  var opts = {
12
    merge_check_url: "#{merge_check_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
13
    check_enable: #{@merge_request.unchecked? ? "true" : "false"},
14
    ci_status_url: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
15
    gitlab_icon: "#{asset_path 'gitlab_logo.png'}",
16
    ci_status: "",
Phil Hughes's avatar
Phil Hughes committed
17 18 19 20
    ci_message: {
      normal: "Build {{status}} for \"{{title}}\"",
      preparing: "{{status}} build for \"{{title}}\""
    },
21
    ci_enable: #{@project.ci_service ? "true" : "false"},
Phil Hughes's avatar
Phil Hughes committed
22 23 24 25
    ci_title: {
      preparing: "{{status}} build",
      normal: "Build {{status}}"
    },
26
    builds_path: "#{builds_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}"
27
  };
28

Phil Hughes's avatar
Phil Hughes committed
29
  merge_request_widget = new MergeRequestWidget(opts);