From de3c575a6b0f58be685c5d62d17020dfa8cde87f Mon Sep 17 00:00:00 2001 From: Matteo Bronkhorst <32799956+DrumsnChocolate@users.noreply.github.com> Date: Sun, 19 Jan 2025 20:27:23 +0100 Subject: [PATCH] Draft: Show articles a group has published (#775) * add articles attribute to group model * rework tab visibility logic a bit to allow for more readability and extensibility * added the ability to view articles per group * fix lint --- app/components/cards/article-card.hbs | 43 ++++++++------- app/components/cards/article-card.js | 14 ----- app/components/cards/membership-card.hbs | 10 ++-- app/components/cards/membership-card.js | 3 -- .../application/group-memberships.js | 53 ++++++++++++------- app/controllers/groups/group/index.js | 1 - app/models/group.js | 1 + app/templates/articles/index.hbs | 4 +- app/templates/groups/group/index.hbs | 43 ++++++++++++--- app/templates/users/user/groups.hbs | 12 ++--- 10 files changed, 104 insertions(+), 80 deletions(-) delete mode 100644 app/components/cards/article-card.js delete mode 100644 app/components/cards/membership-card.js diff --git a/app/components/cards/article-card.hbs b/app/components/cards/article-card.hbs index 8558b4fd7..88e3c64be 100644 --- a/app/components/cards/article-card.hbs +++ b/app/components/cards/article-card.hbs @@ -1,5 +1,5 @@
@@ -8,32 +8,31 @@
{{article.authorName}}
-
- +

- {{#if article.pinned}}{{/if}} - {{article.title}} + {{#if @article.pinned}}{{/if}} + {{@article.title}}

- {{#if article.group}} + {{#if @article.group}} - {{article.authorName}} + {{@article.authorName}} {{else}} - {{article.authorName}} + {{@article.authorName}} {{/if}} @@ -66,18 +65,18 @@

- {{#if showExcerpt}} - {{clean-markdown article.excerpt}} + {{#if @showExcerpt}} + {{clean-markdown @article.excerpt}} {{else}} {{markdown-to-html - article.contentCamofied + @article.contentCamofied extensions='youtubeEmbed bootstrapTable' }} {{/if}}

{{t 'component.cards.articleCard.reactions' - count=article.amountOfComments + count=@article.amountOfComments }} - {{#if useMaxHeight}} -