aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/admin/template_edit.html
blob: 2945e36c561ddb61861877f9f70af98474ff4f58 (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
[% INCLUDE 'admin/header.html' title=tprintf(loc('Response Template for %s'), body.name) -%]
[% rt = response_template %]

[% UNLESS rt.id %]<h3>[% loc('New template') %]</h3>[% END %]

<form method="post"
    action="[% c.uri_for('templates', body.id, rt.id || 'new' ) %]"
    enctype="application/x-www-form-urlencoded"
    accept-charset="utf-8"
    class="validate">

    [% IF errors %]
        <p class="error">[% loc('Please correct the errors below') %]</p>
    [% END %]


    <div class="admin-hint">
      <p>
        [% loc('This is a <strong>private</strong> name for this template so you can identify it when updating reports or editing in the admin.') %]
      </p>
    </div>
    <p>
        <strong>[% loc('Title:') %] </strong>
        <input type="text" name="title" class="required form-control" size="30" value="[% rt.title | html %]">
    </p>

    <div class="admin-hint">
      <p>
        [% loc('This is the <strong>public</strong> text that will be shown on the site.') %]
      </p>
    </div>
    <p>
        <strong>[% loc('Text:') %] </strong>
        <textarea class="form-control" name="text" class="required">[% rt.text | html %]</textarea>
    </p>

    [% INCLUDE 'admin/category-checkboxes.html' hint=loc('If you only want this template to be an option for specific categories, pick them here. By default they will show for all categories.') %]

    [% IF errors.state %]
        <div class="form-error">[% errors.state %]</div>
    [% END %]
    <div class="admin-hint">
      <p>
        [% loc('If you want to use this template to prefill the update field when changing a report&rsquo;s state, select the state here.') %]
      </p>
    </div>
    <p>
      <label for="state">[% loc('State') %]</label>
      [% INCLUDE 'report/inspect/state_groups_select.html' current_state=rt.state include_empty=1 %]
    </p>

    [% IF errors.external_status_code %]
        <div class="form-error">[% errors.external_status_code %]</div>
    [% END %]
    <div class="admin-hint">
      <p>
        [% loc('If you want to use this template to prefill the update field when a report&rsquo;s <strong>external</strong> (e.g. Confirm) status code changes, enter the status code here.') %]
      </p>
    </div>
    <p>
      <label for="external_status_code">[% loc('External status code') %]</label>
      <input type="text" name="external_status_code" class="form-control" size="30" value="[% rt.external_status_code | html %]">
    </p>

    [% IF errors.auto_response %]
        <div class="form-error">[% errors.auto_response %]</div>
    [% END %]
    <div class="admin-hint">
      <p>
        [% loc('If ticked, this template will be used for Open311 updates that put problems in this state.') %]
      </p>
    </div>
    <p>
      <label>
        <strong>[% loc('Auto-response:') %]</strong>
        <input type="checkbox" name="auto_response" [% 'checked' IF rt.auto_response %] />
      </label>
    </p>

    <p>
      <input type="hidden" name="token" value="[% csrf_token %]" >
      <input type="submit" class="btn" name="Edit templates" value="[% rt.id ? loc('Save changes') : loc('Create template') %]" >
    </p>
    [% IF rt.id %]
        <p>
            <input class="delete btn-danger" type="submit" name="delete_template" value="[% loc('Delete template') %]" data-confirm="[% loc('Are you sure?') %]">
        </p>
    [% END %]
</form>

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