-
Notifications
You must be signed in to change notification settings - Fork 16
/
admin_campaign_edit.jinja2
138 lines (134 loc) · 7.27 KB
/
admin_campaign_edit.jinja2
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
{% extends "sitebase.jinja2" %}
{% set page_title = _("Admin Campaign Edit") %}
{% set show_breadcrumbs = False %}
{% block head %}
{% endblock %}
{% block content %}
<center>
<form method="post" enctype="multipart/form-data" action="/admin/campaigns/edit">
<table>
{% if campaign_id is not none %}
<input type="hidden" name="campaign_id" value="{{ campaign_id |e }}" />
<tr>
<td colspan="2" align="center"><strong>{{ _('Edit Campaign') }}</strong></td>
</tr>
<tr>
<td><label for="campaign_id">{{ _('Campaign ID') }}:</label></td>
<td><label>{{ campaign_id |e }}</label></td>
</tr>
<tr>
<td><label for="signup_link">{{ _('Campaign Link') }}:</label></td>
<td><label>{{ endpoint }}/signup_form?campaign_id={{ campaign_id |e }}&source=</label></td>
</tr>
<tr>
<td><label for="associated_projects">{{ _('Associated Projects') }}:</label></td>
<td><label>{{ campaign_info.associated_projects |e }}</td>
</tr>
{% else %}
<tr>
<td colspan="2" align="center"><strong>{{ _('Add Campaign') }}</strong></td>
</tr>
<tr>
<td><label for="associated_projects">{{ _('Associated Projects') }}:</label></td>
<td>
<select name="associated_projects" multiple size="10">
{% for project in projects %}
<option value="{{ project['project_id'] }}">{{ project['project_name'] }}</option>
{% endfor %}
</select>
</td>
</tr>
{% endif %}
<tr>
<td><label for="language_key">{{ _('Campaign Language') }}:</label></td>
<td>
<select name="language_key">
{% for lang in languages %}
<option value="{{ languages[lang]['value'] }}" {% if campaign_info.language_key == languages[lang]['value'] %}selected{% endif %}>{{ languages[lang]['display_text'] }}</option>
{% endfor %}
</select>
</td>
</tr>
<tr>
<td><label for="title">{{ _('Title') }}:</label></td>
<td><input type="text" name="title" value="{{ campaign_info.title |e if campaign_info.title is not none}}"></td>
</tr>
<tr>
<td><label for="instructions">{{ _('Instructions') }}:</label></td>
<td><textarea name="instructions" rows="5" cols="40">{{ campaign_info.instructions |e if campaign_info.instructions is not none }}</textarea></td>
</tr>
<tr>
<td><label for="language_key_alt">{{ _('Alt Campaign Language') }}:</label></td>
<td>
<select name="language_key_alt">
<option value="">-- NONE --</option>
{% for lang in languages %}
<option value="{{ languages[lang]['value'] }}" {% if campaign_info.language_key_alt == languages[lang]['value'] %}selected{% endif %}>{{ languages[lang]['display_text'] }}</option>
{% endfor %}
</select>
</td>
</tr>
<tr>
<td><label for="title_alt">{{ _('Title in Alt Language') }}:</label></td>
<td><input type="text" name="title_alt" value="{{ campaign_info.title_alt |e if campaign_info.title_alt is not none}}"></td>
</tr>
<tr>
<td><label for="instructions_alt">{{ _('Instructions in Alt Language') }}:</label></td>
<td><textarea name="instructions_alt" rows="5" cols="40">{{ campaign_info.instructions_alt |e if campaign_info.instructions_alt is not none}}</textarea></td>
</tr>
{% if header_image is not none %}
<tr>
<td><label for="current_header">{{ _('Current Header Image') }}:</label></td>
<td><img src="/static/img/campaigns/{{ campaign_info.header_image |e }}" style="max-height: 100px"></td>
</tr>
{% endif %}
<tr>
<td><label for="header_image">{{ _('Upload New Header Image') }}:</label></td>
<td><input type="file" name="header_image" accept=".png, .jpg, .jpeg"></td>
</tr>
<tr>
<td><label for="permitted_countries">{{ _('Permitted Countries') }}:</label></td>
<td>
<select name="permitted_countries" id="permitted_countries" multiple size="5">
<option value="US" {% if "US" in permitted_countries %}SELECTED{% endif %}>{{ _('United States') }}</option>
<option value="GB" {% if "GB" in permitted_countries %}SELECTED{% endif %}>{{ _('United Kingdom') }}</option>
<option value="MX" {% if "MX" in permitted_countries %}SELECTED{% endif %}>{{ _('Mexico') }}</option>
<option value="ES" {% if "ES" in permitted_countries %}SELECTED{% endif %}>{{ _('Spain') }}</option>
<option value="JP" {% if "JP" in permitted_countries %}SELECTED{% endif %}>{{ _('Japan') }}</option>
</select>
</td>
</tr>
<tr>
<td><label for="accepting_participants">{{ _('Accepting Participants') }}:</label></td>
<td>
<select name="accepting_participants">
<option value="True" {% if campaign_info.accepting_participants is true %}selected{% endif %}>Yes</option>
<option value="False"{% if campaign_info.accepting_participants is false %}selected{% endif %}>No</option>
</select>
</td>
</tr>
<tr>
<td><label for="send_thdmi_confirmation">{{ _('Send THDMI Confirmation Email') }}:</label></td>
<td>
<select name="send_thdmi_confirmation" id="send_thdmi_confirmation">
<option value="False"{% if campaign_info.send_thdmi_confirmation is false %}selected{% endif %}>No</option>
<option value="True" {% if campaign_info.send_thdmi_confirmation is true %}selected{% endif %}>Yes</option>
</select>
</td>
</tr>
<tr>
<td><label for="force_primary_language">{{ _('Force Primary Language on Form') }}:</label></td>
<td>
<select name="force_primary_language" id="force_primary_language">
<option value="False"{% if campaign_info.force_primary_language is false %}selected{% endif %}>No</option>
<option value="True" {% if campaign_info.force_primary_language is true %}selected{% endif %}>Yes</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="{{ _('Submit') }}"></td>
</tr>
</table>
</form>
</center>
{% endblock %}