Skip to content

Commit

Permalink
UX: Events UI Edits
Browse files Browse the repository at this point in the history
This PR restyles the current events post UI:

- Minimize size of invitee avatars
- move CTA buttons to bottom
- remove invitee header & show more button (show more is in ellipses drop down)
- restyle border
- restyle month & date size & spacing
- increase font size for title
- add "0 going" placeholder to prevent jumpiness when invitees are rendered
  • Loading branch information
jjaffeux committed Nov 8, 2024
1 parent 55004c2 commit c4f6eba
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import { applyLocalDates } from "discourse/lib/local-dates";
import { cook } from "discourse/lib/text";
import icon from "discourse-common/helpers/d-icon";
import guessDateFormat from "../../lib/guess-best-date-format";

export default class DiscoursePostEventDates extends Component {
Expand Down Expand Up @@ -79,6 +80,6 @@ export default class DiscoursePostEventDates extends Component {
<section
class="event__section event-dates"
{{didInsert this.computeDates}}
>{{this.htmlDates}}</section>
>{{icon "far-clock"}}{{this.htmlDates}}</section>
</template>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Component from "@glimmer/component";
import { hash } from "@ember/helper";
import { service } from "@ember/service";
import { modifier } from "ember-modifier";
import { or } from "truth-helpers";
import PluginOutlet from "discourse/components/plugin-outlet";
import concatClass from "discourse/helpers/concat-class";
import replaceEmoji from "discourse/helpers/replace-emoji";
Expand Down Expand Up @@ -108,12 +109,6 @@ export default class DiscoursePostEvent extends Component {
/>
</header>

{{#if @event.canUpdateAttendance}}
<section class="event__section event-actions">
<Status @event={{@event}} />
</section>
{{/if}}

<PluginOutlet
@name="discourse-post-event-info"
@outletArgs={{hash
Expand All @@ -122,11 +117,22 @@ export default class DiscoursePostEvent extends Component {
Url=(component Url url=@event.url)
Dates=(component Dates event=@event)
Invitees=(component Invitees event=@event)
Status=(component Status event=@event)
}}
>
<Url @url={{@event.url}} />
{{#if
(or
@event.watchingInvitee.isGoing
@event.watchingInvitee.isInterested
)
}}
<Url @url={{@event.url}} />
{{/if}}
<Dates @event={{@event}} />
<Invitees @event={{@event}} />
{{#if @event.canUpdateAttendance}}
<Status @event={{@event}} />
{{/if}}
</PluginOutlet>
{{/if}}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Component from "@glimmer/component";
import { action } from "@ember/object";
import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
import icon from "discourse-common/helpers/d-icon";
import i18n from "discourse-common/helpers/i18n";
import PostEventInvitees from "../modal/post-event-invitees";
import Invitee from "./invitee";
Expand Down Expand Up @@ -70,11 +71,22 @@ export default class DiscoursePostEventInvitees extends Component {
@action={{this.showAllInvitees}}
/>
</div>
<ul class="event-invitees-avatars">
{{#each @event.sampleInvitees as |invitee|}}
<Invitee @invitee={{invitee}} />
{{/each}}
</ul>
<div class="event-invitees-avatars-container">
{{icon "users"}}
<ul class="event-invitees-avatars">
{{#each @event.sampleInvitees as |invitee|}}
<Invitee @invitee={{invitee}} />
{{/each}}
</ul>
</div>
</section>
{{else}}
<section class="event__section no-rsvp">
<div class="header">
<div class="event-invitees-status">
<p class="no-rsvp-description">0 going</p>
</div>
</div>
</section>
{{/if}}
{{/unless}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ export default class DiscoursePostEventStatus extends Component {
}

<template>
<div
<section
class={{concatClass
"event-status"
"event__section event-actions event-status"
(if
this.watchingInviteeStatus
(concat "status-" this.watchingInviteeStatus)
Expand Down Expand Up @@ -177,6 +177,6 @@ export default class DiscoursePostEventStatus extends Component {
{{/unless}}
{{/if}}
</PluginOutlet>
</div>
</section>
</template>
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ export default class DiscoursePostEventInvitee {
this.user = this.#initUserModel(args.user);
}

isGoing() {
return this.status === "going";
}

isInterested() {
return this.status === "interested";
}

isNotGoing() {
return this.status === "not_going";
}

#initUserModel(user) {
if (!user || user instanceof User) {
return user;
Expand Down
Loading

0 comments on commit c4f6eba

Please sign in to comment.