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