From f0595b8b0a7b3236e5349541810c4fe1abe47bfa Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Fri, 30 Sep 2016 20:05:39 -0700 Subject: [PATCH] Add new notification system --- data/interfaces/default/css/plexpy.css | 51 +- data/interfaces/default/notifier_config.html | 352 +++ data/interfaces/default/notifiers_table.html | 46 + data/interfaces/default/settings.html | 409 +-- plexpy/__init__.py | 21 + plexpy/notifiers.py | 2648 ++++++++---------- plexpy/webserve.py | 235 +- 7 files changed, 1924 insertions(+), 1838 deletions(-) create mode 100644 data/interfaces/default/notifier_config.html create mode 100644 data/interfaces/default/notifiers_table.html diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index 73733fb9..631c6a24 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -2328,6 +2328,7 @@ a .home-platforms-list-cover-face:hover margin: 0px 0px 20px 0px; } .stacked-configs > li { + margin: 0; list-style: none; background-color: #282828; width: 100%; @@ -2349,21 +2350,27 @@ a .home-platforms-list-cover-face:hover color: #eee; background-color: #2f2f2f; } -.stacked-configs > li > span > a.toggle-right { +.stacked-configs > li > span > a.toggle-right, +.stacked-configs > li > span > span.toggle-right { float: right; color: #999; padding-left: 10px; } -.stacked-configs > li > span > a.toggle-left { +.stacked-configs > li > span > a.toggle-left, +.stacked-configs > li > span > span.toggle-left { color: #444; padding-right: 8px; } .stacked-configs > li > span > a:hover { color: #eee; } -.stacked-configs > li > span > a.active { +.stacked-configs > li > span > a.active, +.stacked-configs > li > span > span.active { color: #f9be03; } +.stacked-configs > li.new_notification_agent { + cursor: pointer; +} .accordion { width: 100%; max-width: 900px; @@ -2382,10 +2389,13 @@ a .home-platforms-list-cover-face:hover -o-transition: all 0.3s ease; transition: all 0.3s ease; } +.accordion li { + margin: 0; +} .accordion li:last-child .link { border-bottom: 0; } -.accordion li i { +.accordion li i.fa { position: absolute; top: 10px; left: 10px; @@ -2449,7 +2459,7 @@ a .home-platforms-list-cover-face:hover text-align: center; bottom: 10px; min-height: 32px; - width: 250px; + width: 400px; z-index: 9999; } .ajaxMsg .msg { @@ -3067,3 +3077,34 @@ a:hover .overlay-refresh-image:hover { #api_key.form-control[readonly]:focus { background-color: #fff; } +#plexpy-notifiers-table .friendly_name { + color: #777; +} +#notifier-config-modal .nav-tabs { + margin-bottom: 10px; + padding-left: 15px; + border-bottom: 1px solid #444; +} +#notifier-config-modal .nav-tabs > li { + margin: 0 0 -1px 0; +} +#notifier-config-modal .nav-tabs > li > a { + padding: 5px 10px; + color: #737373; +} +#notifier-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 { + 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 { + border: 1px solid #444; + border-bottom-color: transparent; +} diff --git a/data/interfaces/default/notifier_config.html b/data/interfaces/default/notifier_config.html new file mode 100644 index 00000000..d5e146a7 --- /dev/null +++ b/data/interfaces/default/notifier_config.html @@ -0,0 +1,352 @@ +<%! + from plexpy import helpers, notifiers + available_notification_actions = notifiers.available_notification_actions() +%> +% if notifier: + +% endif + + diff --git a/data/interfaces/default/notifiers_table.html b/data/interfaces/default/notifiers_table.html new file mode 100644 index 00000000..b0e7396f --- /dev/null +++ b/data/interfaces/default/notifiers_table.html @@ -0,0 +1,46 @@ +<%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: notifiers_table.html +Version: 0.1 + +DOCUMENTATION :: END + + + + + \ No newline at end of file diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 848e70a3..6a61c9e5 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -7,7 +7,7 @@ from plexpy import common, notifiers from plexpy.helpers import anon_url - available_notification_agents = sorted(notifiers.available_notification_agents(), key=lambda k: k['name']) + available_notification_agents = sorted(notifiers.available_notification_agents(), key=lambda k: k['label']) %> <%def name="headIncludes()"> @@ -973,274 +973,6 @@

Set the delay (in seconds) for recently added notifications to allow metadata to be processed. Minimum 60 seconds.

-
-

Custom Notification Messages

-
-

- You can set custom formatted text for each type of notification. - Click here for a list of available parameters which can be used. -

-

- You can also add tags to exclude certain text depending on the media type. - Click here to view usage information. -

-
- - -

@@ -1249,27 +981,13 @@

Notification Agents

- Toggle the desired notification options by clicking the bell icon () and configure it by clicking the settings icon to the right. + Add a new notification agent, or configure an existing notification agent by clicking the settings icon on the right.

-
- - +
+
+
Loading notification agents...
+
+
@@ -1591,8 +1309,35 @@ - - + +