This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/plugins/styleguide/assets/javascripts/discourse/routes/styleguide-show.js
Jarek Radosz 4ad77f3382
DEV: Remove .es6 extensions from core (#14912)
Still supported in plugins though.
2021-11-13 12:51:53 +01:00

29 lines
650 B
JavaScript

import {
findNote,
sectionById,
} from "discourse/plugins/styleguide/discourse/lib/styleguide";
import { createData } from "discourse/plugins/styleguide/discourse/lib/dummy-data";
export default Ember.Route.extend({
model(params) {
return sectionById(params.section);
},
setupController(controller, section) {
let note = findNote(section);
controller.setProperties({
section,
note,
dummy: createData(this.store),
});
},
renderTemplate(controller, section) {
this.render("styleguide.show");
this.render(`styleguide/${section.templateName}`, {
into: "styleguide.show",
});
},
});