mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 23:03:55 +08:00
3fe8cc811c
Followup to b53449eac9
,
it was too easy to add broken routes which would break
configuration for the whole site, so now we validate ember
routes on save.
46 lines
1.4 KiB
Handlebars
46 lines
1.4 KiB
Handlebars
<div
|
|
class="admin-config-area-sidebar-experiment"
|
|
{{did-insert this.loadDefaultNavConfig}}
|
|
>
|
|
<h4>Sidebar Experiment</h4>
|
|
<p>Changes you make here will be applied to the admin sidebar and persist
|
|
between reloads
|
|
<em>on this device only</em>. Note that in addition to the
|
|
<code>text</code>
|
|
and
|
|
<code>route</code>
|
|
options, you can also specify a
|
|
<code>icon</code>
|
|
or a
|
|
<code>href</code>, if you want to link to a specific page but don't know the
|
|
Ember route. You can also use the Ember Inspector extension to find route
|
|
names, for example for plugin routes which are not auto-generated here.
|
|
<br /><br />
|
|
<code>routeModels</code>
|
|
is an array of values that correspond to parts of the route; for example the
|
|
topic route may be
|
|
<code>/t/:id</code>, so to get a link to topic with ID 123 you would do
|
|
<code>routeModels: [123]</code>.</p>
|
|
|
|
<p>All configuration options for a section and its links looks like this:</p>
|
|
|
|
<pre><code>{{this.exampleJson}}</code></pre>
|
|
|
|
<DButton
|
|
@action={{this.resetToDefault}}
|
|
@translatedLabel="Reset to Default"
|
|
/>
|
|
<DButton
|
|
class="btn-primary"
|
|
@action={{this.applyConfig}}
|
|
@translatedLabel="Apply Config"
|
|
/>
|
|
|
|
<div class="admin-config-area-sidebar-experiment__editor">
|
|
<AceEditor
|
|
@content={{this.editedNavConfig}}
|
|
@editorId="admin-config-area-sidebar-experiment"
|
|
@save={{this.applyNav}}
|
|
/>
|
|
</div>
|
|
</div> |