aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/report/update.html
blob: 6dca226fe13578ad0b0ebc708b90e896b0e55915 (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
[% 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">
          [% IF permissions.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 %]">
                <input type="button" class="btn js-moderate moderate-display" value="[% loc('Moderate this update') %]">
                <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_show_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>
            [% ELSE %]
                <a name="update_[% update.id %]" class="internal-link-fixed-header"></a>
                [% 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 permissions.moderate %]
                    <div class="moderate-edit">
                        [% IF update.text != original.detail %]
                        <label><input type="checkbox" name="update_revert_detail" class="revert-textarea">
                        [% loc('Revert to original') %]</label>
                        [% END %]
                        <textarea class="form-control" name="update_detail">[% update.text | add_links %]</textarea>
                    </div>
                    [% END %]

                  [% # Small chance of duplicates in the case of fixed - user followed by fixed - council %]
                  [% SET update_state = update.problem_state %]
                  [% IF ( update_state AND update_state != global.last_state AND NOT (global.last_state == "" AND update.problem_state == 'confirmed') ) OR
                     update.mark_fixed OR update.mark_open
                  %]
                    <p class="meta-2">[% loc('State changed to:') %] [% update.problem_state_display(c) %]</p>
                    [%- global.last_state = update_state %]
                    [%- IF update_state == "" AND update.mark_fixed %][% global.last_state = 'fixed - user' %][% END %]
                    [%- IF update_state == "" AND update.mark_open %][% global.last_state = 'confirmed' %][% END %]
                  [% END %]

                    <p class="meta-2">
                        [% INCLUDE meta_line %]
                        [% IF c.user_exists AND c.user.id == update.user_id AND !update.anonymous %]
                            <small>(<a href="/my/anonymize?update=[% update.id | uri %]" class="js-hide-name">[% loc('Hide your name?') %]</a>)</small>
                        [% END %]
                        [% mlog = update.latest_moderation_log_entry(); IF mlog %]
                            <br />[% tprintf(loc('Moderated by %s at %s'), mlog.admin_user, prettify_dt(mlog.whenedited)) %]
                        [% END %]
                    </p>
                </div>
            [% END %]
            </div>
            [% IF permissions.moderate %]
                <div class="moderate-edit">
                    <label for="moderation_reason">[% loc('Moderation reason:') %]</label>
                    <input type="text" class="form-control" name="moderation_reason"
                        placeholder="[% loc('Describe why you are moderating this') %]">
                    <input type="submit" class="red-btn" value="[% loc('Save changes') %]">
                    <input type="button" class="btn cancel" value="[% loc('Discard changes') %]">
                </div>
                </form>
            [% END %]
        </li>
[% IF loop.last %]
    </ul>
</section>
[% END %]