Skip to content

Commit

Permalink
Adds plugin outlet to events list
Browse files Browse the repository at this point in the history
  • Loading branch information
brrusselburg committed Aug 22, 2024
1 parent 8ca687e commit c1c5a1f
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions assets/javascripts/discourse/components/upcoming-events-list.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { LinkTo } from "@ember/routing";
import { inject as service } from "@ember/service";
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
import DButton from "discourse/components/d-button";
import PluginOutlet from "discourse/components/plugin-outlet";
import { ajax } from "discourse/lib/ajax";
import I18n from "discourse-i18n";
import or from "truth-helpers/helpers/or";
Expand Down Expand Up @@ -161,35 +162,37 @@ export default class UpcomingEventsList extends Component {
{{/if}}

{{#unless this.isLoading}}
{{#each-in this.eventsByMonth as |month monthData|}}
{{#if this.monthFormat}}
<h4 class="upcoming-events-list__formatted-month">
{{this.formatMonth month}}
</h4>
{{/if}}

{{#each-in monthData as |day events|}}
<div class="upcoming-events-list__day-section">
<div class="upcoming-events-list__formatted-day">
{{this.formatDate month day}}
<PluginOutlet @name="upcoming-events-list-container">
{{#each-in this.eventsByMonth as |month monthData|}}
{{#if this.monthFormat}}
<h4 class="upcoming-events-list__formatted-month">
{{this.formatMonth month}}
</h4>
{{/if}}

{{#each-in monthData as |day events|}}
<div class="upcoming-events-list__day-section">
<div class="upcoming-events-list__formatted-day">
{{this.formatDate month day}}
</div>

{{#each events as |event|}}
<a
class="upcoming-events-list__event"
href={{event.post.url}}
>
<div class="upcoming-events-list__event-time">
{{this.formatTime event}}
</div>
<div class="upcoming-events-list__event-name">
{{or event.name event.post.topic.title}}
</div>
</a>
{{/each}}
</div>

{{#each events as |event|}}
<a
class="upcoming-events-list__event"
href={{event.post.url}}
>
<div class="upcoming-events-list__event-time">
{{this.formatTime event}}
</div>
<div class="upcoming-events-list__event-name">
{{or event.name event.post.topic.title}}
</div>
</a>
{{/each}}
</div>
{{/each-in}}
{{/each-in}}
{{/each-in}}
</PluginOutlet>
{{/unless}}
</div>

Expand Down

0 comments on commit c1c5a1f

Please sign in to comment.