diff --git a/data/interfaces/default/css/tautulli.css b/data/interfaces/default/css/tautulli.css index 43ef642a..a49c071f 100644 --- a/data/interfaces/default/css/tautulli.css +++ b/data/interfaces/default/css/tautulli.css @@ -3678,16 +3678,26 @@ a:hover .overlay-refresh-image:hover { border: 1px solid #444; border-bottom-color: transparent; } +#newsletter-config-modal #custom_cron { + display: inline-block; + width: initial; + height: 32px; + margin-right: 5px; + margin-top: 4px; +} #newsletter-config-modal #cron-widget { display: inline-block; + margin-top: 1px; } #newsletter-config-modal #cron-widget select.cron-select { width: initial; display: inline; + height: 32px; + margin-top: 4px; } #newsletter-config-modal #cron-widget select.cron-select[name=cron-period] option[value=minute], #newsletter-config-modal #cron-widget select.cron-select[name=cron-period] option[value=hour] { - display: none; + display: none !important; } .git-group input.form-control { width: 50%; diff --git a/data/interfaces/default/newsletter_config.html b/data/interfaces/default/newsletter_config.html index a0a3a04f..18e2ecab 100644 --- a/data/interfaces/default/newsletter_config.html +++ b/data/interfaces/default/newsletter_config.html @@ -1,7 +1,8 @@ % if newsletter: <%! import json - from plexpy import helpers, notifiers + from plexpy import notifiers + from plexpy.helpers import anon_url, checked all_notifiers = sorted(notifiers.get_notifiers(), key=lambda k: (k['agent_label'].lower(), k['friendly_name'], k['id'])) email_notifiers = [n for n in all_notifiers if n['agent_name'] == 'email'] @@ -31,20 +32,26 @@
Set the schedule for the newsletter
++ Set the schedule for the newsletter. + Set the schedule for the newsletter using a custom crontab. Only standard cron values are valid. +
${item['description'] | n}
@@ -160,7 +167,7 @@Enable to send the newsletter as an HTML formatted Email. Disable to only send a subject and body message to a different notification agent.
@@ -249,7 +256,7 @@ % elif item['input_type'] == 'checkbox' and item['name'] != 'newsletter_email_html_support':${item['description'] | n}
@@ -398,30 +405,37 @@ $('#newsletter-config-modal').unbind('hidden.bs.modal'); var cron_widget = $('#cron-widget').cron({ + initial: '0 0 * * 0', classes: 'form-control cron-select', - customValues: { - 'custom crontab' : 'custom' - }, onChange: function() { - var cron_period = $(this).find('select[name=cron-period]').val(); - $('#custom_cron').val(cron_period === 'custom' ? 1 : 0); - if(cron_period === 'custom') { - $("#cron_value").show(); - } else { - $("#cron_value").hide().val($(this).cron('value')); - } + $("#cron_value").val($(this).cron('value')); } }); if (${newsletter['config']['custom_cron']}) { - $('#cron-widget').find('select[name=cron-period]').val('custom'); - $('#cron_value').val('${newsletter['cron']}').show(); + $('#cron_value').val('${newsletter['cron']}'); } else { - $('#cron_value').hide(); cron_widget.cron('value', '${newsletter['cron']}'); } - // apply cron with default options + function toggleCustomCron() { + if ($('#custom_cron').val() === '1'){ + $('#cron-widget').hide(); + $('#cron_value').show(); + $('#simple_cron_message').hide(); + $('#custom_cron_message').show(); + } else { + $('#cron-widget').show(); + $('#cron_value').hide(); + $('#simple_cron_message').show(); + $('#custom_cron_message').hide(); + } + } + toggleCustomCron(); + + $('#custom_cron').change(function () { + toggleCustomCron(); + }); var $incl_libraries = $('#newsletter_config_incl_libraries').selectize({ plugins: ['remove_button'],