Adding stories in archive to stats popover.

This commit is contained in:
Samuel Clay 2022-06-09 10:18:32 -07:00
parent 1eb71ee524
commit 5674fc981c
8 changed files with 38 additions and 5 deletions

View file

@ -205,6 +205,8 @@ class Feed(models.Model):
'num_subscribers': self.num_subscribers,
'updated': relative_timesince(self.last_update),
'updated_seconds_ago': seconds_timesince(self.last_update),
'fs_size_bytes': self.fs_size_bytes,
'archive_count': self.archive_count,
'last_story_date': self.last_story_date,
'last_story_seconds_ago': seconds_timesince(self.last_story_date),
'stories_last_month': self.stories_last_month,

View file

@ -567,7 +567,7 @@ hr {
.NB-feedlist ul.folder {
margin: 0;
padding: 0 0 0 30px;
padding: 0 0 0 25px;
list-style: none;
}
.NB-feedlist ul.folder.NB-root {
@ -767,6 +767,8 @@ img.feed_favicon {
-webkit-box-orient: vertical;
overflow: hidden;
word-break: break-all;
transition: padding .12s ease-out, margin 0.12s ease-out, top 0.12s ease-out;
}
.NB-density-compact .NB-feedlist .feed_title {
@ -1882,6 +1884,8 @@ img.feed_favicon {
height: 20px;
left: -31px;
top: 12px;
transition: top 0.12s ease-out;
}
.NB-theme-feed-size-xs .NB-storytitles-sentiment {
@ -1935,7 +1939,9 @@ img.feed_favicon {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
/* margin: -15px 0 0 0; */}
/* margin: -15px 0 0 0; */
transition: padding .12s ease-out, margin 0.12s ease-out, top 0.12s ease-out, height 0.12s ease-out;
}
.NB-story-title-magazine.NB-story-title .NB-storytitles-story-image {
background-size: 40%, contain;
}
@ -2006,6 +2012,7 @@ img.feed_favicon {
box-sizing: border-box;
overflow-wrap: break-word;
word-break: break-word;
transition: padding .12s ease-out, margin 0.12s ease-out, top 0.12s ease-out;
}
.NB-density-compact .NB-story-title a.story_title {
@ -13630,6 +13637,11 @@ form.opml_import_form input {
background-size: 16px;
filter: hue-rotate(287deg) saturate(10.5);
}
.NB-stat-archive-count .NB-icon {
background: transparent url('/media/embed/icons/nouns/cabinet.svg') no-repeat 0 0;
background-size: 16px;
filter: hue-rotate(143deg) saturate(14.5);
}
.NB-stat-decay .NB-icon {
background: transparent url('/media/embed/icons/nouns/refresh.svg') no-repeat 0 0;
background-size: 16px;

View file

@ -3,7 +3,7 @@
<title>all-stories</title>
<g id="all-stories" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g transform="translate(0.000000, 0.000000)" fill="#95968E" fill-rule="nonzero" id="Shape">
<path d="M60.8479687,0 C40.6326562,4.0190625 23.36625,16.1315625 12.388125,32.803125 L40.16625,32.803125 C44.9177344,17.9442187 52.2145312,6.290625 60.8479687,0 L60.8479687,0 Z M90.2990625,0 C98.9325,6.2896875 106.165078,17.9442187 110.980781,32.803125 L138.693281,32.803125 C127.789453,16.1313281 110.458125,4.01953125 90.3065625,0 L90.2990625,0 Z M79.321875,2.810625 L79.321875,32.8035938 L103.619531,32.8035938 C98.1996094,16.6078125 89.7035156,5.02546875 79.321875,2.810625 L79.321875,2.810625 Z M71.7595312,2.88386719 C61.588125,5.29160156 53.22,16.7358984 47.865,32.8041797 L71.7595312,32.8041797 L71.7595312,2.88386719 Z M7.965,40.4377734 C3.34148437,49.6754297 0.530859375,59.9110547 -8.32667268e-15,70.8244922 L34.003125,70.8244922 C34.268625,59.9755078 35.6785313,49.7398828 38.0221875,40.4283984 L7.9659375,40.4283984 L7.965,40.4377734 Z M45.7204687,40.4377734 C43.3767187,49.6754297 42.0400781,60.0483984 41.7745313,70.8338672 L71.7675,70.8338672 L71.7675,40.4377734 L45.7204687,40.4377734 Z M79.3298437,40.4377734 L79.3298437,70.8338672 L109.725937,70.8338672 C109.451273,60.0488672 108.114609,49.6761328 105.770859,40.4377734 L79.3298437,40.4377734 Z M113.140781,40.4377734 C115.420453,49.7396484 116.885391,59.9841797 117.159844,70.8338672 L151.162969,70.8338672 C150.622805,59.9115234 147.812109,49.6761328 143.188828,40.4377734 L113.132578,40.4377734 L113.140781,40.4377734 Z M0.0009375,78.4604297 C0.5319375,89.3733984 3.35179687,99.6823828 7.9659375,108.856523 L37.9589062,108.856523 C35.6792344,99.6097266 34.2785156,89.3007422 34.0038281,78.4604297 L0.0009375,78.4604297 Z M41.7759375,78.4604297 C42.0414375,89.3094141 43.3781016,99.6181641 45.721875,108.856523 L71.7585937,108.856523 L71.7585937,78.4604297 L41.765625,78.4604297 L41.7759375,78.4604297 Z M79.3298437,78.4604297 L79.3298437,108.856523 L105.769687,108.856523 C108.113437,99.6188672 109.514297,89.3101172 109.715625,78.4604297 L79.3195312,78.4604297 L79.3298437,78.4604297 Z M117.150937,78.4604297 C116.885437,89.3094141 115.475531,99.6181641 113.205,108.856523 L143.197969,108.856523 C147.821484,99.6828516 150.632109,89.3741016 151.162969,78.4604297 L117.150937,78.4604297 Z M12.3876562,116.483086 C23.2914844,133.154883 40.5665625,145.26668 60.718125,149.286211 C52.1489062,142.996523 44.9160937,131.341992 40.1646094,116.483086 L12.3876562,116.483086 Z M47.865,116.483086 C53.2209375,132.614648 61.5246094,144.132305 71.7595312,146.476055 L71.7595312,116.483086 L47.865,116.483086 Z M79.3321875,116.483086 L79.3321875,146.539336 C89.7691406,144.332906 98.274375,132.751523 103.629844,116.483086 L79.3321875,116.483086 Z M111.000937,116.483086 C106.249453,131.341992 99.0166406,142.995586 90.4474219,149.286211 C110.598281,145.267148 127.865391,133.154648 138.777891,116.483086 L111.000937,116.483086 Z"></path>
<path d="M60.8479687,0 C40.6326562,4.0190625 23.36625,16.1315625 12.388125,32.803125 L40.16625,32.803125 C44.9177344,17.9442187 52.2145312,6.290625 60.8479687,0 L60.8479687,0 Z M90.2990625,0 C98.9325,6.2896875 106.165078,17.9442187 110.980781,32.803125 L138.693281,32.803125 C127.789453,16.1313281 110.458125,4.01953125 90.3065625,0 L90.2990625,0 Z M79.321875,2.810625 L79.321875,32.8035938 L103.619531,32.8035938 C98.1996094,16.6078125 89.7035156,5.02546875 79.321875,2.810625 L79.321875,2.810625 Z M71.7595312,2.88386719 C61.588125,5.29160156 53.22,16.7358984 47.865,32.8041797 L71.7595312,32.8041797 L71.7595312,2.88386719 Z M7.965,40.4377734 C3.34148437,49.6754297 0.530859375,59.9110547 -8.32667268e-15,70.8244922 L34.003125,70.8244922 C34.268625,59.9755078 35.6785313,49.7398828 38.0221875,40.4283984 L7.9659375,40.4283984 L7.965,40.4377734 Z M45.7204687,40.4377734 C43.3767187,49.6754297 42.0400781,60.0483984 41.7745312,70.8338672 L71.7675,70.8338672 L71.7675,40.4377734 L45.7204687,40.4377734 Z M79.3298437,40.4377734 L79.3298437,70.8338672 L109.725937,70.8338672 C109.451273,60.0488672 108.114609,49.6761328 105.770859,40.4377734 L79.3298437,40.4377734 Z M113.140781,40.4377734 C115.420453,49.7396484 116.885391,59.9841797 117.159844,70.8338672 L151.162969,70.8338672 C150.622805,59.9115234 147.812109,49.6761328 143.188828,40.4377734 L113.132578,40.4377734 L113.140781,40.4377734 Z M0.0009375,78.4604297 C0.5319375,89.3733984 3.35179687,99.6823828 7.9659375,108.856523 L37.9589062,108.856523 C35.6792344,99.6097266 34.2785156,89.3007422 34.0038281,78.4604297 L0.0009375,78.4604297 Z M41.7759375,78.4604297 C42.0414375,89.3094141 43.3781016,99.6181641 45.721875,108.856523 L71.7585937,108.856523 L71.7585937,78.4604297 L41.765625,78.4604297 L41.7759375,78.4604297 Z M79.3298437,78.4604297 L79.3298437,108.856523 L105.769687,108.856523 C108.113437,99.6188672 109.514297,89.3101172 109.715625,78.4604297 L79.3195312,78.4604297 L79.3298437,78.4604297 Z M117.150937,78.4604297 C116.885437,89.3094141 115.475531,99.6181641 113.205,108.856523 L143.197969,108.856523 C147.821484,99.6828516 150.632109,89.3741016 151.162969,78.4604297 L117.150937,78.4604297 Z M12.3876562,116.483086 C23.2914844,133.154883 40.5665625,145.26668 60.718125,149.286211 C52.1489062,142.996523 44.9160937,131.341992 40.1646094,116.483086 L12.3876562,116.483086 Z M47.865,116.483086 C53.2209375,132.614648 61.5246094,144.132305 71.7595312,146.476055 L71.7595312,116.483086 L47.865,116.483086 Z M79.3321875,116.483086 L79.3321875,146.539336 C89.7691406,144.332906 98.274375,132.751523 103.629844,116.483086 L79.3321875,116.483086 Z M111.000937,116.483086 C106.249453,131.341992 99.0166406,142.995586 90.4474219,149.286211 C110.598281,145.267148 127.865391,133.154648 138.777891,116.483086 L111.000937,116.483086 Z"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="150px" height="150px" viewBox="0 0 150 150" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>cabinet</title>
<g id="cabinet" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g transform="translate(22.000000, 0.000000)" fill="#95968E" fill-rule="nonzero" id="Path">
<path d="M101.649465,38 L79.2048775,38 L73.0816687,49.8958667 C72.6271328,50.7708667 71.6918725,51.3333333 70.6993137,51.3333333 L36.3001512,51.3333333 C35.3127017,51.3333333 34.3722787,50.7708267 33.9177962,49.8958667 L27.7945875,38 L0,38 L0,70 L107,70 L107,38 L101.649465,38 Z"></path>
<path d="M79.2048775,75 L73.0816687,86.8958667 C72.6271328,87.7708667 71.6918725,88.3333333 70.6993137,88.3333333 L36.3001512,88.3333333 C35.3127017,88.3333333 34.3722787,87.7708267 33.9177962,86.8958667 L27.7945875,75 L0,75 L0,107 L107,107 L107,75 L79.2048775,75 Z"></path>
<path d="M79.2048775,113 L73.0816687,124.789654 C72.6271328,125.656841 71.6918725,126.214286 70.6993137,126.214286 L36.3001512,126.214286 C35.3127017,126.214286 34.3722787,125.656801 33.9177962,124.789654 L27.7945875,113 L0,113 L0,147.357143 C0,148.812829 1.2016635,150 2.675,150 L104.325,150 C105.79839,150 107,148.812776 107,147.357143 L107,113 L79.2048775,113 Z"></path>
<path d="M99.5473366,32 L106,32 L85.3038429,1.19789804 C84.8155652,0.453125026 83.9545201,0 83.067158,0 L23.9276001,0 C23.0402917,0 22.1792197,0.453111693 21.6961571,1.19789804 L1,32 L99.5473366,32 Z"></path>
<polygon points="67.9220769 46 72 38 33 38 37.0779231 46"></polygon>
<polygon points="67.9220769 83 72 75 33 75 37.0779231 83"></polygon>
<polygon points="67.9220769 121 72 113 33 113 37.0779231 121"></polygon>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -8,7 +8,7 @@
<path d="M33.3148165,8.61708769e-14 C30.3128749,8.61708769e-14 27.7879431,2.52493189 27.7879431,5.52687348 L27.7879431,140.84615 C27.7879431,143.848092 30.3128749,146.373024 33.3148165,146.373024 C36.3167581,146.373024 38.84169,143.848092 38.84169,140.84615 L38.84169,5.52687348 C38.84169,2.37073946 36.3119473,8.61708769e-14 33.3148165,8.61708769e-14 Z" id="Path"></path>
</g>
<g id="lines6" transform="translate(0.000000, -0.000000)" fill="#95968E">
<path d="M31.2515625,0 L118.748437,0 C136.010156,0 150,13.9898438 150,31.2515625 C150,48.5097656 136.010156,62.4984375 118.748437,62.4984375 L31.2515625,62.4984375 C13.9898437,62.4984375 0,48.5085938 0,31.2515625 C0,13.9898438 13.9898438,0 31.2515625,0 Z M31.2515625,12.5015625 C20.8969922,12.5015625 12.5015625,20.8969922 12.5015625,31.2515625 C12.5015625,41.6061328 20.8969922,50.0015625 31.2515625,50.0015625 L118.748437,50.0015625 C129.103008,50.0015625 137.498437,41.6061328 137.498437,31.2515625 C137.498437,20.8969922 129.103008,12.5015625 118.748437,12.5015625 L31.2515625,12.5015625 Z" id="Shape"></path>
<path d="M31.2515625,0 L118.748437,0 C136.010156,0 150,13.9898438 150,31.2515625 C150,48.5097656 136.010156,62.4984375 118.748437,62.4984375 L31.2515625,62.4984375 C13.9898437,62.4984375 0,48.5085938 0,31.2515625 C0,13.9898438 13.9898438,0 31.2515625,0 Z M31.2515625,12.5015625 C20.8969922,12.5015625 12.5015625,20.8969922 12.5015625,31.2515625 C12.5015625,41.6061328 20.8969922,50.0015625 31.2515625,50.0015625 L118.748438,50.0015625 C129.103008,50.0015625 137.498438,41.6061328 137.498438,31.2515625 C137.498438,20.8969922 129.103008,12.5015625 118.748438,12.5015625 L31.2515625,12.5015625 Z" id="Shape"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

View file

@ -146,7 +146,7 @@ _.extend(NEWSBLUR.ReaderStatistics.prototype, {
$.make('div', { className: 'NB-statistics-update'}, [
$.make('div', { className: 'NB-statistics-label' }, 'Stories in archive'),
$.make('div', { className: 'NB-statistics-count', title: Inflector.commas(data['fs_size_bytes']) + " bytes" }, '&nbsp;' + (Inflector.commas(data['archive_count'])) + " " + Inflector.pluralize("story", data['archive_count']))
(data['archive_count'] && $.make('div', { className: 'NB-statistics-count', title: Inflector.commas(data['fs_size_bytes']) + " bytes" }, '&nbsp;' + ((Inflector.commas(data['archive_count'])) + " " + Inflector.pluralize("story", data['archive_count']))))
]),
((data.average_stories_per_month == 0 || data.stories_last_month == 0) &&

View file

@ -225,6 +225,10 @@ NEWSBLUR.FeedOptionsPopover = NEWSBLUR.ReaderPopover.extend({
$.make('div', { className: 'NB-icon' }),
$.make('div', { className: 'NB-stat' }, Inflector.pluralize("story", feed.get('average_stories_per_month'), true) + " per month")
])),
(feed.get('archive_count') && $.make('div', { className: 'NB-feedbar-options-stat NB-stat-archive-count' }, [
$.make('div', { className: 'NB-icon' }),
$.make('div', { className: 'NB-stat' }, Inflector.pluralize("story", feed.get('archive_count'), true) + " in archive")
])),
(feed.get('updated') && $.make('div', { className: 'NB-feedbar-options-stat NB-stat-updated' }, [
$.make('div', { className: 'NB-icon' }),
$.make('div', { className: 'NB-stat' }, "Updated " + feed.get('updated') + ' ago')