From cef0ebf66dc7c963e2a9acc38fde267687c365cc Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 25 Jun 2020 09:30:59 -0400 Subject: [PATCH 1/9] Using request body for ios subscription. --- apps/profile/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/profile/views.py b/apps/profile/views.py index 3e0e5c107..b2ec6c5cc 100644 --- a/apps/profile/views.py +++ b/apps/profile/views.py @@ -689,10 +689,10 @@ def email_optout(request): @json.json_view def ios_subscription_status(request): - logging.debug(" ---> iOS Subscription Status: %s" % request.__dict__) + logging.debug(" ---> iOS Subscription Status: %s" % request.body) subject = "iOS Subscription Status" - message = """%s""" % (request.__dict__) + message = """%s""" % (request.body) mail_admins(subject, message) return { From b7874de600c4f152225d1a76a7921b90c80f1fd2 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 25 Jun 2020 14:51:00 -0400 Subject: [PATCH 2/9] Adding scrollbar colors. --- media/css/darkmode.css | 11 ++++++++--- media/css/reader.css | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/media/css/darkmode.css b/media/css/darkmode.css index f5af5b9e9..5096a4f07 100644 --- a/media/css/darkmode.css +++ b/media/css/darkmode.css @@ -78,15 +78,20 @@ body.NB-dark { /* = Scrollbars = */ /* ============== */ +.NB-dark { + scrollbar-color: #565859 #262829; +} .NB-dark ::-webkit-scrollbar { - width: 8px; + width: 12px; } -.NB-dark ::-webkit-scrollbar-thumb { +.NB-dark ::-webkit-scrollbar-thumb, +.NB-dark::-webkit-scrollbar-thumb { background-color: #565859; } -.NB-dark ::-webkit-scrollbar-track { +.NB-dark ::-webkit-scrollbar-track, +.NB-dark::-webkit-scrollbar-track { background-color: #262829; } diff --git a/media/css/reader.css b/media/css/reader.css index 193cccab9..37d3428a0 100644 --- a/media/css/reader.css +++ b/media/css/reader.css @@ -15,7 +15,21 @@ body { text-rendering: optimizeLegibility; background-color: white; -webkit-overflow-scrolling: touch; + scrollbar-color: #C2C2C2 #FAFAFA; } + +/*::-webkit-scrollbar { + width: 12px; +} +*/ +::-webkit-scrollbar-thumb { + background-color: #C2C2C2; +} + +::-webkit-scrollbar-track { + background-color: #FAFAFA; +} + .NB-layout { overflow: hidden; height: 100%; From 3bae1582df1464e60f84d05c4d06ed825372e701 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 25 Jun 2020 14:57:31 -0400 Subject: [PATCH 3/9] Loading dark theme if selected on load. --- apps/reader/views.py | 2 ++ templates/reader/dashboard.xhtml | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/reader/views.py b/apps/reader/views.py index 85dcf5af9..b2b838dd5 100644 --- a/apps/reader/views.py +++ b/apps/reader/views.py @@ -104,6 +104,7 @@ def dashboard(request, **kwargs): statistics = MStatistics.all() social_profile = MSocialProfile.get_user(user.pk) custom_styling = MCustomStyling.get_user(user.pk) + preferences = json.decode(user.profile.preferences) if not user.is_active: url = "https://%s%s" % (Site.objects.get_current().domain, @@ -114,6 +115,7 @@ def dashboard(request, **kwargs): return { 'user_profile' : user.profile, + 'preferences' : preferences, 'feed_count' : feed_count, 'custom_styling' : custom_styling, 'account_images' : range(1, 4), diff --git a/templates/reader/dashboard.xhtml b/templates/reader/dashboard.xhtml index cec478e7b..7cd406667 100644 --- a/templates/reader/dashboard.xhtml +++ b/templates/reader/dashboard.xhtml @@ -36,9 +36,12 @@ {% endif %} {% endblock %} -{% block bodyclass %}NB-body-main{% endblock %} -{% block content %} +{% block bodyclass %} + NB-body-main + {% if preferences.theme == "dark" %}NB-dark{% endif %} +{% endblock %} +{% block content %}

NewsBlur

- The best stories from your friends and favorite blogs, all in one place.

From 2e878eee1db18c34beae59890863e7aa305c28c3 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 25 Jun 2020 15:18:47 -0400 Subject: [PATCH 4/9] Attempting to style newsletters in dark mode. --- media/css/darkmode.css | 11 +++++++++++ media/js/newsblur/models/stories.js | 4 ++++ media/js/newsblur/views/story_detail_view.js | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/media/css/darkmode.css b/media/css/darkmode.css index 5096a4f07..abc9e648a 100644 --- a/media/css/darkmode.css +++ b/media/css/darkmode.css @@ -1169,6 +1169,17 @@ background-color: #5d8392; color: #c0c0c0; background-color: #191b1c; } +.NB-dark .NB-newsletter p { + color: #c0c0c0 !important; +} +.NB-dark .NB-newsletter h1, +.NB-dark .NB-newsletter h2, +.NB-dark .NB-newsletter h3, +.NB-dark .NB-newsletter h4, +.NB-dark .NB-newsletter h5, +.NB-dark .NB-newsletter h6 { + color: #c0c0c0 !important; +} /* Quote blocks found in stories */ .NB-dark .NB-feed-story blockquote { diff --git a/media/js/newsblur/models/stories.js b/media/js/newsblur/models/stories.js index c9fac6e2b..1602801b7 100644 --- a/media/js/newsblur/models/stories.js +++ b/media/js/newsblur/models/stories.js @@ -23,6 +23,10 @@ NEWSBLUR.Models.Story = Backbone.Model.extend({ this.public_comments = new NEWSBLUR.Collections.Comments(this.get('public_comments')); }, + feed: function() { + return NEWSBLUR.assets.get_feed(this.get('story_feed_id')); + }, + score: function() { if (NEWSBLUR.reader.flags['starred_view']) { return 2; diff --git a/media/js/newsblur/views/story_detail_view.js b/media/js/newsblur/views/story_detail_view.js index a3323bea3..8ae8f0a0e 100644 --- a/media/js/newsblur/views/story_detail_view.js +++ b/media/js/newsblur/views/story_detail_view.js @@ -230,7 +230,7 @@ NEWSBLUR.Views.StoryDetailView = Backbone.View.extend({
\
\
\ -
\ +
\ <% if (!options.skip_content) { %>\ <%= story.story_content() %>\ <% } %>\ From 12ab2342d59e06bb1477097c400ec047276c205e Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 25 Jun 2020 15:20:25 -0400 Subject: [PATCH 5/9] Typo in template --- media/js/newsblur/views/story_detail_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/js/newsblur/views/story_detail_view.js b/media/js/newsblur/views/story_detail_view.js index 8ae8f0a0e..bdf15fc24 100644 --- a/media/js/newsblur/views/story_detail_view.js +++ b/media/js/newsblur/views/story_detail_view.js @@ -230,7 +230,7 @@ NEWSBLUR.Views.StoryDetailView = Backbone.View.extend({
\
\
\ -
\ +
\ <% if (!options.skip_content) { %>\ <%= story.story_content() %>\ <% } %>\ From 3c334d56ff414afd0ea3c45856ef2f0b54920b6f Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 25 Jun 2020 15:22:29 -0400 Subject: [PATCH 6/9] Using the correct attribute. --- media/js/newsblur/views/story_detail_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/js/newsblur/views/story_detail_view.js b/media/js/newsblur/views/story_detail_view.js index bdf15fc24..8973260ab 100644 --- a/media/js/newsblur/views/story_detail_view.js +++ b/media/js/newsblur/views/story_detail_view.js @@ -230,7 +230,7 @@ NEWSBLUR.Views.StoryDetailView = Backbone.View.extend({
\
\
\ -
\ +
NB-newsletter<% } %>">\ <% if (!options.skip_content) { %>\ <%= story.story_content() %>\ <% } %>\ From 81f9791761a482aa6a3c7113476cb41f25c1698c Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 25 Jun 2020 15:26:07 -0400 Subject: [PATCH 7/9] Styling more newsletter elements. --- media/css/darkmode.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media/css/darkmode.css b/media/css/darkmode.css index abc9e648a..68c7b8be2 100644 --- a/media/css/darkmode.css +++ b/media/css/darkmode.css @@ -1169,7 +1169,10 @@ background-color: #5d8392; color: #c0c0c0; background-color: #191b1c; } -.NB-dark .NB-newsletter p { +.NB-dark .NB-newsletter p, +.NB-dark .NB-newsletter div, +.NB-dark .NB-newsletter span, +.NB-dark .NB-newsletter td { color: #c0c0c0 !important; } .NB-dark .NB-newsletter h1, From 3dfbb5ccd0dda1344d0aeb9d0174054c52c9f9d5 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 25 Jun 2020 15:30:32 -0400 Subject: [PATCH 8/9] Styling background colors for newsletters. --- media/css/darkmode.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/media/css/darkmode.css b/media/css/darkmode.css index 68c7b8be2..6236e20b6 100644 --- a/media/css/darkmode.css +++ b/media/css/darkmode.css @@ -1175,6 +1175,9 @@ background-color: #5d8392; .NB-dark .NB-newsletter td { color: #c0c0c0 !important; } +.NB-dark .NB-newsletter td { + background-color: #191b1c; +} .NB-dark .NB-newsletter h1, .NB-dark .NB-newsletter h2, .NB-dark .NB-newsletter h3, From 5272a11ab0f3d919e482adb0aec0d91077a0f00b Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 25 Jun 2020 16:31:18 -0400 Subject: [PATCH 9/9] Not every story is from a feed. --- media/js/newsblur/views/story_detail_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/js/newsblur/views/story_detail_view.js b/media/js/newsblur/views/story_detail_view.js index 8973260ab..6c7a596b8 100644 --- a/media/js/newsblur/views/story_detail_view.js +++ b/media/js/newsblur/views/story_detail_view.js @@ -230,7 +230,7 @@ NEWSBLUR.Views.StoryDetailView = Backbone.View.extend({
\
\
\ -
NB-newsletter<% } %>">\ +
NB-newsletter<% } %>">\ <% if (!options.skip_content) { %>\ <%= story.story_content() %>\ <% } %>\