1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-08 23:15:29 +02:00

allow for documents with NO SECTIONS

this is by design!
This commit is contained in:
Harvey Kandola 2016-06-21 21:01:19 -07:00
parent 44ad9da1d7
commit fd494b53c8
3 changed files with 15 additions and 15 deletions

View file

@ -36,7 +36,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
},
noSections: Ember.computed('pages', function() {
return this.get('pages.length') === 1;
return this.get('pages.length') === 0;
}),
didInsertElement() {

View file

@ -200,9 +200,8 @@ func GetDocumentPages(w http.ResponseWriter, r *http.Request) {
pages, err = p.GetPages(documentID)
}
if err == sql.ErrNoRows {
writeNotFoundError(w, method, documentID)
return
if len(pages) == 0 {
pages = []entity.Page{}
}
if err != nil {

View file

@ -181,21 +181,22 @@ func StartDocumentFromSavedTemplate(w http.ResponseWriter, r *http.Request) {
// Define an empty document just in case user wanted one.
var err error
var d = entity.Document{}
d.Title = "Empty Document"
d.Title = "New Document"
d.Location = fmt.Sprintf("template-%s", templateID)
d.Excerpt = "Created from template"
d.Excerpt = "A new document"
d.Slug = utility.MakeSlug(d.Title)
d.Tags = ""
d.LabelID = folderID
documentID := util.UniqueID()
d.RefID = documentID
var pages = make([]entity.Page, 1, 1)
pages[0] = entity.Page{}
pages[0].Title = "Heading"
pages[0].Body = "<p>Some content here.</p>"
pages[0].Level = 1
pages[0].Sequence = 1
var pages = []entity.Page{}
//var pages = make([]entity.Page, 1, 1)
//pages[0] = entity.Page{}
//pages[0].Title = "Heading"
//pages[0].Body = "<p>Some content here.</p>"
//pages[0].Level = 1
//pages[0].Sequence = 1
var attachments = []entity.Attachment{}