aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/report/updates.html
blob: fc2ac6c7887a04e179085489a428d9ded4faa394 (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
[% global.last_state = '' %]
[% FOREACH update IN updates %]
[% INCLUDE 'report/update.html' %]
[% END %]

[% BLOCK meta_line %]

    [% IF update.whenanswered %]
        [%# A questionnaire update, currently saying report is still open %]
        [% tprintf( loc( 'Still open, via questionnaire, %s' ), prettify_dt( update.whenanswered ) ) %]
        [% RETURN %]
    [% END %]

    [% IF update.anonymous || update.name == '' %]
        [% tprintf( loc( 'Posted anonymously at %s' ), prettify_dt( update.confirmed ) ) -%]
    [%- ELSIF update.user.from_body;
        user_name = update.user.name | html;
        body = update.user.body;
        IF body == 'Bromley Council';
            body = "$body <img src='/cobrands/bromley/favicon.png' alt=''>";
        END %]
        [% tprintf( loc( 'Posted by %s (<strong>%s</strong>) at %s' ), user_name, body, prettify_dt( update.confirmed ) ) -%]
    [%- ELSE %]
        [% tprintf( loc( 'Posted by %s at %s' ), update.name, prettify_dt( update.confirmed ) ) | html -%]
    [%- END -%]

    [%- update_state = '' %]
    [%- IF update.mark_fixed %][% update_state = loc( 'marked as fixed' ) %][% END %]
    [%- IF update.mark_open %][% update_state = loc( 'reopened' ) %][% END %]
    [%- IF !update_state && update.problem_state %]
        [%- state = update.problem_state_display %]
        [%- IF c.cobrand.moniker == 'bromley' OR problem.bodies_str == '2482' %]
            [%- SET update_state = 'marked as no further action' IF state == 'unable to fix' %]
            [%- SET update_state = 'marked as third party responsibility' IF state == 'not responsible' %]
        [%- END %]
    [%- END %]
    [%- IF !update_state && update.problem_state %]
        [%- IF state == 'confirmed' AND global.last_state != '' %]
            [%- update_state = loc( 'reopened' ) %]
        [%- ELSIF state == 'investigating' %]
            [%- update_state = loc( 'marked as investigating' ) %]
        [%- ELSIF state == 'planned' %]
            [%- update_state = loc( 'marked as planned' ) %]
        [%- ELSIF state == 'in progress' %]
            [%- update_state = loc( 'marked as in progress' ) %]
        [%- ELSIF state == 'action scheduled' %]
            [%- update_state = loc( 'marked as action scheduled' ) %]
        [%- ELSIF state == 'closed' %]
            [%- update_state = loc( 'marked as closed' ) %]
        [%- ELSIF state == 'fixed' %]
            [%- update_state = loc( 'marked as fixed' ) %]
        [%- ELSIF state == 'unable to fix' %]
            [%- update_state = loc( 'marked as unable to fix' ) %]
        [%- ELSIF state == 'not responsible' %]
            [%- update_state = loc( "marked as not the council's responsibility" ) %]
        [%- ELSIF state == 'duplicate' %]
            [%- update_state = loc( 'marked as a duplicate report' ) %]
        [%- ELSIF state == 'internal referral' %]
            [%- update_state = loc( 'marked as an internal referral' ) %]
        [%- END %]
    [%- END %]
    [%- ", " _ update_state IF update_state != global.last_state %]
    [%- global.last_state = update_state %]
[% END %]