mirror of
https://github.com/documize/community.git
synced 2025-08-10 07:55:25 +02:00
allow for documents with NO SECTIONS
this is by design!
This commit is contained in:
parent
44ad9da1d7
commit
fd494b53c8
3 changed files with 15 additions and 15 deletions
|
@ -36,7 +36,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
noSections: Ember.computed('pages', function() {
|
noSections: Ember.computed('pages', function() {
|
||||||
return this.get('pages.length') === 1;
|
return this.get('pages.length') === 0;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
|
@ -159,4 +159,4 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
this.get('documentService').save(doc);
|
this.get('documentService').save(doc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -200,9 +200,8 @@ func GetDocumentPages(w http.ResponseWriter, r *http.Request) {
|
||||||
pages, err = p.GetPages(documentID)
|
pages, err = p.GetPages(documentID)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err == sql.ErrNoRows {
|
if len(pages) == 0 {
|
||||||
writeNotFoundError(w, method, documentID)
|
pages = []entity.Page{}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||||
//
|
//
|
||||||
// This software (Documize Community Edition) is licensed under
|
// This software (Documize Community Edition) is licensed under
|
||||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||||
//
|
//
|
||||||
// You can operate outside the AGPL restrictions by purchasing
|
// You can operate outside the AGPL restrictions by purchasing
|
||||||
// Documize Enterprise Edition and obtaining a commercial license
|
// Documize Enterprise Edition and obtaining a commercial license
|
||||||
// by contacting <sales@documize.com>.
|
// by contacting <sales@documize.com>.
|
||||||
//
|
//
|
||||||
// https://documize.com
|
// https://documize.com
|
||||||
|
|
||||||
|
@ -181,21 +181,22 @@ func StartDocumentFromSavedTemplate(w http.ResponseWriter, r *http.Request) {
|
||||||
// Define an empty document just in case user wanted one.
|
// Define an empty document just in case user wanted one.
|
||||||
var err error
|
var err error
|
||||||
var d = entity.Document{}
|
var d = entity.Document{}
|
||||||
d.Title = "Empty Document"
|
d.Title = "New Document"
|
||||||
d.Location = fmt.Sprintf("template-%s", templateID)
|
d.Location = fmt.Sprintf("template-%s", templateID)
|
||||||
d.Excerpt = "Created from template"
|
d.Excerpt = "A new document"
|
||||||
d.Slug = utility.MakeSlug(d.Title)
|
d.Slug = utility.MakeSlug(d.Title)
|
||||||
d.Tags = ""
|
d.Tags = ""
|
||||||
d.LabelID = folderID
|
d.LabelID = folderID
|
||||||
documentID := util.UniqueID()
|
documentID := util.UniqueID()
|
||||||
d.RefID = documentID
|
d.RefID = documentID
|
||||||
|
|
||||||
var pages = make([]entity.Page, 1, 1)
|
var pages = []entity.Page{}
|
||||||
pages[0] = entity.Page{}
|
//var pages = make([]entity.Page, 1, 1)
|
||||||
pages[0].Title = "Heading"
|
//pages[0] = entity.Page{}
|
||||||
pages[0].Body = "<p>Some content here.</p>"
|
//pages[0].Title = "Heading"
|
||||||
pages[0].Level = 1
|
//pages[0].Body = "<p>Some content here.</p>"
|
||||||
pages[0].Sequence = 1
|
//pages[0].Level = 1
|
||||||
|
//pages[0].Sequence = 1
|
||||||
|
|
||||||
var attachments = []entity.Attachment{}
|
var attachments = []entity.Attachment{}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue