aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/admin/body.html
blob: d5e575666eaed127d57c927178299e7bad30f26a (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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), body.name) -%]
[% PROCESS 'admin/report_blocks.html' %]

[% IF updated %]
  <p>
    <em>[% updated %]</em>
  </p>
[% END %]

[% IF NOT errors %]

<p>
  [% IF example_pc %]
    <a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]" class="admin-offsite-link">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a> |
  [% END %]
    [% loc('Area covered') %]:
    [% SET body_areas = body.areas %]
    [% FOR area IN areas %]
      [% SET aid = area.id %]
      [% IF body_areas.$aid %]
        <a href="[% c.config.MAPIT_URL %][%
        '/' UNLESS c.config.MAPIT_URL.search('/$')
        %]area/[% aid %].html" class="admin-offsite-link">[% area.name | html %]</a>
      [% END %]
    [% END %]
<br>
    <a href="[% c.uri_for_email(body.url(c)) %]" class="admin-offsite-link">[% loc('List all reported problems' ) %]</a> |
    <a href="[% c.uri_for( 'body', body_id, { text => 1 } ) %]">[% loc('Text only version') %]</a>
</p>


[% IF body.send_method == 'Open311' %]
  <h2>
    Council contacts configured via Open311
  </h2>
[% END %]

[% IF c.cobrand.moniker == 'fixmystreet' %]
  <p class="error">Do not give these out except to people at the council.</p>
[% END %]

[% IF body.areas.size == 0 %]
  <p class="fms-admin-warning">
    [% loc("This body covers no area. This means that it has no jurisdiction over problems reported <em>at any location</em>.
            Consequently, none of its categories will appear in the drop-down category menu when users report problems.
            Currently, users <strong>cannot report problems to this body</strong>.") %]
    <br>
    [% loc("Fix this by choosing an <strong>area covered</strong> in the <em>Edit body details</em> form below.") %]
  </p>
[% END %]

[% IF live_contacts == 0 %]
  <p class="fms-admin-warning">
    [% loc("This body has no contacts. This means that currently problems reported to this body <strong>will not be sent</strong>.") %]
    <br>
    [% loc("Add a contact using the form below.") %]
  </p>
[% ELSIF c.config.STAGING_SITE and !c.config.SEND_REPORTS_ON_STAGING %]
  <p class="fms-admin-warning">
    [% tprintf(loc("As this is a staging site and %s is false, reports made on this site will be sent to the problem reporter, not the contact given for the report’s category."), "<a class='admin-offsite-link' href='http://fixmystreet.org/customising/config/#send_reports_on_staging'><code>SEND_REPORTS_ON_STAGING</code></a>") %]
  </p>
[% END %]

<form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">

  <table cellspacing="0" cellpadding="2" border="1">
    <tr>
      <th>[% loc('Category') %]</th>
      <th colspan=2>[% loc('State') %]</th>
      <th>[% loc('Last editor') %]</th>
      <th>[% loc('Note') %]</th>
      <th>[% loc('Confirm') %]</th>
    </tr>
    [% WHILE ( cat = contacts.next ) %]
      <tr [% IF cat.deleted %]class="is-deleted"[% END %]>
        <td class="contact-category"><a href="[% c.uri_for( 'body', body_id, cat.category ) %]">[% cat.category | html %]</a>
            <br>[% cat.email | html %]</td>
        <td>
            [% loc('Confirmed') %]:&nbsp;
            [%- IF cat.confirmed %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]
            <br>[% loc('Deleted') %]:&nbsp;
            [%- IF cat.deleted %]<strong>[% loc('Yes') %]</strong>[% ELSE %][% loc('No') %][% END %]
        </td>
        <td>
            [% loc('Private') %]:&nbsp;
            [%- cat.non_public ? loc('Yes') : loc('No') %]
            <br>[% loc('Devolved') %]:&nbsp;
            [%- IF body.can_be_devolved AND cat.send_method %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]
        </td>
        <td>[% cat.editor | html %]
            <br><small>[% PROCESS format_time time=cat.whenedited %]</small></td>
        <td>[% cat.note | html %]</td>
        <td><input type="checkbox" name="confirmed" value="[% cat.category | html %]"></td>
      </tr>
    [% END %]
  </table>

  <p>
    <input type="hidden" name="posted" value="update">
    <input type="hidden" name="token" value="[% token %]">
    <input type="submit" name="Update statuses" value="[% loc('Update statuses') %]">
  </p>
</form>

<p class="fms-admin-info">
    [% loc("Each contact for the body has a category, which is displayed to the public. 
            Different categories <strong>can have the same contact</strong> (email address).
            This means you can add many categories even if you only have one contact for the body.
    ") %]
</p>

[% END %][%# Only show all the above if no errors with below form %]

<div class="admin-box">
  [% IF NOT contact %]
    <h2>[% loc('Add new category') %]</h2>
  [% END %]

[% IF errors %]
<div class="fms-admin-warning">
  [% errors.values.join('<br>') %]
</div>
[% END %]

  <form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">

      <div class="admin-hint">
        <p>
          [% loc('Choose a <strong>category</strong> name that makes sense to the public (e.g., "Pothole", "Street lighting") but is helpful
                  to the body too. These will appear in the drop-down menu on the report-a-problem page.') %]
          <br>
          [% loc("If two or more bodies serve the same location, FixMyStreet combines identical categories into a single entry in
                  the menu. Make sure you use the same category name in the bodies if you want this to happen.") %]
        </p>
      </div>
      <p>
        <strong>[% loc('Category:') %] </strong><input type="text" name="category" size="30" value="[% contact.category | html %]">
      </p>

    <div class="admin-hint">
      <p>
        [% loc("The <strong>email address</strong> is the destination to which reports about this category will be sent. 
        Other categories for this body may have the same email address.") %]
      </p>
      [% IF (body.send_method AND body.send_method != 'Email') OR body.can_be_devolved  %]
        <p>
            [% loc("If you're using <strong>a send method that is not email</strong>, enter the service ID (Open311) or equivalent identifier here.") %]
        </p>
      [% END %]
    </div>

    <p>
      <strong>[% loc('Email address:') %] </strong><input type="text" name="email" size="30" value="[% contact.email | html %]">
    </p>

    <div class="admin-hint">
      <p>
        [% loc("Check <strong>confirmed</strong> to indicate that this contact has been confirmed as correct.
                If you are not sure of the origin or validity of the contact, leave this unchecked.") %]
      </p>
    </div>
    <p>
      <input type="checkbox" name="confirmed" value="1" id="confirmed"[% ' checked' IF contact.confirmed OR contact.confirmed == "" %]>
      <label for="confirmed" class="inline">[% loc('Confirmed') %]</label>
    </p>

    <div class="admin-hint">
      <p>
        [% loc("Check <strong>deleted</strong> to remove the category from use. 
        It will not appear as an available category in the drop-down menu on the report-a-problem page.") %]
      </p>
    </div>
    <p>
      <input type="checkbox" name="deleted" value="1" id="deleted"[% ' checked' IF contact.deleted %]>
      <label for="deleted" class="inline">[% loc('Deleted') %]</label>
    </p>

    <div class="admin-hint">
      <p>
        [% loc("Use the <strong>note</strong> to record details that are only displayed in the admin. Notes are not shown publicly, and are not sent to the body.") %]
      </p>
    </div>
    <p>
      <strong>[% loc('Note:') %] </strong> <textarea name="note" rows="3" cols="40"></textarea>
    </p>

    <div class="admin-hint">
      <p>
        [% loc("Check <strong>private</strong> if reports in this category should <strong>never be displayed on the website</strong>.
                <br>
                Normally, categories are not private.
                <br>
                This is suitable for issues that you want to allow users to report to the body, but for which there is no public
                interest in displaying the report. In the UK, we've used this for services like requesting an extra rubbish bin
                at a specific address.") %]
      </p>
    </div>
    <p>
      <input type="checkbox" name="non_public" value="1" id="non_public" [% ' checked' IF contact.non_public %]>
      <label for="non_public" class="inline">[% loc('Private') %]</label>
    </p>

    <p>
      <input type="hidden" name="posted" value="new" >
      <input type="hidden" name="token" value="[% token %]" >
      <input type="submit" name="Create category" value="[% errors ? loc('Save changes') : loc('Create category') %]" >
    </p>

    <div>
      <input type="hidden" name=".cgifields" value="confirmed" >
      <input type="hidden" name=".cgifields" value="deleted" >
    </div>
  </form>
</div>

[% IF NOT errors %]
<div class="admin-box">
  <h2>[% loc('Edit body details') %]</h2>
  [% INCLUDE 'admin/body-form.html' %]
</div>
[% END %][%# Only show all the above if no errors with category form %]

[% INCLUDE 'admin/footer.html' %]