mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
add section and editing experience improvements
1. Introduced velocity.js for animations 2. Resized section type icons 3. Refactored add section code
This commit is contained in:
parent
738aaf82c9
commit
be4a95df96
49 changed files with 5752 additions and 150 deletions
|
@ -201,9 +201,9 @@ func (p *Page) SetDefaults() {
|
|||
p.ContentType = "wysiwyg"
|
||||
}
|
||||
|
||||
if p.IsTabType() {
|
||||
p.Sequence = 0
|
||||
}
|
||||
// if p.IsTabType() {
|
||||
// p.Sequence = 0
|
||||
// }
|
||||
|
||||
p.Title = strings.TrimSpace(p.Title)
|
||||
}
|
||||
|
|
|
@ -37,9 +37,9 @@ func (p *Persister) AddPage(model models.PageModel) (err error) {
|
|||
model.Meta.Created = time.Now().UTC()
|
||||
model.Meta.Revised = time.Now().UTC()
|
||||
|
||||
if model.Page.IsSectionType() {
|
||||
// Get maximum page sequence number and increment
|
||||
row := Db.QueryRow("SELECT max(sequence) FROM page WHERE orgid=? AND documentid=? AND pagetype='section'", p.Context.OrgID, model.Page.DocumentID)
|
||||
if model.Page.Sequence == 0 {
|
||||
// Get maximum page sequence number and increment (used to be AND pagetype='section')
|
||||
row := Db.QueryRow("SELECT max(sequence) FROM page WHERE orgid=? AND documentid=?", p.Context.OrgID, model.Page.DocumentID)
|
||||
var maxSeq float64
|
||||
err = row.Scan(&maxSeq)
|
||||
|
||||
|
@ -485,7 +485,8 @@ func (p *Persister) DeletePageRevisions(pageID string) (rows int64, err error) {
|
|||
|
||||
// GetNextPageSequence returns the next sequence numbner to use for a page in given document.
|
||||
func (p *Persister) GetNextPageSequence(documentID string) (maxSeq float64, err error) {
|
||||
row := Db.QueryRow("SELECT max(sequence) FROM page WHERE orgid=? AND documentid=? AND pagetype='section'", p.Context.OrgID, documentID)
|
||||
row := Db.QueryRow("SELECT max(sequence) FROM page WHERE orgid=? AND documentid=?", p.Context.OrgID, documentID)
|
||||
// row := Db.QueryRow("SELECT max(sequence) FROM page WHERE orgid=? AND documentid=? AND pagetype='section'", p.Context.OrgID, documentID)
|
||||
|
||||
err = row.Scan(&maxSeq)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue