-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessages.html
More file actions
206 lines (159 loc) · 9.12 KB
/
Copy pathmessages.html
File metadata and controls
206 lines (159 loc) · 9.12 KB
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
{extends file="admin-layout.tpl"}
{block name="no-return-functions"}
{$admin_current_location = 'configuration'}
{/block}
{block name="page-title"}{intl l='Thelia Mailing Templates'}{/block}
{block name="check-resource"}admin.configuration.message{/block}
{block name="check-access"}view{/block}
{block name="main-content"}
<div class="messages">
<div id="wrapper" class="container">
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
<li><a href="{url path='/admin/configuration/messages'}">{intl l="Mailing templates"}</a></li>
</ul>
{hook name="messages.top" location="messages_top" }
<div class="row">
<div class="col-md-12">
<form action="{url path='/admin/configuration/messages/update-values'}" method="post">
<div class="general-block-decorator">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption>
{intl l='Thelia mailing templates'}
{loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.message" access="CREATE"}
<a class="btn btn-primary action-btn" title="{intl l='Add a new mailing template'}" href="#creation_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-plus-sign"></span>
</a>
{/loop}
</caption>
<thead>
<tr>
<th>{intl l="Purpose"}</th>
<th>{intl l="Name"}</th>
{hook name="messages.table-header" location="messages_table_header" }
<th> </th>
</tr>
</thead>
<tbody>
{loop name="mailing-templates" type="message" secured="*" backend_context="1" lang="$lang_id"}
<tr>
<td>{$TITLE}</td>
<td>
{if ! $SECURED}
{loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.message" access="UPDATE"}
<a title="{intl l='Change this mailing template'}" href="{url path='/admin/configuration/messages/update' message_id="$ID"}">{$NAME}</a>
{/loop}
{elseloop rel="can_change"}
{$NAME}
{/elseloop}
{else}
{$NAME}
{/if}
</td>
{hook name="messages.table-row" location="messages_table_row" message_id={$ID} }
<td class="actions">
{if ! $SECURED}
<div class="btn-toolbar btn toolbar-primary">
<span class="glyphicon glyphicon-cog"></span>
</div>
<div class="toolbar-options hidden">
{loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.message" access="UPDATE"}
<a class="message-change" title="{intl l='Change this mailing template'}" href="{url path='/admin/configuration/messages/update' message_id="$ID"}"><span class="glyphicon glyphicon-edit"></span></a>
{/loop}
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.message" access="DELETE"}
<a class="message-delete" title="{intl l='Delete this mailing template'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
{/loop}
</div>
{else}
<span title="{intl l='This mailing template could not be changed.'}" class="glyphicon glyphicon-ban-circle"></span>
{/if}
</td>
</tr>
{/loop}
{elseloop rel="mailing-templates"}
<tr>
<td colspan="3">
<div class="alert alert-info">
{intl l="No mailing template has been created yet. Click the + button to create one."}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</div>
</form>
</div>
</div>
{hook name="messages.bottom" location="messages_bottom" }
</div>
</div>
{* Adding a new message *}
{form name="thelia.admin.message.creation"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "creation_dialog"}
{form_hidden_fields exclude="secured,success_url"}
{render_form_field field="success_url" value={url path='/admin/configuration/messages/update' message_id='_ID_'}}
{* We do not allow users to create secured messages from here *}
{render_form_field field='secured' value='0'}
{render_form_field field='name'}
{custom_render_form_field field="title"}
{loop type="lang" name="default-lang" default_only="1"}
{* Switch edition to the current locale *}
<input type="hidden" name="edit_language_id" value="{$ID}" />
{render_form_field field="locale" value=$LOCALE}
<div class="input-group">
<input type="text" {form_field_attributes field="title"}>
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.png"}" alt="{$TITLE}" /></span>
</div>
{/loop}
{/custom_render_form_field}
{hook name="message.create-form" location="message_create_form" }
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "creation_dialog"
dialog_title = {intl l="Create a new mailing template"}
dialog_body = {$smarty.capture.creation_dialog nofilter}
dialog_ok_label = {intl l="Create this mailing template"}
form_action = {url path='/admin/configuration/messages/create'}
form_enctype = {form_enctype}
form_error_message = $form_error_message
}
{/form}
{* Delete confirmation dialog *}
{capture "delete_dialog"}
<input type="hidden" name="message_id" id="message_delete_id" value="" />
{hook name="message.delete-form" location="message_delete_form" }
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_dialog"
dialog_title = {intl l="Delete mailing template"}
dialog_message = {intl l="Do you really want to delete this mailing template ?"}
form_action = {token_url path='/admin/configuration/messages/delete'}
form_content = {$smarty.capture.delete_dialog nofilter}
}
{/block}
{block name="javascript-initialization"}
<script>
$(function() {
// Set proper message ID in delete from
$('a.message-delete').click(function(ev) {
$('#message_delete_id').val($(this).data('id'));
});
// JS stuff for creation form
{include
file = "includes/generic-js-dialog.html"
dialog_id = "creation_dialog"
form_name = "thelia.admin.message.creation"
}
});
</script>
{/block}
{block name="javascript-last-call"}
{hook name="messages.js" location="messages-js" }
{/block}