mirror of
https://github.com/discourse/discourse-rewind.git
synced 2025-07-06 22:02:12 +00:00
Merge pull request #7 from jjaffeux/category-links
UX: Match category cards with tag cards
This commit is contained in:
commit
19af3cb107
@ -3,7 +3,19 @@
|
|||||||
# Topics visited grouped by category
|
# Topics visited grouped by category
|
||||||
module DiscourseRewind
|
module DiscourseRewind
|
||||||
class Rewind::Action::FavoriteCategories < Rewind::Action::BaseReport
|
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
|
def call
|
||||||
|
return FakeData if Rails.env.development?
|
||||||
|
|
||||||
favorite_categories =
|
favorite_categories =
|
||||||
TopicViewItem
|
TopicViewItem
|
||||||
.joins(:topic)
|
.joins(:topic)
|
||||||
|
@ -10,12 +10,12 @@ const FavoriteCategories = <template>
|
|||||||
}}</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">
|
<a href={{concat "/c/-/" data.category_id}} class="rewind-card">
|
||||||
<a
|
<p
|
||||||
class="favorite-categories__category"
|
class="favorite-categories__category"
|
||||||
href={{concat "/c/-/" data.category_id}}
|
href={{concat "/c/-/" data.category_id}}
|
||||||
>{{data.name}}</a>
|
>{{data.name}}</p>
|
||||||
</div>
|
</a>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user