var _checkselection = function() {
var _checked = $('#listform').find('input[type=checkbox]:checked').length;
if ( _checked == 0 ) {
- $('body').modal({
- title: '{{ batch.modal.title|e("js") }}',
- class: 'tiny',
- content: '{{ batch.modal.content|e("js") }}',
- actions: [{
- text : '{{ _T("Close")|e("js") }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }],
- className: {
- modal: 'ui redalert modal',
- title: 'center aligned header',
- content: 'center aligned content',
- actions: 'center aligned actions'
- }
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitle: batch.modal.title|e("js"),
+ modalcontent: batch.modal.content|e("js"),
+ contentfromtwig: true,
+ modal_class: "tiny",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js"),
+ modalclassname: "modal: 'ui redalert modal',title: 'center aligned header',content: 'center aligned content',actions: 'center aligned actions'",
+ } %}
return false;
} else {
return true;
_w.find('ul').append('<li>' + _val + '</li>');
});
- $('body').modal({
- class: 'tiny',
- title: _w.find('.header'),
- content: _w.find('.content'),
- actions: [{
- text : '{{ _T("Close")|e('js') }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }]
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitlefromjs: "_w.find('.header')",
+ modalcontent: "_w.find('.content')",
+ contentfromtwig: true,
+ modal_class: "tiny",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js"),
+ modalclassname: "modal: 'ui redalert modal',title: 'center aligned header',content: 'center aligned content',actions: 'center aligned actions'",
+ } %}
return false;
} else {
return true;
if ( $('input[name=import_file]:checked').length > 0 ) {
return true;
} else {
- $('body').modal({
- title: '{{ _T("No file selected")|e("js") }}',
- class: 'tiny',
- content: '{{ _T("Please make sure to select one file to import.")|e("js") }}',
- actions: [{
- text : '{{ _T("Close")|e("js") }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }]
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitle: _T("No file selected")|e("js"),
+ modalcontent: _T("Please make sure to select one file to import.")|e("js"),
+ contentfromtwig: true,
+ modal_class: "tiny",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js"),
+ modalclassname: "modal: 'ui redalert modal',title: 'center aligned header',content: 'center aligned content',actions: 'center aligned actions'",
+ } %}
return false;
}
});
$('#upload').click(function(){
var _selected = $('#new_file')[0].files.length;
if ( _selected == 0 ) {
- $('body').modal({
- title: '{{ _T("No file to upload")|e("js") }}',
- class: 'tiny',
- content: '{{ _T("Please make sure to select one file to upload.")|e("js") }}',
- actions: [{
- text : '{{ _T("Close")|e("js") }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }]
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitle: _T("No file selected")|e("js"),
+ modalcontent: _T("Please make sure to select one file to upload.")|e("js"),
+ contentfromtwig: true,
+ modal_class: "tiny",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js"),
+ modalclassname: "modal: 'ui redalert modal',title: 'center aligned header',content: 'center aligned content',actions: 'center aligned actions'",
+ } %}
return false;
} else {
return true;
$('#store-model').click(function() {
var _checked = $('#modelform').find('input[type=checkbox]:checked').length;
if ( _checked == 0 ) {
- $('body').modal({
- title: '{{ _T("No field selected")|e("js") }}',
- class: 'tiny',
- content: '{{ _T("Please make sure to select at least one field from the list to perform this action.")|e("js") }}',
- actions: [{
- text : '{{ _T("Close")|e("js") }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }]
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitle: _T("No file selected")|e("js"),
+ modalcontent: _T("Please make sure to select at least one field from the list to perform this action.")|e("js"),
+ contentfromtwig: true,
+ modal_class: "tiny",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js"),
+ modalclassname: "modal: 'ui redalert modal',title: 'center aligned header',content: 'center aligned content',actions: 'center aligned actions'",
+ } %}
return false;
} else {
return true;
$('.rm_attachement').click(function(event){
event.preventDefault();
var _link = $(this);
- $('body').modal({
- title: '{{ _T("Remove attachment") }}',
- class: 'tiny',
- content: '{{ _T("Are you sure you want to remove this attachment?") }}<br/>{{ _T("This will immediately remove attachment from disk and cannot be undo.") }}',
- onApprove: function() {
- window.location.href = '{{ url_for('mailing') }}' + _link.attr('href');
- },
- actions: [{
- text : '{{ _T("Remove")|e('js') }}',
- icon : 'trash',
- class : 'icon labeled red approve',
- }, {
- text : '{{ _T("Cancel")|e('js') }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }],
- className: {
- 'modal': 'ui redalert modal',
- 'title': 'center aligned header',
- 'content': 'center aligned content',
- 'actions': 'center aligned actions'
- }
- }).modal('show');
+ {% set modalcontent = _T("Are you sure you want to remove this attachment?") ~ '<br/>' ~ _T("This will immediately remove attachment from disk and cannot be undone.") %}
+ {% include "elements/js/modal.js.twig" with {
+ modaltitle: _T("Remove attachment")|e("js"),
+ modalcontent: modalcontent,
+ contentfromtwig: true,
+ modal_class: "tiny",
+ singlecancelaction: true,
+ modalapprove: "window.location.href = '{{ url_for('mailing') }}' + _link.attr('href');",
+ approve_text: _T("Remove")|e('js'),
+ approve_icon: "trash",
+ approve_color: "red",
+ cancel_text: _T("Cancel")|e("js"),
+ modalclassname: "modal: 'ui redalert modal',title: 'center aligned header',content: 'center aligned content',actions: 'center aligned actions'",
+ } %}
});
$('#sender').on('change', function() {
{% include "elements/js/photo_dnd.js.twig" %}
$('.notmanaged').click(function(){
- $('body').modal({
- title: '{{ _T("Not managed group")|e('js') }}',
- class: 'tiny',
- content: '{{ _T("You are not part of managers for the requested group.")|e("js") }}',
- actions: [{
- text : '{{ _T("Close")|e('js') }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }],
- className: {
- 'modal': 'ui redalert modal',
- 'title': 'center aligned header',
- 'content': 'center aligned content',
- 'actions': 'center aligned actions'
- }
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitle: _T("Not managed group")|e("js"),
+ modalcontent: _T("You are not part of managers for the requested group.")|e("js"),
+ contentfromtwig: true,
+ modal_class: "tiny",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js"),
+ modalclassname: "modal: 'ui redalert modal',title: 'center aligned header',content: 'center aligned content',actions: 'center aligned actions'",
+ } %}
return false;
});
});
var _this = $(this);
var _checked = _this.find('input[type=checkbox]:checked').length;
if ( _checked == 0 ) {
- $('body').modal({
- title: '{{ _T("No reminder selected")|e("js") }}',
- class: 'tiny',
- content: '{{ _T("Please make sure to select at least one reminder.")|e("js") }}',
- actions: [{
- text : '{{ _T("Close")|e("js") }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }],
- className: {
- 'modal': 'ui redalert modal',
- 'title': 'center aligned header',
- 'content': 'center aligned content',
- 'actions': 'center aligned actions'
- }
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitle: _T("No reminder selected")|e("js"),
+ modalcontent: _T("Please make sure to select at least one reminder.")|e("js"),
+ contentfromtwig: true,
+ modal_class: "tiny",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js"),
+ modalclassname: "modal: 'ui redalert modal',title: 'center aligned header',content: 'center aligned content',actions: 'center aligned actions'",
+ } %}
return false;
} else {
return true;