File tree Expand file tree Collapse file tree 10 files changed +27
-23
lines changed
app/services/discourse_rewind/action
assets/javascripts/discourse Expand file tree Collapse file tree 10 files changed +27
-23
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class BestTopics < BaseReport
1313 } ,
1414 {
1515 topic_id : 2 ,
16- title : "Best practices for database optimization" ,
16+ title : ":file_cabinet: Best practices for database optimization" ,
1717 excerpt : "Learn how to optimize your database queries for better performance..." ,
1818 yearly_score : 38.2 ,
1919 } ,
Original file line number Diff line number Diff line change @@ -28,7 +28,9 @@ export default class BestTopics extends Component {
2828 >
2929 <span class =" best-topics --rank" ></span >
3030 <span class =" best-topics --rank" ></span >
31- <h2 class =" best-topics__header" >{{topic.title }} </h2 >
31+ <h2 class =" best-topics__header" >{{replaceEmoji
32+ topic.title
33+ }} </h2 >
3234 <span class =" best-topics__excerpt" >
3335 {{replaceEmoji ( htmlSafe topic.excerpt ) }}
3436 </span >
Original file line number Diff line number Diff line change @@ -14,7 +14,11 @@ export default class NewUserInteractions extends Component {
1414 <template >
1515 <div class =" rewind-report-page --new-user-interactions" >
1616 <div class =" wordart-container" >
17- <div class =" wordart-text" >your contributions helped</div >
17+ <div class =" wordart-text" >
18+ {{i18n
19+ " discourse_rewind.reports.new_user_interactions.your_contributions_helped"
20+ }}
21+ </div >
1822 <div class =" wordart-3d" >
1923 {{#each this . wavyWords as | word | }}
2024 <span class =" wordart-word" >
Original file line number Diff line number Diff line change @@ -3,14 +3,11 @@ import { service } from "@ember/service";
33import bodyClass from " discourse/helpers/body-class" ;
44
55export default class AvatarDecorator extends Component {
6- @service currentUser;
76 @service rewind;
87
98 get showDecorator () {
109 return (
11- this .currentUser ? .is_rewind_active &&
12- ! this .rewind .dismissed &&
13- ! this .rewind .disabled
10+ this .rewind .active && ! this .rewind .dismissed && ! this .rewind .disabled
1411 );
1512 }
1613
Original file line number Diff line number Diff line change @@ -7,14 +7,11 @@ import { i18n } from "discourse-i18n";
77
88export default class RewindCallout extends Component {
99 @service router;
10- @service currentUser;
1110 @service rewind;
1211
1312 get showCallout () {
1413 return (
15- this .currentUser ? .is_rewind_active &&
16- ! this .rewind .dismissed &&
17- ! this .rewind .disabled
14+ this .rewind .active && ! this .rewind .dismissed && ! this .rewind .disabled
1815 );
1916 }
2017
Original file line number Diff line number Diff line change @@ -5,11 +5,10 @@ import icon from "discourse/helpers/d-icon";
55import { i18n } from " discourse-i18n" ;
66
77export default class RewindTab extends Component {
8- @service currentUser;
98 @service rewind;
109
1110 get showNavTab () {
12- return this .currentUser ? . is_rewind_active && ! this .rewind .disabled ;
11+ return this .rewind . active && ! this .rewind .disabled ;
1312 }
1413
1514 <template >
Original file line number Diff line number Diff line change @@ -13,18 +13,20 @@ export default {
1313 return ;
1414 }
1515
16- if ( ! this . currentUser . is_rewind_active ) {
16+ if ( ! this . rewind . active ) {
1717 return ;
1818 }
1919
2020 withPluginApi ( ( api ) => {
21- api . addQuickAccessProfileItem ( {
22- icon : "repeat" ,
23- href : "/my/activity/rewind" ,
24- content : i18n ( "discourse_rewind.profile_link" , {
25- rewindYear : this . rewind . fetchRewindYear ,
26- } ) ,
27- } ) ;
21+ if ( ! this . rewind . disabled ) {
22+ api . addQuickAccessProfileItem ( {
23+ icon : "repeat" ,
24+ href : "/my/activity/rewind" ,
25+ content : i18n ( "discourse_rewind.profile_link" , {
26+ rewindYear : this . rewind . fetchRewindYear ,
27+ } ) ,
28+ } ) ;
29+ }
2830 } ) ;
2931 } ,
3032} ;
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ export default class Rewind extends Service {
1212 @tracked
1313 _isDisabled = this . currentUser ?. user_option ?. discourse_rewind_disabled ;
1414
15+ get active ( ) {
16+ return this . currentUser ?. is_rewind_active ;
17+ }
18+
1519 get disabled ( ) {
1620 return this . _isDisabled ?? false ;
1721 }
Original file line number Diff line number Diff line change 133133 replies : Replies to Posts
134134 mentions : Mentions
135135 topics_with_new_users : Topics with New Users
136+ your_contributions_helped : your contributions helped
136137 time_of_day_activity :
137138 title : Daily Activity Rhythm
138139 play_button : Play your activity as sound
Original file line number Diff line number Diff line change @@ -65,8 +65,6 @@ def self.year_date_range(date_override = nil)
6565 end
6666
6767 add_to_serializer ( :current_user , :is_rewind_active ) do
68- return false if object . user_option &.discourse_rewind_disabled
69-
7068 Rails . env . development? || Date . today . month == 1 || Date . today . month == 12
7169 end
7270
You can’t perform that action at this time.
0 commit comments