mirror of
https://github.com/discourse/discourse-rewind.git
synced 2025-07-07 06:12:22 +00:00
favorite categories/tags
This commit is contained in:
parent
29a54cf075
commit
3049646b65
@ -3,7 +3,20 @@
|
||||
# Topics visited grouped by tag
|
||||
module DiscourseRewind
|
||||
class Rewind::Action::FavoriteTags < Rewind::Action::BaseReport
|
||||
FakeData = {
|
||||
data: [
|
||||
{ tag_id: 1, name: "cats" },
|
||||
{ tag_id: 2, name: "dogs" },
|
||||
{ tag_id: 3, name: "countries" },
|
||||
{ tag_id: 4, name: "management" },
|
||||
{ tag_id: 5, name: "things" },
|
||||
],
|
||||
identifier: "favorite-tags",
|
||||
}
|
||||
|
||||
def call
|
||||
return FakeData if Rails.env.development?
|
||||
|
||||
favorite_tags =
|
||||
TopicViewItem
|
||||
.joins(:topic)
|
||||
|
@ -11,7 +11,10 @@ const FavoriteCategories = <template>
|
||||
<div class="rewind-report-container">
|
||||
{{#each @report.data as |data|}}
|
||||
<div class="rewind-card">
|
||||
<a href={{concat "/c/-/" data.category_id}}>{{data.name}}</a>
|
||||
<a
|
||||
class="favorite-categories__category"
|
||||
href={{concat "/c/-/" data.category_id}}
|
||||
>{{data.name}}</a>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
@ -5,13 +5,16 @@ const FavoriteTags = <template>
|
||||
{{#if @report.data.length}}
|
||||
<div class="rewind-report-page -favorite-tags">
|
||||
<h2 class="rewind-report-title">{{i18n
|
||||
"discourse_rewind.reports.favorite_categories.title"
|
||||
"discourse_rewind.reports.favorite_tags.title"
|
||||
count=@report.data.length
|
||||
}}</h2>
|
||||
<div class="rewind-report-container">
|
||||
{{#each @report.data as |data|}}
|
||||
<div class="rewind-card">
|
||||
<a href={{concat "/tag/-/" data.name}}>{{data.name}}</a>
|
||||
<a
|
||||
class="favorite-tags__tag"
|
||||
href={{concat "/tag/-/" data.name}}
|
||||
>#{{data.name}}</a>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
@ -26,6 +26,7 @@ export default class Rewind extends Component {
|
||||
@tracked rewind = [];
|
||||
|
||||
@tracked fullScreen = true;
|
||||
|
||||
@tracked loadingRewind = false;
|
||||
|
||||
@action
|
||||
|
@ -1,4 +1,4 @@
|
||||
.rewind-report-page.-activity-calendar {
|
||||
.-activity-calendar {
|
||||
margin-bottom: 5em;
|
||||
.rewind-card {
|
||||
@include rewind-border;
|
||||
|
@ -1,2 +1,11 @@
|
||||
.-favorite-categories {
|
||||
.rewind-report-container {
|
||||
display: flex;
|
||||
gap: 0.5em;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
|
||||
.favorite-categories__category {
|
||||
font-family: var(--pixel-text);
|
||||
}
|
||||
|
@ -1,2 +1,11 @@
|
||||
.-favorite-tags {
|
||||
.rewind-report-container {
|
||||
display: flex;
|
||||
gap: 0.5em;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
|
||||
.favorite-tags__tag {
|
||||
font-family: var(--pixel-text);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
.rewind-report-page.-top-words .rewind-report-container {
|
||||
.-top-words .rewind-report-container {
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
width: 100%;
|
||||
|
@ -1,4 +1,4 @@
|
||||
.rewind-report-page.-activity-calendar {
|
||||
.-activity-calendar {
|
||||
.rewind-calendar {
|
||||
border-spacing: 1px;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user