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:
parent
55630067bc
commit
44ad9da1d7
7 changed files with 73 additions and 59 deletions
|
@ -54,7 +54,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.document-tags {
|
.document-tags {
|
||||||
margin: 10px 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-template {
|
.is-template {
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
color: $color-white;
|
color: $color-white;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
line-height: 1.0em;
|
line-height: 1.1em;
|
||||||
&:before {
|
&:before {
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
<i class="material-icons">content_copy</i>
|
<i class="material-icons">content_copy</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-gap"></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>
|
<i class="material-icons">person</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-gap"></div>
|
<div class="button-gap"></div>
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/dropdown-dialog}}
|
{{/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>
|
||||||
<div class="input-control">
|
<div class="input-control">
|
||||||
<label>Owner</label>
|
<label>Owner</label>
|
||||||
|
@ -81,6 +81,11 @@
|
||||||
optionLabelPath="fullname"
|
optionLabelPath="fullname"
|
||||||
selection=owner}}
|
selection=owner}}
|
||||||
</div>
|
</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">
|
<div class="input-control">
|
||||||
<label>Excerpt</label>
|
<label>Excerpt</label>
|
||||||
<div class="tip">Provide short summary of the document (max. 250)</div>
|
<div class="tip">Provide short summary of the document (max. 250)</div>
|
||||||
|
|
|
@ -1,5 +1,29 @@
|
||||||
<div class="document-container">
|
<div class="document-container">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<div class="document-summary">
|
||||||
|
{{document/tag-editor documentTags=document.tags isEditor=isEditor onChange=(action 'onTagChange')}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{#if attachments}}
|
||||||
|
<div class="attachment-zone">
|
||||||
|
<ul class="list">
|
||||||
|
{{#each attachments key="id" as |a index|}}
|
||||||
|
<li class="item">
|
||||||
|
<img class="icon" src="assets/img/attachments/{{ document/file-icon a.extension }}" />
|
||||||
|
<a href="{{ session.appMeta.apiUrl }}api/public/attachments/{{ session.appMeta.orgId }}/{{ a.job }}/{{ a.fileId }}">
|
||||||
|
<span class="file">{{ a.filename }}</span>
|
||||||
|
</a>
|
||||||
|
{{#if isEditor}}
|
||||||
|
<div class="action round-button-mono">
|
||||||
|
<i class="material-icons delete-attachment-{{a.id}}" title="Delete" {{action 'confirmDeleteAttachment' a.id a.filename}}>delete</i>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="pages">
|
<div class="pages">
|
||||||
{{#each pages key="id" as |page index|}}
|
{{#each pages key="id" as |page index|}}
|
||||||
<div class="wysiwyg">
|
<div class="wysiwyg">
|
||||||
|
@ -11,32 +35,6 @@
|
||||||
{{#if document.template}}
|
{{#if document.template}}
|
||||||
<div class="is-template">TEMPLATE</div>
|
<div class="is-template">TEMPLATE</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="document-summary">
|
|
||||||
|
|
||||||
{{document/tag-editor documentTags=document.tags isEditor=isEditor onChange=(action 'onTagChange')}}
|
|
||||||
|
|
||||||
{{#if attachments}}
|
|
||||||
<div class="attachment-zone">
|
|
||||||
<ul class="list">
|
|
||||||
{{#each attachments key="id" as |a index|}}
|
|
||||||
<li class="item">
|
|
||||||
<img class="icon" src="assets/img/attachments/{{ document/file-icon a.extension }}" />
|
|
||||||
<a href="{{ session.appMeta.apiUrl }}api/public/attachments/{{ session.appMeta.orgId }}/{{ a.job }}/{{ a.fileId }}">
|
|
||||||
<span class="file">{{ a.filename }}</span>
|
|
||||||
</a>
|
|
||||||
{{#if isEditor}}
|
|
||||||
<div class="action round-button-mono">
|
|
||||||
<i class="material-icons delete-attachment-{{a.id}}" title="Delete" {{action 'confirmDeleteAttachment' a.id a.filename}}>delete</i>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
{{/each}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{section/base-renderer page=page}}
|
{{section/base-renderer page=page}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -30,7 +30,7 @@ const (
|
||||||
// AppVersion does what it says
|
// AppVersion does what it says
|
||||||
// Versioning scheme major.minor where "minor" is optional
|
// 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
|
// 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
|
var port, certFile, keyFile, forcePort2SSL string
|
||||||
|
|
|
@ -14,6 +14,7 @@ package entity
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -152,6 +153,15 @@ type Document struct {
|
||||||
Template bool `json:"template"`
|
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.
|
// Attachment represents an attachment to a document.
|
||||||
type Attachment struct {
|
type Attachment struct {
|
||||||
BaseEntity
|
BaseEntity
|
||||||
|
@ -183,6 +193,8 @@ func (p *Page) SetDefaults() {
|
||||||
if len(p.ContentType) == 0 {
|
if len(p.ContentType) == 0 {
|
||||||
p.ContentType = "wysiwyg"
|
p.ContentType = "wysiwyg"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.Title = strings.TrimSpace(p.Title)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PageMeta holds raw page data that is used to
|
// PageMeta holds raw page data that is used to
|
||||||
|
|
|
@ -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
|
//if page.Level == 1 { // may need to update the document name
|
||||||
var doc entity.Document
|
//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=?")
|
//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)
|
//defer utility.Close(stmt4)
|
||||||
|
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
log.Error(fmt.Sprintf("Unable to prepare pagemanager doc query for Id %s", page.DocumentID), err)
|
//log.Error(fmt.Sprintf("Unable to prepare pagemanager doc query for Id %s", page.DocumentID), err)
|
||||||
return err
|
//return err
|
||||||
}
|
//}
|
||||||
|
|
||||||
err = stmt4.Get(&doc, page.DocumentID)
|
//err = stmt4.Get(&doc, page.DocumentID)
|
||||||
|
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
log.Error(fmt.Sprintf("Unable to execute pagemanager document query for Id %s", page.DocumentID), err)
|
//log.Error(fmt.Sprintf("Unable to execute pagemanager document query for Id %s", page.DocumentID), err)
|
||||||
return err
|
//return err
|
||||||
}
|
//}
|
||||||
|
|
||||||
if doc.Title != page.Title {
|
//if doc.Title != page.Title {
|
||||||
doc.Title = page.Title
|
//doc.Title = page.Title
|
||||||
doc.Revised = page.Revised
|
//doc.Revised = page.Revised
|
||||||
err = p.UpdateDocument(doc)
|
//err = p.UpdateDocument(doc)
|
||||||
|
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
log.Error(fmt.Sprintf("Unable to update document when page 1 altered DocumentId %s", page.DocumentID), err)
|
//log.Error(fmt.Sprintf("Unable to update document when page 1 altered DocumentId %s", page.DocumentID), err)
|
||||||
return err
|
//return err
|
||||||
}
|
//}
|
||||||
}
|
//}
|
||||||
}
|
//}
|
||||||
|
|
||||||
p.Base.Audit(p.Context, "update-page", page.DocumentID, page.RefID)
|
p.Base.Audit(p.Context, "update-page", page.DocumentID, page.RefID)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue