From 7bd36e02406985b4a5b9b2e4caef13234569268d Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 6 Jan 2016 13:42:30 +0100 Subject: feature #259, notify an album to a list of users ... and not just to a group --- .../themes/default/template/album_notification.tpl | 103 +++++++++++++++++---- 1 file changed, 87 insertions(+), 16 deletions(-) (limited to 'admin/themes') diff --git a/admin/themes/default/template/album_notification.tpl b/admin/themes/default/template/album_notification.tpl index 32aa8e414..8573cf16e 100644 --- a/admin/themes/default/template/album_notification.tpl +++ b/admin/themes/default/template/album_notification.tpl @@ -1,3 +1,59 @@ +{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'} +{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"} + +{footer_script} +jQuery(document).ready(function() { + jQuery("select[name=who]").change(function () { + checkWhoOptions(); + }); + + checkWhoOptions(); + + function checkWhoOptions() { + var option = jQuery("select[name=who] option:selected").val(); + jQuery(".who_option").hide(); + jQuery(".who_" + option).show(); + } + + jQuery(".who_option select").selectize({ + plugins: ['remove_button'] + }); + + jQuery("form#categoryNotify").submit(function(e) { + var who_selected = false; + var who_option = jQuery("select[name=who] option:selected").val(); + + if (jQuery(".who_" + who_option + " select").length > 0) { + if (jQuery(".who_" + who_option + " select option:selected").length > 0) { + who_selected = true; + } + } + + if (!who_selected) { + jQuery(".actionButtons .errors").show(); + e.preventDefault(); + } + else { + jQuery(".actionButtons .errors").hide(); + console.log("form can be submited"); + } + }); +}); +{/footer_script} + +{html_style} +.who_option { + margin-top:5px; +} + +span.errors { + background-image:none; + padding:2px 5px; + margin:0; + border-radius:5px; +} +{/html_style} +

{$CATEGORIES_NAV} › {'Edit album'|@translate} {$TABSHEET_TITLE}

@@ -5,36 +61,51 @@
- {'Send an information email to group members'|@translate} - -{if isset($group_mail_options)} + {'Send mail to users'|@translate}

- {'Group'|@translate} -
- + +

+

+{if isset($group_mail_options)} + +{elseif isset($no_group_in_gallery) and $no_group_in_gallery} + {'There is no group in this gallery.'|@translate} {'Group management'|@translate} +{else} + {'No group is permitted to see this private album'|@translate}. + {'Permission management'|@translate} +{/if} +

+ +

+{if isset($user_options)} + +{else} + {'No user is permitted to see this private album'|@translate}. + {'Permission management'|@translate} +{/if} +

+

{'Complementary mail content'|@translate}

-

+

+

-{elseif isset($no_group_in_gallery) and $no_group_in_gallery} -

{'There is no group in this gallery.'|@translate} {'Group management'|@translate}

-{else} -

- {'No group is permitted to see this private album'|@translate}. - {'Permission management'|@translate} -

-{/if}
-- cgit v1.2.3