Merge pull request #7 from jjaffeux/category-links

UX: Match category cards with tag cards
This commit is contained in:
Rafael dos Santos Silva 2025-01-15 09:45:32 -03:00 committed by GitHub
commit 19af3cb107
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 4 deletions

View File

@ -3,7 +3,19 @@
# Topics visited grouped by category
module DiscourseRewind
class Rewind::Action::FavoriteCategories < Rewind::Action::BaseReport
FakeData = {
data: [
{ category_id: 1, name: "cats" },
{ category_id: 2, name: "dogs" },
{ category_id: 3, name: "countries" },
{ category_id: 4, name: "management" },
{ category_id: 5, name: "things" },
],
identifier: "favorite-categories",
}
def call
return FakeData if Rails.env.development?
favorite_categories =
TopicViewItem
.joins(:topic)

View File

@ -10,12 +10,12 @@ const FavoriteCategories = <template>
}}</h2>
<div class="rewind-report-container">
{{#each @report.data as |data|}}
<div class="rewind-card">
<a
<a href={{concat "/c/-/" data.category_id}} class="rewind-card">
<p
class="favorite-categories__category"
href={{concat "/c/-/" data.category_id}}
>{{data.name}}</a>
</div>
>{{data.name}}</p>
</a>
{{/each}}
</div>
</div>