aboutsummaryrefslogtreecommitdiff
blob: 3d5b8015dd5cb985c5c8b674b37f56c2255de60e (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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<h1>
  Edit GLSA <code><%= @glsa.glsa_id %></code>
</h1>

<%= form_for @glsa do |f| -%>
<div style="float: right; width: 44%;">
  <div class="box">
    <%= box_title('Permissions', :icon => 'icons/permission.png') %>
    <p><label for="permissions">This GLSA is</label>:
      <select name="glsa[restricted]" id="permissions">
        <%= options_for_select %w{ public confidential }, @glsa.restricted ? "confidential" : "public" %>
      </select>
    </p>
  </div>

  <div class="box">
    <%= box_title('Metadata', :icon => 'icons/metadata.png') %>
    <p style="float: left; width: 50%;"><label for="access"><%= image_tag 'icons/access.png' %> Access:</label>
      <select name="glsa[access]" id="access">
        <%= options_for_select [['local', 'local'], ['remote', 'remote'], ['local, remote', 'both']], lastrev_content(@glsa, 'access') %>
      </select>
    </p>
    <p><label for="severity"><%= image_tag 'icons/severity.png' %> Severity:</label>
      <select name="glsa[severity]" id="severity">
        <%= options_for_select %w{ low normal high }, lastrev_content(@glsa, 'severity') %>
      </select>
    </p>
    <p><label for="keyword"><%= image_tag 'icons/keyword.png' %> GLSA Keyword:</label>
      <%= text_field_tag "glsa[product]", lastrev_content(@glsa, 'product'), :class => "nice" %>
    </p>
  </div>

  <div class="box">
    <%= box_title('Background', :icon => 'icons/background.png', :label => 'background') %>
    <p>
      <textarea name="glsa[background]" id="background" class="nice" rows="3"><%= lastrev_content(@glsa, 'background') %></textarea>
    </p>
  </div>

  <div class="box">
    <%= box_title('Bugs', :icon => 'icons/bug.png',
                  :toolbar => [{:uri => "javascript:GLSAMaker.editing.bugs.add_dialog(#{@glsa.id})", :title => 'Add bug', :icon => 'icons/plus.png'}]) %>
    <table id="bugtable">
      <%= render :partial => "edit_bug_row", :collection => @bugs, :as => :bug %>
    </table>
  </div>

  <%= render :partial => "comments" %>

  <div style="text-align: right;">
    <input type="submit" class="button" style="font-size: 150%;" value="Save &rarr;" />
  </div>
</div>

<div id="left">
  <div class="box">
    <%= box_title('Title', :icon => 'icons/title.png',
        :toolbar => [{:title => 'Add template', :uri => "javascript:GLSAMaker.editing.templates.dropdown(this, 'title');", :icon => 'icons/template.png'}]) %>
    <p><textarea name="glsa[title]" id="title" class="largetext nice" rows="1"><%= lastrev_content(@glsa, 'title') %></textarea></p>
  </div>

  <div class="box">
    <%= box_title('Synopsis', :icon => 'icons/synopsis.png', :label => 'synopsis',
                  :toolbar => [
                          {:title => 'Add template', :uri => "javascript:GLSAMaker.editing.templates.dropdown(this, 'synopsis');", :icon => 'icons/template.png'}
                  ]
        ) %>
    <p><textarea name="glsa[synopsis]" id="synopsis" class="nice" rows="1"><%= lastrev_content(@glsa, 'synopsis') %></textarea></p>
  </div>

  <div class="box">
    <%= box_title('Packages', :icon => 'icons/package.png') %>

    <table class="padcells swap centercells" id="packages_table_vulnerable">
      <tr>
        <th><%= image_tag 'icons/atom.png' %> Atom</th>
        <th class="odd" colspan="2">Version</th>
        <th><%= image_tag 'icons/arch.png' %> Arch</th>
        <th class="odd"><%= image_tag 'icons/auto.png' %> Auto</th>
      </tr>

      <tr>
        <td><%= image_tag 'icons/affected.png' %> Vulnerable
        (<%= add_vulnerable_package_link(image_tag('icons/package-add.png')) %>)</td>
      </tr>
      <%= render :partial => 'package', :collection => @vulnerable_packages %>
    </table>

    <table class="padcells swap centercells" id="packages_table_unaffected">
      <tr>
        <td><%= image_tag 'icons/unaffected.png' %> Unaffected
            (<%= add_unaffected_package_link(image_tag('icons/package-add.png')) %>)</td>
      </tr>
      <%= render :partial => 'package', :collection => @unaffected_packages %>

    </table>
  </div>

  <div class="box" id="desc-box">
    <%= box_title('Description', :icon => 'icons/document.png', :label => 'description',
                  :toolbar => [
                          {:title => 'Add template', :uri => "javascript:GLSAMaker.editing.templates.dropdown(this, 'description');", :icon => 'icons/template.png'},
                          {:title => 'Set default description', :uri => "javascript:generateDescription()", :icon => 'icons/document-go.png'},
                          :sep,
                          {:title => 'Fewer lines', :uri => "javascript:lines('description', -5)", :icon => 'icons/zoom_out.png'},
                          {:title => 'Reset lines', :uri => "javascript:$('description').rows = 15", :icon => 'icons/zoom_100.png'},
                          {:title => 'More lines', :uri => "javascript:lines('description', 5)", :icon => 'icons/zoom_in.png'}
                  ]
        ) %>
    <p><textarea name="glsa[description]" id="description" class="nice" rows="15"><%= lastrev_content(@glsa, 'description') %></textarea></p>
  </div>

  <div class="box">
    <%= box_title('Impact', :icon => 'icons/impact.png', :label => 'impact',
                  :toolbar => [
                          {:title => 'Add template', :uri => "javascript:GLSAMaker.editing.templates.dropdown(this, 'impact');", :icon => 'icons/template.png'},
                          :sep,
                          {:title => 'Fewer lines', :uri => "javascript:lines('impact', -5)", :icon => 'icons/zoom_out.png'},
                          {:title => 'Reset lines', :uri => "javascript:$('impact').rows = 15", :icon => 'icons/zoom_100.png'},
                          {:title => 'More lines', :uri => "javascript:lines('impact', 5)", :icon => 'icons/zoom_in.png'}
                  ]
        ) %>
    <p><textarea name="glsa[impact]" id="impact" class="nice" rows="5"><%= lastrev_content(@glsa, 'impact') %></textarea></p>
  </div>
  
  <div class="box">
    <%= box_title('Workaround', :icon => 'icons/workaround.png', :label => 'workaround',
                  :toolbar => [
                          {:title => 'Add template', :uri => "javascript:GLSAMaker.editing.templates.dropdown(this, 'workaround');", :icon => 'icons/template.png'},
                          {:title => 'No known workaround', :uri => "javascript:$('workaround').value = 'There is no known workaround at this time.'", :icon => 'icons/workaround-no.png'}
                  ]
        ) %>
    <p><textarea name="glsa[workaround]" id="workaround" class="nice" rows="2"><%= lastrev_content(@glsa, 'workaround') %></textarea></p>
  </div>
  
  <div class="box">
    <%= box_title('Resolution', :icon => 'icons/resolution.png', :label => 'resolution',
                  :toolbar => [
                          {:title => 'Add template', :uri => "javascript:GLSAMaker.editing.templates.dropdown(this, 'resolution');", :icon => 'icons/template.png'},
                          {:title => 'Set default resolution', :uri => "javascript:generateResolution()", :icon => 'icons/resolution-go.png'}
                  ]
        ) %>
    <p><textarea name="glsa[resolution]" id="resolution" class="nice" rows="5"><%= lastrev_content(@glsa, 'resolution') %></textarea></p>
  </div>

  <div class="box">
    <%= box_title('References', :icon => 'icons/reference.png',
                  :toolbar => [
                          {:title => 'Add reference', :uri => "javascript:Element.insert('references_table', { bottom: '#{escape_javascript(render(:partial => 'reference', :object => Reference.new))}' })", :icon => 'icons/reference-add.png'}
                  ]
        ) %>
    <table class="padcells swap centercells" id="references_table">
    <tr>
      <th><%= image_tag 'icons/atom.png' %> Title</th>
      <th><%= image_tag 'icons/reference.png' %> URL</th>
      <th></th>
    </tr>

    <%= render :partial => 'reference', :collection => @references %>
    </table>
  </div>

</div>

<%- end -%>

<%= template_popups %>

<script language="JavaScript" type="text/javascript">
  GLSAMaker.editing.templates.observeClick($('title'));
  GLSAMaker.editing.templates.observeClick($('synopsis'));
  GLSAMaker.editing.templates.observeClick($('description'));
  GLSAMaker.editing.templates.observeClick($('impact'));
  GLSAMaker.editing.templates.observeClick($('workaround'));
  GLSAMaker.editing.templates.observeClick($('resolution'));
</script>