mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
Specify default categories for new documents
Closes #339 All new documents will be assigned default categories. Documents created from templates that already have categories take precedence.
This commit is contained in:
parent
5c1ad25dc9
commit
f117e91bcb
18 changed files with 1284 additions and 1134 deletions
|
@ -24,6 +24,7 @@ export default Component.extend(ModalMixin, Notifer, {
|
|||
store: service(),
|
||||
editId: '',
|
||||
editName: '',
|
||||
editDefault: false,
|
||||
deleteId: '',
|
||||
newCategory: '',
|
||||
|
||||
|
@ -127,6 +128,7 @@ export default Component.extend(ModalMixin, Notifer, {
|
|||
let cat = this.get('category').findBy('id', id);
|
||||
this.set('editId', cat.get('id'));
|
||||
this.set('editName', cat.get('category'));
|
||||
this.set('editDefault', cat.get('isDefault'));
|
||||
|
||||
this.modalOpen('#category-edit-modal', {show: true}, "#edit-category-id");
|
||||
},
|
||||
|
@ -155,6 +157,7 @@ export default Component.extend(ModalMixin, Notifer, {
|
|||
|
||||
let cat = this.get('category').findBy('id', this.get('editId'));
|
||||
cat.set('category', name);
|
||||
cat.set('isDefault', this.get('editDefault'));
|
||||
|
||||
this.modalClose('#category-edit-modal');
|
||||
$('#edit-category-name').removeClass('is-invalid');
|
||||
|
|
|
@ -16,6 +16,7 @@ export default Model.extend({
|
|||
orgId: attr('string'),
|
||||
spaceId: attr('string'),
|
||||
category: attr('string'),
|
||||
isDefault: attr('boolean'),
|
||||
created: attr(),
|
||||
revised: attr(),
|
||||
|
||||
|
|
|
@ -55,6 +55,11 @@
|
|||
<div class="form-group">
|
||||
{{focus-input id="edit-category-name" type="text" class="form-control mousetrap" placeholder="Category name" value=editName}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Default</label>
|
||||
{{x-toggle value=editDefault size="medium" theme="light" onToggle=(action (mut editDefault))}}
|
||||
<small class="form-text text-muted">Automatically aplies to newly created documents</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{{ui/ui-button color=constants.Color.Gray light=true label=constants.Label.Close dismiss=true}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue