1
2<form method="post" id="{{ formName }}">
3  <input name="lastItem" id="lastItem" type="hidden" value="{{ itemId }}"/>
4  <input name="upload" id="upload" type="hidden" value="{{ uploadId }}"/>
5  <input name="changedSomething" id="changedSomething" type="hidden" value="false"/>
6  <table>
7    <tr>
8      <td>
9        <div class="groupBox">
10          <button type="submit" name="update"  id="prev" disabled >&lt;</button>
11          <button type="submit" name="update" onclick="form.action = '{{ uri }}&item={{ itemId }}';">Submit</button>
12          <button type="submit" name="update" id="next" disabled  >&gt;</button>
13        </div>
14      </td>
15      <td>
16        <p>
17          <input type="radio" name="FileSelection" id="FileSelection" value="none"> {{ 'Go through all files'|trans }}<br>
18          <input type="radio" name="FileSelection" id="FileSelection" value="{{ skipOption }}"> {{ 'Go through all files'|trans }} {{ 'with'|trans }} {{ xptext|trans }}<br>
19        </p>
20      </td>
21    </tr>
22  </table>
23  <span id="editingExistingWarning" hidden><b>You are editing an existing decision. [<a href="#" onclick="event.preventDefault();clearDecisionEditing();">clear</a>]</b></span>
24  <div class="groupBox">
25    <fieldset style="display:inline">
26      <legend>
27        {{ 'Issue Type'| trans }}
28      </legend>
29      {% for clearingTypeVal, clearingType in clearingTypes %}
30        <input type="radio" {% if clearingTypeVal == selectedClearingType %}checked=""{% endif %} name="clearingTypes"
31               value="{{ clearingTypeVal }}" class="supervised"/>
32        {{ clearingType }}
33        <br/>
34      {% endfor %}
35    </fieldset>
36    <br/>
37    <input type="number" name="decision_pk" value="-1" hidden>
38    {{ 'Description'| trans }}<img src="images/info_16.png" title="{{ 'Classification of the finding, such as copyright statement or TSU number or ECC warning or author but no copyright statement'|trans }}" alt="" class="info-bullet"/>: <br/>
39    <textarea rows="2" name="description" style="width:90%" class="supervised">{{ description }}</textarea><br/>
40    {{ 'Text finding'| trans }}<img src="images/info_16.png" title="{{ 'Exact text finding, if the regular expression match is wrong not matching everything, too much'|trans }}" alt="" class="info-bullet"/>: <br/>
41    <textarea rows="2" name="textFinding" style="width:90%" class="supervised">{{ textFinding }}</textarea><br/>
42    {{ 'Comment'| trans }}<img src="images/info_16.png" title="{{ 'A user can place comment for leaving a notice that ma be viewed by other users on Fossology'|trans }}" alt="" class="info-bullet"/>: <br/>
43    <textarea rows="2" name="comment" style="width:90%" class="supervised">{{ comment }}</textarea><br/>
44  </div>
45</form>
46
47{% if decisions is not empty %}
48  <h3>Current decisions:</h3>
49  <table id="decisionTable" width="100%">
50    <thead><tr>
51      <th>Textfinding</th>
52      <th class="read_only">Info</th>
53      <th class="read_only">Actions</th>
54    </tr></thead>
55    <tbody>
56    {% for row in decisions %}
57      <tr>
58        <td>
59          {{ row.textfinding|e }}
60        </td>
61        <td>
62          <b>Type:</b> {{ clearingTypes[row.clearing_decision_type_fk]|e }}
63          {% if row.description is not empty %}
64            <br/><b>Description:</b> {{ row.description|e }}
65          {% endif %}
66          {% if row.comment is not empty %}
67            <br/><b>Comment:</b> {{ row.comment|e }}
68          {% endif %}
69        </td>
70        <td id='actionsOf{{ row["#{decisionsTable}_pk"] }}'>
71          <span class="basicActions">
72            <img src="images/button_edit.png" onclick="editDecision({{ row["#{decisionsTable}_pk"] }}, '{{ row.textfinding|e('js') }}', '{{ row.description|e('js') }}', '{{ row.comment|e('js') }}', {{ row.clearing_decision_type_fk }});">
73            <img class="delete" src="images/space_16.png" onclick="deleteDecision({{ row["#{decisionsTable}_pk"] }});">
74          </span>
75          <span class="undoActions" hidden>
76            deleted [<a href="#" onclick="event.preventDefault();undoDecision({{ row["#{decisionsTable}_pk"] }});">undo</a>]
77          </span>
78        </td>
79      </tr>
80    {% endfor %}
81    </tbody>
82  </table>
83  <script>
84    function editDecision(pk, textfinding, description, comment, decision_type_fk){
85      $("#{{ formName }} input[name='decision_pk']").val(pk);
86      $("#{{ formName }} textarea[name='textFinding']").val(textfinding);
87      $("#{{ formName }} textarea[name='description']").val(description);
88      $("#{{ formName }} textarea[name='comment']").val(comment);
89      $("#{{ formName }} input[name='clearingTypes'][value='" + decision_type_fk + "']").prop("checked", true);
90      $("#editingExistingWarning").show();
91    }
92
93    function clearDecisionEditing(){
94      $("#{{ formName }} input[name='decision_pk']").val(-1);
95      $("#{{ formName }} textarea[name='textFinding']").val("");
96      $("#{{ formName }} textarea[name='description']").val("");
97      $("#{{ formName }} textarea[name='comment']").val("");
98      $("#editingExistingWarning").hide();
99    }
100
101    function deleteDecision(pk) {
102      $.ajax({
103        type: 'POST',
104        dataType: 'json',
105        url: '?mod=ajax-copyright-hist&action=deletedecision&type={{ agentName }}',
106        data: { decision : pk
107              , upload : '{{ uploadId }}'
108              , pfile : '{{ pfile }}'
109              , uploadTreePk : '{{ itemId }}'},
110        success: function(data) {
111          $("#actionsOf" + pk + " .basicActions").hide();
112          $("#actionsOf" + pk + " .undoActions").show();
113        },
114        error: function() { alert('error'); }
115      });
116    }
117
118    function undoDecision(pk) {
119      $.ajax({
120        type: 'POST',
121        dataType: 'json',
122        url: '?mod=ajax-copyright-hist&action=undodecision&type={{ agentName }}',
123        data: { decision : pk
124          , upload : '{{ uploadId }}'
125          , pfile : '{{ pfile }}'
126          , uploadTreePk : '{{ itemId }}'},
127        success: function(data) {
128          $("#actionsOf" + pk + " .basicActions").show();
129          $("#actionsOf" + pk + " .undoActions").hide();
130        },
131        error: function() { alert('error'); }
132      });
133    }
134  </script>
135{% endif %}
136