diff --git a/data/interfaces/default/css/tautulli.css b/data/interfaces/default/css/tautulli.css index 78fa8014..fbfc9bff 100644 --- a/data/interfaces/default/css/tautulli.css +++ b/data/interfaces/default/css/tautulli.css @@ -2973,6 +2973,9 @@ a .home-platforms-list-cover-face:hover .stacked-configs > li.new-notification-agent, .stacked-configs > li.notification-agent, .stacked-configs > li.add-notification-agent, +.stacked-configs > li.new-newsletter-agent, +.stacked-configs > li.newsletter-agent, +.stacked-configs > li.add-newsletter-agent, .stacked-configs > li.mobile-device, .stacked-configs > li.add-mobile-device { cursor: pointer; @@ -3657,38 +3660,58 @@ a:hover .overlay-refresh-image:hover { } #plexpy-notifiers-table .friendly_name, #notifier-config-modal span.notifier_id, +#plexpy-newsletters-table .friendly_name, +#newsletter-config-modal span.newsletter_id, #plexpy-mobile-devices-table .friendly_name, #mobile-device-config-modal span.notifier_id { color: #777; } -#notifier-config-modal .nav-tabs { +#notifier-config-modal .nav-tabs, +#newsletter-config-modal .nav-tabs { margin-bottom: 10px; padding-left: 15px; border-bottom: 1px solid #444; } -#notifier-config-modal .nav-tabs > li { +#notifier-config-modal .nav-tabs > li, +#newsletter-config-modal .nav-tabs > li { margin: 0 0 -1px 0; } -#notifier-config-modal .nav-tabs > li > a { +#notifier-config-modal .nav-tabs > li > a, +#newsletter-config-modal .nav-tabs > li > a { padding: 5px 10px; color: #737373; } -#notifier-config-modal .nav-tabs > li > a:hover { +#notifier-config-modal .nav-tabs > li > a:hover, +#newsletter-config-modal .nav-tabs > li > a:hover { border-color: #444; background: #222; } #notifier-config-modal .nav-tabs > li.active > a, #notifier-config-modal .nav-tabs > li.active > a:hover, -#notifier-config-modal .nav-tabs > li.active > a:focus { +#notifier-config-modal .nav-tabs > li.active > a:focus, +#newsletter-config-modal .nav-tabs > li.active > a, +#newsletter-config-modal .nav-tabs > li.active > a:hover, +#newsletter-config-modal .nav-tabs > li.active > a:focus { color: #fff; background: #222; } #notifier-config-modal .nav-tabs > li.active > a, #notifier-config-modal .nav-tabs > li.active > a:hover, -#notifier-config-modal .nav-tabs > li.active > a:focus { +#notifier-config-modal .nav-tabs > li.active > a:focus, +#newsletter-config-modal .nav-tabs > li.active > a, +#newsletter-config-modal .nav-tabs > li.active > a:hover, +#newsletter-config-modal .nav-tabs > li.active > a:focus { border: 1px solid #444; border-bottom-color: transparent; } +#newsletter-config-modal #cron-widget select.cron-select { + width: initial; + display: inline; +} +#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; +} .git-group input.form-control { width: 50%; } diff --git a/data/interfaces/default/images/logo-tautulli-newsletter.png b/data/interfaces/default/images/logo-tautulli-newsletter.png new file mode 100644 index 00000000..e1ec4923 Binary files /dev/null and b/data/interfaces/default/images/logo-tautulli-newsletter.png differ diff --git a/data/interfaces/default/js/jquery-cron-min.js b/data/interfaces/default/js/jquery-cron-min.js new file mode 100644 index 00000000..87aa765a --- /dev/null +++ b/data/interfaces/default/js/jquery-cron-min.js @@ -0,0 +1 @@ +!function(e){function t(e){return"undefined"==typeof e?!1:!0}function n(e){return!t(e)||"object"==typeof e}function s(n,s){if(t(s.customValues))for(key in s.customValues)if(n==s.customValues[key])return key;var a=/^((\d{1,2}|\*)\s){4}(\d{1,2}|\*)$/;if("string"!=typeof n||!a.test(n))return void e.error("cron: invalid initial value");for(var i=n.split(" "),r=[0,0,1,1,0],l=[59,23,31,12,6],c=0;c=r[c]))return void e.error("cron: invalid value found (col "+(c+1)+") in "+o.initial)}for(var u in k)if(k[u].test(n))return u;return void e.error("cron: valid but unsupported cron format. sorry.")}function a(o,a){if(!t(s(a.initial,a)))return!0;if(!n(a.customValues))return!0;if(t(a.customValues))for(key in a.customValues)if(k.hasOwnProperty(key))return e.error("cron: reserved keyword '"+key+"' should not be used as customValues key."),!0;return!1}function i(e){var t=e.data("block"),o=hour=day=month=dow="*",n=t.period.find("select").val();switch(n){case"minute":break;case"hour":o=t.mins.find("select").val();break;case"day":o=t.time.find("select.cron-time-min").val(),hour=t.time.find("select.cron-time-hour").val();break;case"week":o=t.time.find("select.cron-time-min").val(),hour=t.time.find("select.cron-time-hour").val(),dow=t.dow.find("select").val();break;case"month":o=t.time.find("select.cron-time-min").val(),hour=t.time.find("select.cron-time-hour").val(),day=t.dom.find("select").val();break;case"year":o=t.time.find("select.cron-time-min").val(),hour=t.time.find("select.cron-time-hour").val(),day=t.dom.find("select").val(),month=t.month.find("select").val();break;default:return n}return[o,hour,day,month,dow].join(" ")}for(var r={initial:"* * * * *",minuteOpts:{minWidth:100,itemWidth:30,columns:4,rows:void 0,title:"Minutes Past the Hour"},timeHourOpts:{minWidth:100,itemWidth:20,columns:2,rows:void 0,title:"Time: Hour"},domOpts:{minWidth:100,itemWidth:30,columns:void 0,rows:10,title:"Day of Month"},monthOpts:{minWidth:100,itemWidth:100,columns:2,rows:void 0,title:void 0},dowOpts:{minWidth:100,itemWidth:void 0,columns:void 0,rows:void 0,title:void 0},timeMinuteOpts:{minWidth:100,itemWidth:20,columns:4,rows:void 0,title:"Time: Minute"},effectOpts:{openSpeed:400,closeSpeed:400,openEffect:"slide",closeEffect:"slide",hideOnMouseOut:!0},url_set:void 0,customValues:void 0,onChange:void 0,useGentleSelect:!1},l="",c=0;60>c;c++){var d=10>c?"0":"";l+="\n"}for(var u="",c=0;24>c;c++){var d=10>c?"0":"";u+="\n"}for(var m="",c=1;32>c;c++){if(1==c||21==c||31==c)var h="st";else if(2==c||22==c)var h="nd";else if(3==c||23==c)var h="rd";else var h="th";m+="\n"}for(var p="",v=["January","February","March","April","May","June","July","August","September","October","November","December"],c=0;c"+v[c]+"\n";for(var f="",y=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=0;c"+y[c]+"\n";for(var g="",b=["minute","hour","day","week","month","year"],c=0;c"+b[c]+"\n";var O={minute:[],hour:["mins"],day:["time"],week:["dow","time"],month:["dom","time"],year:["dom","month","time"]},k={minute:/^(\*\s){4}\*$/,hour:/^\d{1,2}\s(\*\s){3}\*$/,day:/^(\d{1,2}\s){2}(\*\s){2}\*$/,week:/^(\d{1,2}\s){2}(\*\s){2}\d{1,2}$/,month:/^(\d{1,2}\s){3}\*\s\*$/,year:/^(\d{1,2}\s){4}\*$/},w={init:function(o){var n=o?o:{},s=e.extend([],r,n),i=e.extend({},r.effectOpts,n.effectOpts);if(e.extend(s,{minuteOpts:e.extend({},r.minuteOpts,i,n.minuteOpts),domOpts:e.extend({},r.domOpts,i,n.domOpts),monthOpts:e.extend({},r.monthOpts,i,n.monthOpts),dowOpts:e.extend({},r.dowOpts,i,n.dowOpts),timeHourOpts:e.extend({},r.timeHourOpts,i,n.timeHourOpts),timeMinuteOpts:e.extend({},r.timeMinuteOpts,i,n.timeMinuteOpts)}),a(this,s))return this;var c=[],d="",h=s.customValues;if(t(h))for(var v in h)d+="\n";c.period=e("Every ").appendTo(this).data("root",this);var y=c.period.find("select");return y.bind("change.cron",S.periodChanged).data("root",this),s.useGentleSelect&&y.gentleSelect(i),c.dom=e(" on the ").appendTo(this).data("root",this),y=c.dom.find("select").data("root",this),s.useGentleSelect&&y.gentleSelect(s.domOpts),c.month=e(" of ").appendTo(this).data("root",this),y=c.month.find("select").data("root",this),s.useGentleSelect&&y.gentleSelect(s.monthOpts),c.mins=e(" at minutes past the hour ").appendTo(this).data("root",this),y=c.mins.find("select").data("root",this),s.useGentleSelect&&y.gentleSelect(s.minuteOpts),c.dow=e(" on ").appendTo(this).data("root",this),y=c.dow.find("select").data("root",this),s.useGentleSelect&&y.gentleSelect(s.dowOpts),c.time=e(" at : Enable the newsletter + + + +
+ +
+
+
+ +
+
+

Set the schedule for the newsletter

+
+ +
+ + + % for item in newsletter['config_options']: + % if item['input_type'] == 'help': +
+ +

${item['description'] | n}

+
+ % elif item['input_type'] == 'text' or item['input_type'] == 'password': +
+ +
+
+ +
+
+

${item['description'] | n}

+
+ % elif item['input_type'] == 'number': +
+ +
+
+ +
+
+

${item['description'] | n}

+
+ % elif item['input_type'] == 'button': +
+ +
+
+ +
+
+

${item['description'] | n}

+
+ % elif item['input_type'] == 'checkbox': +
+ +

${item['description'] | n}

+ +
+ % elif item['input_type'] == 'select': +
+ +
+
+ +
+
+

${item['description'] | n}

+
+ % endif + % endfor +
+
+
+ +
+
+ +
+
+

Optional: Enter a description to help identify this newsletter in the newsletters list.

+
+
+ + +
+ +

+ Preview the ${newsletter['agent_label']} newsletter. +

+
+
+
+ +
+
+
+ +

+ Test if the ${newsletter['agent_label']} newsletter is working. Check the logs for troubleshooting. +

+
+
+
+ +
+
+
+
+ + + + + + + + + + +% else: + +% endif diff --git a/data/interfaces/default/newsletters_table.html b/data/interfaces/default/newsletters_table.html new file mode 100644 index 00000000..0ef4883f --- /dev/null +++ b/data/interfaces/default/newsletters_table.html @@ -0,0 +1,42 @@ +<%doc> +USAGE DOCUMENTATION :: PLEASE LEAVE THIS AT THE TOP OF THIS FILE + +For Mako templating syntax documentation please visit: http://docs.makotemplates.org/en/latest/ + +Filename: newsletters_table.html +Version: 0.1 + +DOCUMENTATION :: END + + +
    + % for newsletter in sorted(newsletters_list, key=lambda k: (k['agent_label'], k['friendly_name'], k['id'])): + + % endfor +
  • + + Add a new newsletter agent + + +
  • +
+ + \ No newline at end of file diff --git a/data/interfaces/default/notifier_config.html b/data/interfaces/default/notifier_config.html index a70fc5d4..955e97af 100644 --- a/data/interfaces/default/notifier_config.html +++ b/data/interfaces/default/notifier_config.html @@ -7,8 +7,6 @@ sorted(user_emails, key=lambda u: u['user']) %> % if notifier: - -