Add posts to this collection one by one through post settings menu.
+ {{/if}}
+
+
+
+
+
diff --git a/ghost/admin/app/components/collections/collection-form.js b/ghost/admin/app/components/collections/collection-form.js
new file mode 100644
index 0000000000..bb545cd807
--- /dev/null
+++ b/ghost/admin/app/components/collections/collection-form.js
@@ -0,0 +1,65 @@
+import Component from '@glimmer/component';
+import {action} from '@ember/object';
+import {inject} from 'ghost-admin/decorators/inject';
+import {inject as service} from '@ember/service';
+import {slugify} from '@tryghost/string';
+
+const TYPES = [{
+ name: 'Manual',
+ value: 'manual'
+}, {
+ name: 'Automatic',
+ value: 'automatic'
+}];
+
+export default class CollectionForm extends Component {
+ @service feature;
+ @service settings;
+
+ @inject config;
+
+ availableTypes = TYPES;
+
+ get selectedType() {
+ const {collection} = this.args;
+ return this.availableTypes.findBy('value', collection.type) || {value: '!unknown'};
+ }
+
+ @action
+ setCollectionProperty(property, newValue) {
+ const {collection} = this.args;
+
+ if (newValue) {
+ newValue = newValue.trim();
+ }
+
+ // Generate slug based on name for new collection when empty
+ if (property === 'title' && collection.isNew && !this.hasChangedSlug) {
+ let slugValue = slugify(newValue);
+ if (/^#/.test(newValue)) {
+ slugValue = 'hash-' + slugValue;
+ }
+ collection.slug = slugValue;
+ }
+
+ // ensure manual changes of slug don't get reset when changing name
+ if (property === 'slug') {
+ this.hasChangedSlug = !!newValue;
+ }
+
+ collection[property] = newValue;
+
+ // clear validation message when typing
+ collection.hasValidated.addObject(property);
+ }
+
+ @action
+ changeType(type) {
+ this.setCollectionProperty('type', type.value);
+ }
+
+ @action
+ validateCollectionProperty(property) {
+ return this.args.collection.validate({property});
+ }
+}
diff --git a/ghost/admin/app/components/collections/delete-collection-modal.hbs b/ghost/admin/app/components/collections/delete-collection-modal.hbs
new file mode 100644
index 0000000000..c1c6abe9ca
--- /dev/null
+++ b/ghost/admin/app/components/collections/delete-collection-modal.hbs
@@ -0,0 +1,19 @@
+
+
+
Are you sure you want to delete this collection?
+
+
+
+
+ {{#if @data.collection.count.posts}}
+ This collection is attached to {{gh-pluralize @data.collection.count.posts "post"}}.
+ {{/if}}
+ You're about to delete "{{@data.collection.title}}". This is permanent! We warned you, k?
+