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

document name separated from document first page, moved attachments and tags

This commit is contained in:
Harvey Kandola 2016-06-21 16:33:53 -07:00
parent 55630067bc
commit 44ad9da1d7
7 changed files with 73 additions and 59 deletions

View file

@ -54,7 +54,6 @@
}
.document-tags {
margin: 10px 0;
}
.is-template {

View file

@ -27,7 +27,7 @@
color: $color-white;
padding: 0.5em;
font-size: 0.8em;
line-height: 1.0em;
line-height: 1.1em;
&:before {
content: "";
display: block;

View file

@ -48,7 +48,7 @@
<i class="material-icons">content_copy</i>
</div>
<div class="button-gap"></div>
<div class="square-button button-gray" id="set-meta-button" data-tooltip="Set owner & excerpt" data-tooltip-position="top center">
<div class="square-button button-gray" id="set-meta-button" data-tooltip="Set owner, title, excerpt" data-tooltip-position="top center">
<i class="material-icons">person</i>
</div>
<div class="button-gap"></div>
@ -69,7 +69,7 @@
</div>
</div>
{{/dropdown-dialog}}
{{#dropdown-dialog target="set-meta-button" position="bottom right" button="Save" color="flat-blue" onAction=(action 'saveMeta') selectOn="meta-excerpt"}}
{{#dropdown-dialog target="set-meta-button" position="bottom right" button="Save" color="flat-blue" onAction=(action 'saveMeta') selectOn="document-name"}}
<div>
<div class="input-control">
<label>Owner</label>
@ -81,6 +81,11 @@
optionLabelPath="fullname"
selection=owner}}
</div>
<div class="input-control">
<label>Name</label>
<div class="tip">Short title for this document</div>
{{input type='text' id="document-name" value=document.name}}
</div>
<div class="input-control">
<label>Excerpt</label>
<div class="tip">Provide short summary of the document (max. 250)</div>

View file

@ -1,20 +1,8 @@
<div class="document-container">
<div class="content">
<div class="pages">
{{#each pages key="id" as |page index|}}
<div class="wysiwyg">
<div id="page-{{ page.id }}" class="is-a-page" data-id="{{ page.id }}" data-type="{{ page.contentType }}">
{{document/page-heading tagName=page.tagName document=document folder=folder page=page isEditor=isEditor onDeletePage=(action 'onDeletePage') }}
{{#if page.firstPage }}
{{#if document.template}}
<div class="is-template">TEMPLATE</div>
{{/if}}
<div class="document-summary">
{{document/tag-editor documentTags=document.tags isEditor=isEditor onChange=(action 'onTagChange')}}
</div>
{{#if attachments}}
<div class="attachment-zone">
@ -36,7 +24,17 @@
</div>
{{/if}}
</div>
<div class="pages">
{{#each pages key="id" as |page index|}}
<div class="wysiwyg">
<div id="page-{{ page.id }}" class="is-a-page" data-id="{{ page.id }}" data-type="{{ page.contentType }}">
{{document/page-heading tagName=page.tagName document=document folder=folder page=page isEditor=isEditor onDeletePage=(action 'onDeletePage') }}
{{#if page.firstPage }}
{{#if document.template}}
<div class="is-template">TEMPLATE</div>
{{/if}}
{{/if}}
{{section/base-renderer page=page}}
</div>

View file

@ -30,7 +30,7 @@ const (
// AppVersion does what it says
// Versioning scheme major.minor where "minor" is optional
// e.g. 1, 2, 3, 4.1, 4.2, 5, 6, 7, 7.1, 8, 9, 10, ..... 127, 127.1, 128
AppVersion = "12.6"
AppVersion = "12.7"
)
var port, certFile, keyFile, forcePort2SSL string

View file

@ -14,6 +14,7 @@ package entity
import (
"fmt"
"strings"
"time"
)
@ -152,6 +153,15 @@ type Document struct {
Template bool `json:"template"`
}
// SetDefaults ensures on blanks and cleans.
func (d *Document) SetDefaults() {
d.Title = strings.TrimSpace(d.Title)
if len(d.Title) == 0 {
d.Title = "Document"
}
}
// Attachment represents an attachment to a document.
type Attachment struct {
BaseEntity
@ -183,6 +193,8 @@ func (p *Page) SetDefaults() {
if len(p.ContentType) == 0 {
p.ContentType = "wysiwyg"
}
p.Title = strings.TrimSpace(p.Title)
}
// PageMeta holds raw page data that is used to

View file

@ -255,35 +255,35 @@ func (p *Persister) UpdatePage(page entity.Page, refID, userID string, skipRevis
}
}
if page.Level == 1 { // may need to update the document name
var doc entity.Document
//if page.Level == 1 { // may need to update the document name
//var doc entity.Document
stmt4, err := p.Context.Transaction.Preparex("SELECT id, refid, orgid, labelid, job, location, title, excerpt, slug, tags, template, created, revised FROM document WHERE refid=?")
defer utility.Close(stmt4)
//stmt4, err := p.Context.Transaction.Preparex("SELECT id, refid, orgid, labelid, job, location, title, excerpt, slug, tags, template, created, revised FROM document WHERE refid=?")
//defer utility.Close(stmt4)
if err != nil {
log.Error(fmt.Sprintf("Unable to prepare pagemanager doc query for Id %s", page.DocumentID), err)
return err
}
//if err != nil {
//log.Error(fmt.Sprintf("Unable to prepare pagemanager doc query for Id %s", page.DocumentID), err)
//return err
//}
err = stmt4.Get(&doc, page.DocumentID)
//err = stmt4.Get(&doc, page.DocumentID)
if err != nil {
log.Error(fmt.Sprintf("Unable to execute pagemanager document query for Id %s", page.DocumentID), err)
return err
}
//if err != nil {
//log.Error(fmt.Sprintf("Unable to execute pagemanager document query for Id %s", page.DocumentID), err)
//return err
//}
if doc.Title != page.Title {
doc.Title = page.Title
doc.Revised = page.Revised
err = p.UpdateDocument(doc)
//if doc.Title != page.Title {
//doc.Title = page.Title
//doc.Revised = page.Revised
//err = p.UpdateDocument(doc)
if err != nil {
log.Error(fmt.Sprintf("Unable to update document when page 1 altered DocumentId %s", page.DocumentID), err)
return err
}
}
}
//if err != nil {
//log.Error(fmt.Sprintf("Unable to update document when page 1 altered DocumentId %s", page.DocumentID), err)
//return err
//}
//}
//}
p.Base.Audit(p.Context, "update-page", page.DocumentID, page.RefID)