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

FIX: Calendar disappears from view when changing category view #423

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
5 changes: 5 additions & 0 deletions app/controllers/calendar_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class CalendarController < ::ApplicationController
def index
render json: {}
end
end
5 changes: 5 additions & 0 deletions assets/javascripts/discourse/calendar-category-route-map.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function () {
this.route("calendar-category", {
path: "/c/*category_slug_path_with_id/l/calendar",
});
}
7 changes: 7 additions & 0 deletions assets/javascripts/discourse/controllers/calendar-category.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Controller from "@ember/controller";


export default Controller.extend({

});

7 changes: 7 additions & 0 deletions assets/javascripts/discourse/routes/calendar-category.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Route from "@ember/routing/route";

export default Route.extend({
model() {

},
});
3 changes: 3 additions & 0 deletions assets/javascripts/discourse/templates/calendar-category.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h3>
{{"Hola"}}
</h3>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

{{log 'outlet'}}
{{log @outletArgs}}
{{log 'outlet'}}

{{log @outletArgs.model}}
{{log @outletArgs.target}}

<p>This is it</p>
{{!-- <NavigationItem
@content= {{hash }}
@filterMode={{this.filterMode}}
@category={{this.category}}
@class={{concat "nav-item_" navItem.name}}
/> --}}
5 changes: 5 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# frozen_string_literal: true
Discourse::Application.routes.prepend do
get "/c/*category_slug_path_with_id/l/calendar" => "calendar#index"
end

Discourse::Application.routes.draw do
mount ::DiscourseCalendar::Engine, at: "/"
Expand All @@ -13,6 +16,7 @@
delete "/admin/discourse-calendar/holidays/enable" =>
"admin/discourse_calendar/admin_holidays#enable",
:constraints => StaffConstraint.new

end

DiscoursePostEvent::Engine.routes.draw do
Expand All @@ -28,6 +32,7 @@
get "/discourse-post-event/events/:post_id/invitees" => "invitees#index"
delete "/discourse-post-event/events/:post_id/invitees/:id" => "invitees#destroy"
get "/upcoming-events" => "upcoming_events#index"

end

Discourse::Application.routes.draw { mount ::DiscoursePostEvent::Engine, at: "/" }