aboutsummaryrefslogtreecommitdiff
blob: 58030c5e5b3aff6fd1d1c77a890409b8b677ea3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<h1>Prepare release</h1>

<div class="box w40em">
  <h2>Advisory information</h2>

  <table>
    <% if @glsa.status == 'draft' %>
    <tr>
      <td>Current ID</td>
      <td><strong>GLSA <%= @glsa.glsa_id %></strong></td>
    </tr>
    <tr>
      <td>Final ID</td>
      <td><strong>GLSA <%= Glsa.next_id %> (preliminary)</strong></td>
    </tr>
    <% elsif @glsa.status == 'release' %>
      <tr>
        <td>Release ID</td>
        <td><strong>GLSA <%= @glsa.glsa_id %></strong> (this will be a re-release)</td>
      </tr>
    <% end %>
    <tr>
      <td>Advisory title</td>
      <td><strong><%= @rev.title %></strong></td>
    </tr>
  </table>
</div>

<div class="box w40em">
  <h2>
    <span class="toolbar">
      <%= check_icon(@rev.bug_ready?) %>
    </span>
    <%= image_tag 'icons/bug.png' %> Bug Status
  </h2>
  <table class="list">
    <%= render :partial => "show_bug_row", :collection => @rev.bugs, :as => :bug %>
  </table>

  <% if not @rev.bug_ready? %>
    <div class="error">
      <p>
        <strong>You cannot release this draft unless all bugs are in a bug ready state.</strong><br />
        Visit Bugzilla and check the status of each bug marked with a <%= bugready_icon(false) %>, and set it to <tt>[glsa]</tt> if every arch is done.
        Then, refresh the bug caches.
      </p>
      <div class="actions">
        <%= button_to "Refresh bug caches and retry", { :action => 'update_cache', :id => @glsa.id, :redirect => request.url }, :method => 'get' %>
      </div>
    </div>
  <% end %>
</div>

<div class="box w40em">
  <h2>
    <span class="toolbar">
      <%= check_icon((@glsa.is_approved? or @comments_override)) %>
    </span>
    <%= image_tag 'icons/comment.png' %> Review Status
    (<%= @glsa.approvals.length %> <%= image_tag 'icons/approved.png' %>, <%= @glsa.rejections.length %> <%= image_tag 'icons/not-approved.png' %>)
  </h2>
  <table class="list">
    <%= render :partial => "approval_row", :collection => @glsa.approvals, :as => :comment %>
    <%= render :partial => "approval_row", :collection => @glsa.rejections, :as => :comment %>
  </table>
 
  <% if not (@glsa.is_approved? or @comments_override) %>
    <div class="error">
      <p>
        <strong>You cannot release this draft unless it has at least two approvals.</strong><br />
        Ask other Security members to review your draft. (Team leads can override this check.)
        Then, refresh this page.
      </p>
      <% if current_user.is_el_jefe? %>
        <div class="actions">
          <%= button_to "Override this check (team leads only)", prepare_release_glsa_path(@glsa, :override_approvals => 1) %>
        </div>
      <% end %>
    </div>
  <% elsif @comments_override %>
    <p>
      <strong>Approval override used.</strong>
    </p>
  <% end %>
</div>

<div class="box w40em">
  <h2>
    <%= image_tag 'icons/sent.png', :alt => 'release' %> Release
  </h2>
  <% if @rev.bug_ready? and (@glsa.is_approved? or @comments_override) %>
  <p>
    All checks passed. You can release this advisory now.
  </p>
  <%= form_tag(release_glsa_path(@glsa)) do %>
  <table>
    <tr>
      <td><%= check_box_tag 'email'  %></td>
      <td><label for='email'>Send me the final version via email.</label></td>
    </tr>
  </table>
  <div class='box-actions'>
    <%= submit_tag 'Release >', :class => 'largetext' %>
  </div>
  <% end %>
  <% else %>
  <p>
    At least one check failed. Please see the red boxes above.<br />
    You cannot release this draft at the moment.
  </p>
  <% end %>
</div>