diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index ff44dbea..649f36ac 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -33,6 +33,33 @@ select.input-sm { color: #999; outline: none; } +select[multiple] { + height: 125px; + margin: 5px 0 5px 0; + color: #fff; + border: 0px solid #444; + background: #555; + padding: 2px 2px; + background-color: #555; + border-radius: 3px; + transition: background-color .3s; +} +select[multiple]:focus { + outline: 0; + outline: thin dotted \9; + color: #555; + background-color: #fff; + transition: background-color .3s; +} +select[multiple]:focus::-webkit-scrollbar-thumb { + background-color: rgba(0,0,0,.15); +} +select[multiple] option { + padding: 6px 10px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} img { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; diff --git a/data/interfaces/default/index.html b/data/interfaces/default/index.html index ed983ca6..fab5d5b3 100644 --- a/data/interfaces/default/index.html +++ b/data/interfaces/default/index.html @@ -16,6 +16,7 @@ + % if config['home_stats_cards'] > 'watch_statistics':
@@ -27,6 +28,7 @@
+ % endif
diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index d13e8700..ee37f5fd 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -34,14 +34,15 @@ available_notification_agents = notifiers.available_notification_agents()
@@ -83,10 +84,33 @@ available_notification_agents = notifiers.available_notification_agents()

Set your preferred time format. Click here to see the parameter list.

+

+
+
-

Homepage Statistics

+

Watch Statistics

+
+ +

Select the cards to show in the watch statistics on the home page.

+
+
+ +
+
+
@@ -95,7 +119,7 @@ available_notification_agents = notifiers.available_notification_agents()
-

Specify the number of days for the statistics on the home page. Default is 30 days.

+

Specify the number of days for the watch statistics on the home page. Default is 30 days.

@@ -105,7 +129,7 @@ available_notification_agents = notifiers.available_notification_agents()
-

Specify the number of items to show in the top lists for the statistics on the home page. Max is 10 items, default is 5 items, 0 to disable.

+

Specify the number of items to show in the top lists for the watch statistics on the home page. Max is 10 items, default is 5 items, 0 to disable.

-
+

Web Interface

@@ -164,7 +188,7 @@ available_notification_agents = notifiers.available_notification_agents()

-
+

Authentication

@@ -216,7 +240,7 @@ available_notification_agents = notifiers.available_notification_agents()

-
+

Plex Media Server

@@ -272,7 +296,7 @@ available_notification_agents = notifiers.available_notification_agents()
-
+

Plex.tv Authentication

@@ -315,7 +339,7 @@ available_notification_agents = notifiers.available_notification_agents()

-
+

Extra Settings

@@ -334,7 +358,7 @@ available_notification_agents = notifiers.available_notification_agents()

-
+

Monitoring Settings

@@ -416,7 +440,7 @@ available_notification_agents = notifiers.available_notification_agents()

-
+

Global Notification Toggles

@@ -566,7 +590,7 @@ available_notification_agents = notifiers.available_notification_agents()

-
+

Notification Agents

@@ -1178,6 +1202,19 @@ $(document).ready(function() { } var accordion = new Accordion($('#accordion'), false); + + var cards = "${config['home_stats_cards']}".split(/[\s,]+/); + cards.forEach(function (item) { + $('#card-'+item).prop('selected', !$(this).prop('selected')); + }); + $('#home_stats_cards').on('mousedown', function(e) { + e.preventDefault(); + var scroll = this.scrollTop; + e.target.selected = !e.target.selected; + this.scrollTop = scroll; + }).on('mousemove', function(e) { + e.preventDefault() + }); }); diff --git a/plexpy/config.py b/plexpy/config.py index 9d41b67a..7288ac34 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -85,6 +85,7 @@ _CONFIG_DEFINITIONS = { 'HOME_STATS_LENGTH': (int, 'General', 30), 'HOME_STATS_TYPE': (int, 'General', 0), 'HOME_STATS_COUNT': (int, 'General', 5), + 'HOME_STATS_CARDS': (str, 'General', 'top_tv, popular_tv, top_movies, popular_movies, top_music, popular_music, top_users, top_platforms, last_watched'), 'HTTPS_CERT': (str, 'General', ''), 'HTTPS_KEY': (str, 'General', ''), 'HTTP_HOST': (str, 'General', '0.0.0.0'), diff --git a/plexpy/webserve.py b/plexpy/webserve.py index de5af414..c1507dee 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -472,6 +472,7 @@ class WebInterface(object): "home_stats_length": plexpy.CONFIG.HOME_STATS_LENGTH, "home_stats_type": checked(plexpy.CONFIG.HOME_STATS_TYPE), "home_stats_count": plexpy.CONFIG.HOME_STATS_COUNT, + "home_stats_cards": plexpy.CONFIG.HOME_STATS_CARDS, "buffer_threshold": plexpy.CONFIG.BUFFER_THRESHOLD, "buffer_wait": plexpy.CONFIG.BUFFER_WAIT } @@ -524,6 +525,10 @@ class WebInterface(object): if kwargs['pms_ip'] != plexpy.CONFIG.PMS_IP: refresh_users = True + if 'home_stats_cards' in kwargs: + if kwargs['home_stats_cards'] != 'watch_statistics': + kwargs['home_stats_cards'] = ', '.join(kwargs['home_stats_cards']) + plexpy.CONFIG.process_kwargs(kwargs) # Write the config