Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX: Events UI Edits #641

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -76,9 +77,7 @@ export default class DiscoursePostEventDates extends Component {
}

<template>
<section
class="event__section event-dates"
{{didInsert this.computeDates}}
>{{this.htmlDates}}</section>
<section class="event__section event-dates" {{didInsert this.computeDates}}>
{{icon "clock"}}{{this.htmlDates}}</section>
</template>
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ export default class DiscoursePostEvent extends Component {
return this.currentUser && this.args.event.can_act_on_discourse_post_event;
}

get watchingInviteeStatus() {
return this.args.event.watchingInvitee?.status;
}

<template>
<div
class={{concatClass
Expand Down Expand Up @@ -108,12 +112,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 +120,15 @@ export default class DiscoursePostEvent extends Component {
Url=(component Url [email protected])
Dates=(component Dates event=@event)
Invitees=(component Invitees event=@event)
Status=(component Status event=@event)
}}
>
<Url @url={{@event.url}} />
<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,21 @@ 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 event-invitees no-rsvp">
<p class="no-rsvp-description">{{i18n
"discourse_post_event.models.invitee.status.going_count.other"
count="0"
}}</p>
</section>
{{/if}}
{{/unless}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export default class DiscoursePostEventStatus extends Component {
@service discoursePostEventApi;
@service siteSettings;

get watchingInviteeStatus() {
return this.args.event.watchingInvitee?.status;
}

get eventButtons() {
return this.siteSettings.event_participation_buttons.split("|");
}
Expand All @@ -36,6 +32,10 @@ export default class DiscoursePostEventStatus extends Component {
return this.args.event.watchingInvitee && this.args.event.isPublic;
}

get watchingInviteeStatus() {
return this.args.event.watchingInvitee?.status;
}

@action
async leaveEvent() {
try {
Expand Down 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 @@ -123,7 +123,7 @@
<GroupSelector
@fullWidthWrap={{true}}
@groupFinder={{this.groupFinder}}
@groupNames={{@model.event.raw_invitees}}
@groupNames={{@model.event.rawInvitees}}
@onChangeCallback={{this.setRawInvitees}}
@placeholderKey="topic.invite_private.group_name"
/>
Expand Down Expand Up @@ -232,7 +232,7 @@
<Input
class="custom-field-input"
@value={{readonly
(get @model.event.custom_fields allowedCustomField)
(get @model.event.customFields allowedCustomField)
}}
placeholder={{i18n
"discourse_post_event.builder_modal.custom_fields.placeholder"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default class PostEventBuilder extends Component {

@action
setCustomField(field, e) {
this.event[field] = e.target.value;
this.event.customFields[field] = e.target.value;
}

@action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default class DiscoursePostEventEvent {
@tracked rawInvitees;
@tracked url;
@tracked timezone;
@tracked status;
@tracked post;
@tracked minimal;
@tracked canUpdateAttendance;
Expand Down
Loading