-
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.
- Loading branch information
Showing
7 changed files
with
148 additions
and
110 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
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