1 {% extends 'elements/list.html.twig' %}
3 {% set nb = history.getCount() %}
13 'label': _Tn("%count entry", "%count entries", history.getCount())|replace({"%count": history.getCount()}),
15 'name': 'mailings_filter'
21 {% block infoline_actions %}
23 class="action ui tiny labeled icon button"
24 href="{{ url_for('mailing') }}?mailing_new=true"
26 <i class="plus circle green icon" aria-hidden="true"></i>
27 {{ _T('Create new mailing') }}
29 {% if login.isLogged() and (cur_route != 'mailing' and existing_mailing == true) %}
31 href="{{ url_for("mailing") }}"
32 class="action ui tiny labeled icon button tooltip"
33 title="{{ _T("A mailing exists in the current session. Click here if you want to resume or cancel it.") }}"
35 <i class="paper plane outline blue icon" aria-hidden="true"></i>
36 {{ _T("Existing mailing") }}
44 {'label': _T("Date"), 'order': constant("Galette\\Filters\\MailingsList::ORDERBY_DATE")},
45 {'label': _T('Sender'), 'order': constant("Galette\\Filters\\MailingsList::ORDERBY_SENDER")},
46 {'label': _T('Recipients')},
47 {'label': _T('Subject'), 'order': constant("Galette\\Filters\\MailingsList::ORDERBY_SUBJECT")},
48 {'label': _T('Att.')},
49 {'label': _T("Sent"), 'order': constant("Galette\\Filters\\MailingsList::ORDERBY_SENT")}
55 <form action="{{ url_for('mailings_filter') }}" method="post" class="ui form filters">
56 <div class="ui secondary yellow segment">
57 <div class="three fields">
58 <div class="two fields">
60 <label for="start_date_filter">{{ _T('since') }}</label>
61 <div class="ui calendar" id="mailings-rangestart">
62 <div class="ui input left icon">
63 <i class="calendar icon" aria-hidden="true"></i>
64 <input placeholder="{{ _T('(yyyy-mm-dd format)') }}" type="text" name="start_date_filter" id="start_date_filter" maxlength="10" size="10" value="{{ history.filters.start_date_filter }}"/>
69 <label for="end_date_filter">{{ _T('until') }}</label>
70 <div class="ui calendar" id="mailings-rangeend">
71 <div class="ui input left icon">
72 <i class="calendar icon" aria-hidden="true"></i>
73 <input placeholder="{{ _T('(yyyy-mm-dd format)') }}" type="text" name="end_date_filter" id="end_date_filter" maxlength="10" size="10" value="{{ history.filters.end_date_filter }}"/>
79 <label for="subject_filter">{{ _T('Subject') }}</label>
80 <input type="text" name="subject_filter" id="subject_filter" value="{{ history.filters.subject_filter }}"/>
83 <label for="sent_filter">{{ _T('Sent mailings:') }}</label>
84 <div class="inline fields">
86 <div class="ui radio checkbox">
87 <input type="radio" name="sent_filter" id="filter_dc_sent" value="{{ constant("Galette\\Core\\MailingHistory::FILTER_DC_SENT") }}"{% if history.filters.sent_filter == constant("Galette\\Core\\MailingHistory::FILTER_DC_SENT") %} checked="checked"{% endif %}>
88 <label for="filter_dc_sent" >{{ _T("Don't care") }}</label>
92 <div class="ui radio checkbox">
93 <input type="radio" name="sent_filter" id="filter_sent" value="{{ constant("Galette\\Core\\MailingHistory::FILTER_SENT") }}"{% if history.filters.sent_filter == constant("Galette\\Core\\MailingHistory::FILTER_SENT") %} checked="checked"{% endif %}>
94 <label for="filter_sent" >{{ _T('Yes') }}</label>
98 <div class="ui radio checkbox">
99 <input type="radio" name="sent_filter" id="filter_not_sent" value="{{ constant("Galette\\Core\\MailingHistory::FILTER_NOT_SENT") }}"{% if history.filters.sent_filter == constant("Galette\\Core\\MailingHistory::FILTER_NOT_SENT") %} checked="checked"{% endif %}>
100 <label for="filter_not_sent" >{{ _T('No') }}</label>
106 <div class="ui right aligned basic fitted segment field">
107 <button type="submit" class="tooltip action ui labeled icon primary button" title="{{ _T('Apply filters') }}" name="filter">
108 <i class="search icon" aria-hidden="true"></i>
111 <button type="submit" name="clear_filter" class="tooltip ui labeled icon button" title="{{ _T('Reset all filters to defaults') }}">
112 <i class="trash alt red icon" aria-hidden="true"></i>
113 {{ _T('Clear filter') }}
117 {% include "components/forms/csrf.html.twig" %}
122 {% for log in logs %}
123 {% set date_format = _T('Y-m-d H:i:s') %}
125 <td data-scope="row">
126 {% if preferences.pref_show_id %}
131 <span class="visually-hidden">
132 {{ _T('Mailing entry %id')|replace({'%id': log.mailing_id}) }}
135 <td class="" data-title="{{ _T('Date') }}">{{ log.mailing_date|date(date_format) }}</td>
136 <td data-title="{{ _T('Sender') }}">{% if log.mailing_sender == 0 %}{{ _T('Superadmin') }}{% else %}{{ log.mailing_sender_name }}{% endif %}</td>
137 <td data-title="{{ _T('Recipients') }}">{{ log.mailing_recipients|length }}</td>
138 <td data-title="{{ _T('Subject') }}">{{ log.mailing_subject }}</td>
139 <td class="center" data-title="{{ _T('Attachments') }}">{{ log.attachments }}</td>
140 <td class="center{% if log.mailing_sent == 1 %} use{% endif %}" data-title="{{ _T('Sent') }}">
141 {% if log.mailing_sent == 1 %}
142 <i class="ui thumbs up green icon" aria-hidden="true"></i>
144 <i class="ui thumbs down red icon" aria-hidden="true"></i>
147 <td class="center actions_row">
149 href="{{ url_for("mailingPreview", {"id": log.mailing_id}) }}"
152 <i class="ui eye green icon tooltip" aria-hidden="true"></i>
153 <span class="ui special popup">{{ _T("Display mailing '%subject' details in preview window")|replace({'%subject': log.mailing_subject}) }}</span>
156 href="{{ url_for('mailing') }}?from={{ log.mailing_id }}"
158 <i class="ui clone blue icon tooltip" aria-hidden="true"></i>
159 <span class="ui special popup">{{ _T("Use mailing '%subject' as a template for a new one")|replace({'%subject': log.mailing_subject}) }}</span>
162 href="{{ url_for("removeMailing", {"id": log.mailing_id}) }}"
165 <i class="ui trash red icon tooltip" aria-hidden="true"></i>
166 <span class="ui special popup">{{ _T("Delete mailing '%subject'")|replace({'%subject': log.mailing_subject}) }}</span>
171 <tr><td colspan="8" class="emptylist">{{ _T('No sent mailing has been stored in the database yet.') }}</td></tr>
175 {% block javascripts %}
176 <script type="text/javascript">
177 {% include "elements/js/removal.js.twig" with {
178 single_action: "true"
182 $('.showdetails').click(function(){
184 url: $(this).attr('href'),
189 {% include "elements/js/loader.js.twig" with {
191 selector: ".loader_selector"
193 success: function(res){
194 _preview_dialog(res);
197 {% include "elements/js/modal.js.twig" with {
198 modal_title_twig: _T("An error occurred displaying preview :(")|e("js"),
199 modal_without_content: true,
201 modal_deny_only: true,
202 modal_cancel_text: _T("Close")|e("js"),
203 modal_classname: "redalert",
210 var _preview_dialog = function(res){
211 {% include "elements/js/modal.js.twig" with {
212 modal_title_twig: _T("Mailing preview")|e("js"),
213 modal_content: "res",
214 modal_class: "scrolling",
215 modal_deny_only: true,
216 modal_cancel_text: _T("Close")|e("js")