-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: suppress interested and not going buttons by default (#621)
Interested and not going are generally not used. To avoid adding this clutter to the UI we now suppress this. Sites wishing to have these buttons can amend the `event_participation_buttons` site setting Also: - Add a show participants button even if there are no participants (so admins can populate events) - Fix localization for event participation - Allow toggling attendance by pressing the same button - Removes leave event button from the dropdown menu - Refactors outlets to allow maximum flexibility --------- Co-authored-by: Joffrey JAFFEUX <[email protected]>
- Loading branch information
1 parent
ef3e3cb
commit b9fc1bd
Showing
12 changed files
with
363 additions
and
244 deletions.
There are no files selected for viewing
17 changes: 12 additions & 5 deletions
17
assets/javascripts/discourse/components/discourse-post-event/creator.gjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import Component from "@glimmer/component"; | ||
import avatar from "discourse/helpers/avatar"; | ||
import { formatUsername } from "discourse/lib/utilities"; | ||
import i18n from "discourse-common/helpers/i18n"; | ||
|
||
export default class DiscoursePostEventCreator extends Component { | ||
get username() { | ||
return this.args.user.name || formatUsername(this.args.user.username); | ||
} | ||
|
||
<template> | ||
<span class="event-creator"> | ||
<a class="topic-invitee-avatar" data-user-card={{@user.username}}> | ||
{{avatar @user imageSize="tiny"}} | ||
<span class="username">{{this.username}}</span> | ||
</a> | ||
<span class="creators"> | ||
<span class="created-by">{{i18n | ||
"discourse_calendar.discourse_post_event.event_ui.created_by" | ||
}}</span> | ||
|
||
<span class="event-creator"> | ||
<a class="topic-invitee-avatar" data-user-card={{@user.username}}> | ||
{{avatar @user imageSize="tiny"}} | ||
<span class="username">{{this.username}}</span> | ||
</a> | ||
</span> | ||
</span> | ||
</template> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
assets/javascripts/discourse/components/discourse-post-event/event-status.gjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Component from "@glimmer/component"; | ||
import i18n from "discourse-common/helpers/i18n"; | ||
|
||
export default class EventStatus extends Component { | ||
get eventStatusLabel() { | ||
return i18n( | ||
`discourse_calendar.discourse_post_event.models.event.status.${this.args.event.status}.title` | ||
); | ||
} | ||
|
||
get eventStatusDescription() { | ||
return i18n( | ||
`discourse_calendar.discourse_post_event.models.event.status.${this.args.event.status}.description` | ||
); | ||
} | ||
|
||
get statusClass() { | ||
return `status ${this.args.event.status}`; | ||
} | ||
|
||
<template> | ||
{{#if @event.isExpired}} | ||
<span class="status expired"> | ||
{{i18n "discourse_calendar.discourse_post_event.models.event.expired"}} | ||
</span> | ||
{{else if @event.isClosed}} | ||
<span class="status closed"> | ||
{{i18n "discourse_calendar.discourse_post_event.models.event.closed"}} | ||
</span> | ||
{{else}} | ||
<span class={{this.statusClass}} title={{this.eventStatusDescription}}> | ||
{{this.eventStatusLabel}} | ||
</span> | ||
{{/if}} | ||
</template> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.