-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<DModal | ||
class="add-event-modal" | ||
@title={{this.title}} | ||
@closeModal={{@closeModal}} | ||
@flash={{this.flash}} | ||
> | ||
<:body> | ||
{{event-form | ||
event=model.event | ||
updateEvent=(action 'updateEvent')}} | ||
</:body> | ||
<:footer> | ||
{{d-button action=(action "saveEvent") class="btn-primary" label="add_event.event_add"}} | ||
<a href class="clear" {{on "click" (fn this.clear)}}>{{i18n 'add_event.event_clear'}}</a> | ||
</:footer> | ||
</DModal> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import buildCategoryRoute from "discourse/routes/build-category-route"; | ||
import buildTopicRoute from "discourse/routes/build-topic-route"; | ||
import { calendarRange } from "../lib/date-utilities"; | ||
|
||
export default function buildCalendarRoute(routeConfig) { | ||
const klass = routeConfig.type === 'category' ? | ||
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 6 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
|
||
buildCategoryRoute({ filter: 'calendar' }) : | ||
buildTopicRoute('calendar'); | ||
|
||
return class extends klass { | ||
templateName = "discovery/calendar"; | ||
|
||
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 12 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
|
||
beforeModel(transition) { | ||
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 13 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
|
||
super.beforeModel(...arguments); | ||
const routeName = this.routeName; | ||
const queryParams = this.paramsFor(routeName); | ||
|
||
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 17 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
|
||
if (!queryParams.start || !queryParams.end) { | ||
const month = moment().month(); | ||
const year = moment().year(); | ||
const { start, end } = calendarRange(month, year); | ||
this.setProperties({ start, end }); | ||
} | ||
} | ||
|
||
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 25 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
|
||
setupController(controller, model) { | ||
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 26 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
|
||
super.setupController(...arguments); | ||
const start = this.get("start"); | ||
const end = this.get("end"); | ||
|
||
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 30 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
|
||
if (start || end) { | ||
let initialDateRange = {}; | ||
if (start) { | ||
initialDateRange["start"] = start; | ||
} | ||
if (end) { | ||
initialDateRange["end"] = end; | ||
} | ||
|
||
const controllerName = this.routeConfig.type === "category" ? | ||
"discovery.calendarCategory" : | ||
"discovery.calendar"; | ||
this.controllerFor(controllerName).setProperties({ | ||
initialDateRange, | ||
}); | ||
} | ||
} | ||
} | ||
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
Check failure on line 48 in assets/javascripts/discourse/routes/build-calendar-route.js GitHub Actions / ci / linting
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import buildCalendarRoute from "./build-calendar-route"; | ||
|
||
export default class DiscoveryCalendarCategory extends buildCalendarRoute({ type: "category" }) { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import buildCalendarRoute from "./build-calendar-route"; | ||
|
||
export default class DiscoveryCategory extends buildCalendarRoute({ type: "topic" }) { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,45 @@ | ||
{{events-calendar | ||
topics=model.topics | ||
category=category | ||
loading=discovery.loading | ||
initialDateRange=initialDateRange}} | ||
<Discovery::Layout | ||
@model={{this.model}} | ||
@createTopicDisabled={{this.createTopicDisabled}} | ||
> | ||
<:navigation> | ||
<Discovery::Navigation | ||
@category={{this.model.category}} | ||
@tag={{this.model.tag}} | ||
@additionalTags={{this.model.additionalTags}} | ||
@filterType={{this.model.filterType}} | ||
@noSubcategories={{this.model.noSubcategories}} | ||
@canBulkSelect={{this.canBulkSelect}} | ||
@bulkSelectHelper={{this.bulkSelectHelper}} | ||
@createTopic={{this.createTopic}} | ||
@createTopicDisabled={{this.createTopicDisabled}} | ||
@canCreateTopicOnTag={{this.model.canCreateTopicOnTag}} | ||
@toggleTagInfo={{this.toggleTagInfo}} | ||
@tagNotification={{this.model.tagNotification}} | ||
@model={{this.model.list}} | ||
@showDismissRead={{this.showDismissRead}} | ||
@showResetNew={{this.showResetNew}} | ||
@dismissRead={{this.dismissRead}} | ||
@resetNew={{this.resetNew}} | ||
/> | ||
</:navigation> | ||
|
||
<:header> | ||
{{#if this.model.subcategoryList}} | ||
<Discovery::CategoriesDisplay | ||
@categories={{this.model.subcategoryList.categories}} | ||
@parentCategory={{this.model.subcategoryList.parentCategory}} | ||
/> | ||
{{/if}} | ||
{{#if (and this.showTagInfo this.model.tag)}} | ||
<TagInfo @tag={{this.model.tag}} @list={{this.model.list}} /> | ||
{{/if}} | ||
</:header> | ||
<:list> | ||
{{events-calendar | ||
topics=model.list.topics | ||
category=model.category | ||
loading=discovery.loading | ||
initialDateRange=initialDateRange}} | ||
</:list> | ||
</Discovery::Layout> |
This file was deleted.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# frozen_string_literal: true | ||
# name: discourse-events | ||
# about: Allows you to manage events in Discourse | ||
# version: 0.2.11 | ||
# version: 0.3.0 | ||
# authors: Angus McLeod | ||
# contact_emails: [email protected] | ||
# url: https://github.com/paviliondev/discourse-events | ||
|
@@ -12,6 +12,7 @@ | |
register_asset 'stylesheets/common/admin.scss' | ||
register_asset 'stylesheets/desktop/events.scss', :desktop | ||
register_asset 'stylesheets/mobile/events.scss', :mobile | ||
register_asset 'lib/jquery-3.7.1.min.js' | ||
register_asset 'lib/jquery.timepicker.min.js' | ||
register_asset 'lib/jquery.timepicker.scss' | ||
|
||
|