Skip to content

Commit

Permalink
DEV: control whitespace, remove hack (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomerobot committed May 31, 2024
1 parent 70437a4 commit 196646e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 6 additions & 6 deletions assets/javascripts/discourse/components/event-date.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export default class EventDate extends Component {
@service siteSettings;

<template>
{{#if this.shouldRender}}
{{~#if this.shouldRender~}}
<span class="header-topic-title-suffix-outlet event-date-container">
{{#if this.siteSettings.use_local_event_date}}
{{~#if this.siteSettings.use_local_event_date~}}
<span
class="event-date event-local-date past"
title={{this.dateRange}}
Expand All @@ -25,16 +25,16 @@ export default class EventDate extends Component {
data-starts-at={{this.eventStartedAt}}
data-ends-at={{this.eventEndedAt}}
>
{{#if this.isWithinDateRange}}
{{~#if this.isWithinDateRange~}}
<span class="indicator"></span>
<span class="text">{{this.timeRemainingContent}}</span>
{{else}}
{{this.relativeDateContent}}
{{/if}}
{{~/if~}}
</span>
{{/if}}
{{~/if~}}
</span>
{{/if}}
{{~/if~}}
</template>

get shouldRender() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#if context.siteSettings.discourse_post_event_enabled}}
{{#if context.topic.event_starts_at}}
{{~#if context.siteSettings.discourse_post_event_enabled~}}
{{~#if context.topic.event_starts_at~}}
{{~raw "event-date-container" topic=context.topic~}}
{{/if}}
{{/if}}
{{~/if~}}
{{~/if~}}
2 changes: 0 additions & 2 deletions assets/stylesheets/common/discourse-post-event-core-ext.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
.event-date-container-wrapper {
// prevents new dot from breaking separately onto next line
white-space: nowrap;
// hack to hide extra whitespace in event-relative-date
margin-right: -0.25em;
}
}

Expand Down

0 comments on commit 196646e

Please sign in to comment.