Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7cc39605f5 | ||
|
|
fed8205a64 | ||
|
|
d669a39a00 |
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user