mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Fixed slug-based navigation in collections UI
refs https://github.com/TryGhost/Team/issues/3169 - When navigating through collections slugs did not display correctly returning "undefined" in the navigation. It was easier to fix the bug than working around it.
This commit is contained in:
parent
2173fd9ef9
commit
7d4b278a83
3 changed files with 13 additions and 3 deletions
|
@ -14,6 +14,16 @@
|
||||||
</span>
|
</span>
|
||||||
</GhFormGroup>
|
</GhFormGroup>
|
||||||
|
|
||||||
|
<GhFormGroup @errors={{@collection.errors}} @hasValidated={{@collection.hasValidated}} @property="slug" class="mr2 flex-auto">
|
||||||
|
<label for="collection-slug">Slug</label>
|
||||||
|
<input type="text" class="gh-input" id="collection-slug" name="slug" value={{@collection.slug}} {{on "input" (pick "target.value"
|
||||||
|
(fn this.setCollectionProperty "slug" ))}} {{on "blur" (fn this.validateCollectionProperty "slug" )}}
|
||||||
|
data-test-input="collection-slug" />
|
||||||
|
<span class="error">
|
||||||
|
<GhErrorMessage @errors={{@collection.errors}} @property="slug" />
|
||||||
|
</span>
|
||||||
|
</GhFormGroup>
|
||||||
|
|
||||||
<GhFormGroup class="no-margin" @errors={{@collection.errors}} @hasValidated={{@collection.hasValidated}}
|
<GhFormGroup class="no-margin" @errors={{@collection.errors}} @hasValidated={{@collection.hasValidated}}
|
||||||
@property="description">
|
@property="description">
|
||||||
<label for="collection-description">Description</label>
|
<label for="collection-description">Description</label>
|
||||||
|
|
|
@ -51,8 +51,8 @@ Router.map(function () {
|
||||||
this.route('tag', {path: '/tags/:tag_slug'});
|
this.route('tag', {path: '/tags/:tag_slug'});
|
||||||
|
|
||||||
this.route('collections');
|
this.route('collections');
|
||||||
this.route('collection.new', {path: '/collection/new'});
|
this.route('collection.new', {path: '/collections/new'});
|
||||||
this.route('collection', {path: '/collection/:collection_slug'});
|
this.route('collection', {path: '/collections/:collection_slug'});
|
||||||
|
|
||||||
this.route('settings-x');
|
this.route('settings-x');
|
||||||
this.route('settings');
|
this.route('settings');
|
||||||
|
|
|
@ -27,7 +27,7 @@ export default class CollectionRoute extends AuthenticatedRoute {
|
||||||
}
|
}
|
||||||
|
|
||||||
serialize(collection) {
|
serialize(collection) {
|
||||||
return {collection_slug: collection.get('collection')};
|
return {collection_slug: collection.get('slug')};
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
Loading…
Add table
Reference in a new issue