diff options
author | plegall <plg@piwigo.org> | 2016-01-11 09:28:37 +0100 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2016-01-11 09:28:37 +0100 |
commit | 39fc4a604e723ee3f6d2a16e025d7bad62c168b1 (patch) | |
tree | 24b686812246a583e52ccfe1d785f0d120cdc821 /admin/themes | |
parent | 2bfd316e348919af0e5d22467abf9b79b040e476 (diff) | |
parent | 7bd36e02406985b4a5b9b2e4caef13234569268d (diff) |
Merge branch 'feature/259-album-notify-users'
Diffstat (limited to 'admin/themes')
-rw-r--r-- | admin/themes/default/template/album_notification.tpl | 103 |
1 files changed, 87 insertions, 16 deletions
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} + <div class="titrePage"> <h2><span style="letter-spacing:0">{$CATEGORIES_NAV}</span> › {'Edit album'|@translate} {$TABSHEET_TITLE}</h2> </div> @@ -5,36 +61,51 @@ <form action="{$F_ACTION}" method="post" id="categoryNotify"> <fieldset id="emailCatInfo"> - <legend>{'Send an information email to group members'|@translate}</legend> - -{if isset($group_mail_options)} + <legend>{'Send mail to users'|@translate}</legend> <p> - <strong>{'Group'|@translate}</strong> - <br> - <select name="group"> - {html_options options=$group_mail_options} + <strong>{'Recipients'|@translate}</strong> + <select name="who"> + <option value="group">{'Group'|translate}</option> + <option value="users">{'Users'|translate}</option> </select> </p> + <p class="who_option who_group"> +{if isset($group_mail_options)} + <select name="group" placeholder="{'Type in a search term'|translate}" style="width:524px;"> + {html_options options=$group_mail_options} + </select> +{elseif isset($no_group_in_gallery) and $no_group_in_gallery} + {'There is no group in this gallery.'|@translate} <a href="admin.php?page=group_list" class="externalLink">{'Group management'|@translate}</a> +{else} + {'No group is permitted to see this private album'|@translate}. + <a href="{$permission_url}" class="externalLink">{'Permission management'|@translate}</a> +{/if} + </p> + + <p class="who_option who_users"> +{if isset($user_options)} + <select name="users[]" multiple placeholder="{'Type in a search term'|translate}" style="width:524px;"> + {html_options options=$user_options selected=$user_options_selected} + </select> +{else} + {'No user is permitted to see this private album'|@translate}. + <a href="{$permission_url}" class="externalLink">{'Permission management'|@translate}</a> +{/if} + </p> + <p> <strong>{'Complementary mail content'|@translate}</strong> <br> <textarea cols="50" rows="5" name="mail_content" id="mail_content" class="description">{$MAIL_CONTENT}</textarea> </p> - <p> + <p class="actionButtons"> <input class="submit" type="submit" value="{'Send'|@translate}" name="submitEmail"> + <span class="errors" style="display:none">✘ {'No recipient selected'|translate}</span> </p> -{elseif isset($no_group_in_gallery) and $no_group_in_gallery} - <p>{'There is no group in this gallery.'|@translate} <a href="admin.php?page=group_list" class="externalLink">{'Group management'|@translate}</a></p> -{else} - <p> - {'No group is permitted to see this private album'|@translate}. - <a href="{$permission_url}" class="externalLink">{'Permission management'|@translate}</a> - </p> -{/if} </fieldset> </form> |