success: function(res){
var _res = $(res);
- $('body').modal({
- class: 'tiny',
- title: '{{ _T("New dynamic field") }}',
- content: _res,
- onApprove: function() {
- $('form').submit();
- },
- actions: [{
- text : '{{ _T("Add") }}',
- icon : 'plus',
- class : 'icon labeled green approve'
- }, {
- text : '{{ _T("Close")|e('js') }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }]
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitle: _T("New dynamic field")|e("js"),
+ modalcontent: "_res",
+ modal_class: "tiny",
+ approve_text: _T("Add")|e('js'),
+ approve_icon: "plus",
+ approve_color: "green",
+ cancel_text: _T("Close")|e("js")
+ } %}
},
error: function() {
alert("{{ _T("An error occurred :(")|e("js") }}");
if ( mode == 'managers' ) {
_title = '{{ _T("Group managers selection")|e('js') }}';
}
- $('body').modal({
- title: _title,
- class: 'members-selection fullscreen scrolling',
- content: res,
- actions: [{
- text : '{{ _T("Close")|e("js") }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }]
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitlefromjs: "_title",
+ modalcontent: "res",
+ modal_class: "members-selection fullscreen",
+ modalcontent_class: "scrolling",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js")
+ } %}
_members_ajax_mapper(res, $('#group_id').val(), mode);
}
});
var _preview_dialog = function(res){
- $('body').modal({
- title: '{{ _T("Mailing preview")|e("js") }}',
- class: 'scrolling',
- content: res,
- actions: [{
- text : '{{ _T("Close")|e('js') }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }]
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitle: _T("Mailing preview")|e("js"),
+ modalcontent: "res",
+ modalcontent_class: "scrolling",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js")
+ } %}
}
{# Members popup #}
});
var _members_dialog = function(res){
- $('body').modal({
- title: '{{ _T("Members selection")|e("js") }}',
- class: 'members-selection fullscreen scrolling',
- content: res,
- actions: [{
- text : '{{ _T("Close")|e('js') }}',
- icon : 'times'
- class : 'icon labeled cancel'
- }]
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitle: _T("Members selection")|e("js"),
+ modalcontent: "res",
+ modal_class: "members-selection fullscreen",
+ modalcontent_class: "scrolling",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js")
+ } %}
_members_ajax_mapper(res);
}
});
var _preview_dialog = function(res){
- $('body').modal({
- title: '{{ _T("Mailing preview")|e("js") }}',
- class: 'scrolling',
- content: res,
- actions: [{
- text : '{{ _T("Close")|e("js") }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }]
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitle: _T("Mailing preview")|e("js"),
+ modalcontent: "res",
+ modal_class: "scrolling",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js")
+ } %}
}
</script>
{% endblock %}
if ( _managed ) {
_title = '{{ _T("Managed groups selection")|e('js') }}';
}
- $('body').modal({
- title: _title,
- class: 'groups-selection fullscreen scrolling',
- content: res,
- actions: [{
- text : '{{ _T("Close")|e('js') }}',
- icon :'times',
- class : 'icon labeled cancel'
- }]
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitlefromjs: "_title",
+ modalcontent: "res",
+ modal_class: "groups-selection fullscreen",
+ modalcontent_class: "scrolling",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js")
+ } %}
_groups_ajax_mapper(res, _groups, _managed);
}
{% include "elements/js/loader.js.twig" %},
success: function(res) {
var _content = $($.parseHTML(res)).find('div.main-content').children();
- $('body').modal({
- title: _this.html(),
- class: 'large',
- classContent: 'scrolling',
- content: _content,
- actions: [{
- text : '{{ _T("Close")|e('js') }}',
- icon : 'times',
- class : 'icon labeled cancel'
- }]
- }).modal('show');
+ {% include "elements/js/modal.js.twig" with {
+ modaltitlefromjs: "_this.html()",
+ modalcontent: "_content",
+ modal_class: "large",
+ modalcontent_class: "scrolling",
+ singlecancelaction: true,
+ cancel_text: _T("Close")|e("js")
+ } %}
},
error: function() {
alert("{{ _T("An error occurred :(")|e('js') }}");