aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/report/update.html
blob: ca9397bd48c4a5e4d39786892ddd55a97f1addd7 (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
[% can_moderate = NOT update.whenanswered AND update.type != 'moderation' AND (permissions.moderate OR c.user.can_moderate(update, staff = permissions.moderate)) %]
[% IF loop.first %]
<section class="full-width">
    <h4 class="static-with-rule">[% loc('Updates') %]</h4>
    <ul class="item-list item-list--updates">
[% END %]
        <li class="item-list__item item-list__item--updates
            [%~ ' show-moderation' IF update.id AND show_moderation == update.id ~%]
            ">
            <a name="update_[% update.id %]" class="internal-link-fixed-header"></a>
          [% IF can_moderate; original_update = update.moderation_original_data %]
            <form method="post" action="/moderate/report/[% problem.id %]/update/[% update.id %]">
                <input type="hidden" name="token" value="[% csrf_token %]">
                <a role="menuitem" href="/report/[% problem.id %]/moderate/[% update.id %]#update_[% update.id %]"
                    class="btn js-moderate moderate-display">[% loc('Moderate this update') %]</a>
                <div class="moderate-edit">
                    <label><input type="checkbox" class="hide-document" name="update_hide">
                    [% loc('Hide update completely?') %]</label>
                    <label><input type="checkbox" name="update_show_name" [% update.anonymous ? '' : 'checked' %]>
                    [% loc('Show name publicly?') %]</label>
                    [% IF update.photo or original_update.photo %]
                        <label><input type="checkbox" name="update_photo" [% update.photo ? 'checked' : '' %]>
                        [% loc('Show Photo?') %]</label>
                    [% END %]
                </div>
          [% END %]
            <div class="item-list__update-wrap">
            [% IF update.whenanswered %]
                <div class="item-list__update-text">
                    <p class="meta-2">[% INCLUDE meta_line %]</p>
                </div>
            [% ELSIF update.type == 'moderation' %]
                [% PROCESS 'report/update/moderation.html' %]
            [% ELSE %]
                [% INCLUDE 'report/photo.html' object=update %]
                <div class="item-list__update-text">
                    <div class="moderate-display">
                        [% update.text | add_links | markup(update.user) | html_para %]
                    </div>
                    [% IF can_moderate %]
                    <div class="moderate-edit">
                        [% IF update.text != original.detail %]
                        <label><input type="checkbox" name="update_revert_text" class="revert-textarea">
                        [% loc('Revert to original') %]</label>
                        [% END %]
                        <textarea class="form-control" name="update_text">[% update.text | add_links %]</textarea>
                    </div>
                    [% END %]

                    [% INCLUDE 'report/_update_state.html' %]
                </div>
            [% END %]
            </div>
            [% IF can_moderate %]
                <div class="moderate-edit">
                    <label for="moderation_reason">[% loc('Describe why you are moderating this') %]</label>
                    <input type="text" class="form-control" name="moderation_reason">
                    <input type="submit" class="green-btn" value="[% loc('Save changes') %]">
                    <input type="button" class="hidden-nojs btn cancel" value="[% loc('Discard changes') %]">
                </div>
                </form>
            [% END %]
        </li>
[% IF loop.last %]
    </ul>
</section>
[% END %]