mirror of
https://github.com/documize/community.git
synced 2025-07-23 15:19:42 +02:00
wip
This commit is contained in:
parent
17db964b10
commit
866b4eba8a
4 changed files with 661 additions and 662 deletions
|
@ -171,8 +171,6 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//err = processPage(documentID, fileResult.PageFiles, fileResult.Pages.Children[0], 1, p)
|
|
||||||
|
|
||||||
for k, v := range fileResult.Pages {
|
for k, v := range fileResult.Pages {
|
||||||
var p page.Page
|
var p page.Page
|
||||||
p.OrgID = ctx.OrgID
|
p.OrgID = ctx.OrgID
|
||||||
|
@ -196,7 +194,6 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
|
||||||
model.Meta = meta
|
model.Meta = meta
|
||||||
|
|
||||||
err = store.Page.Add(ctx, model)
|
err = store.Page.Add(ctx, model)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Transaction.Rollback()
|
ctx.Transaction.Rollback()
|
||||||
err = errors.Wrap(err, "cannot insert new page for new document")
|
err = errors.Wrap(err, "cannot insert new page for new document")
|
||||||
|
@ -216,7 +213,6 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
|
||||||
a.RefID = refID
|
a.RefID = refID
|
||||||
|
|
||||||
err = store.Attachment.Add(ctx, a)
|
err = store.Attachment.Add(ctx, a)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Transaction.Rollback()
|
ctx.Transaction.Rollback()
|
||||||
err = errors.Wrap(err, "cannot insert attachment for new document")
|
err = errors.Wrap(err, "cannot insert attachment for new document")
|
||||||
|
@ -224,7 +220,17 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Transaction.Commit()
|
store.Activity.RecordUserActivity(ctx, activity.UserActivity{
|
||||||
|
LabelID: newDocument.LabelID,
|
||||||
|
SourceID: newDocument.RefID,
|
||||||
|
SourceType: activity.SourceTypeDocument,
|
||||||
|
ActivityType: activity.TypeCreated})
|
||||||
|
|
||||||
|
err = ctx.Transaction.Commit()
|
||||||
|
if err != nil {
|
||||||
|
err = errors.Wrap(err, "cannot commit new document import")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
newDocument, err = store.Document.Get(ctx, documentID)
|
newDocument, err = store.Document.Get(ctx, documentID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -233,19 +239,6 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *domain.St
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// err = store.Document.Update(ctx, newDocument) // TODO review - this seems to write-back an unaltered record from that read above, but within that it calls searches.UpdateDocument() to reindex the doc.
|
|
||||||
// if err != nil {
|
|
||||||
// ctx.Transaction.Rollback()
|
|
||||||
// err = errors.Wrap(err, "cannot updater new document")
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
store.Activity.RecordUserActivity(ctx, activity.UserActivity{
|
|
||||||
LabelID: newDocument.LabelID,
|
|
||||||
SourceID: newDocument.RefID,
|
|
||||||
SourceType: activity.SourceTypeDocument,
|
|
||||||
ActivityType: activity.TypeCreated})
|
|
||||||
|
|
||||||
store.Audit.Record(ctx, audit.EventTypeDocumentUpload)
|
store.Audit.Record(ctx, audit.EventTypeDocumentUpload)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -23,6 +23,10 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, AuthMixin, {
|
||||||
hasProtectedFolders: false,
|
hasProtectedFolders: false,
|
||||||
hasPrivateFolders: false,
|
hasPrivateFolders: false,
|
||||||
newFolder: '',
|
newFolder: '',
|
||||||
|
copyTemplate: true,
|
||||||
|
copyBlock: true,
|
||||||
|
copyPermission: true,
|
||||||
|
copyDocument: false,
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
let folders = this.get('folders');
|
let folders = this.get('folders');
|
||||||
|
|
|
@ -1,15 +1,20 @@
|
||||||
<div class="sidebar-panel">
|
<div class="sidebar-panel">
|
||||||
<div class="space-tools">
|
|
||||||
{{#if showingDocument}}
|
|
||||||
{{folder/start-document savedTemplates=savedTemplates folder=folder editor=folderService.canEditCurrentFolder
|
|
||||||
onImport=(action 'onImport')
|
|
||||||
onEditTemplate=(action 'onEditTemplate')
|
|
||||||
onDocumentTemplate=(action 'onDocumentTemplate')}}
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="folders-list">
|
<div class="folders-list">
|
||||||
{{#if session.isEditor}}
|
{{#if session.isEditor}}
|
||||||
|
<div class="comment-box document-sidebar-form-wrapper">
|
||||||
|
<div class="input-control">
|
||||||
|
<label>New space</label>
|
||||||
|
<div class="tip">A place for related documents</div>
|
||||||
|
{{input type='text' id="new-folder-name" class="mousetrap" value=newFolder}}
|
||||||
|
<p>Copy existing space</p>
|
||||||
|
{{#ui/ui-checkbox selected=copyTemplate}}Templates{{/ui/ui-checkbox}}
|
||||||
|
{{#ui/ui-checkbox selected=copyBlock}}Reusable content{{/ui/ui-checkbox}}
|
||||||
|
{{#ui/ui-checkbox selected=copyPermission}}Permissions{{/ui/ui-checkbox}}
|
||||||
|
{{#ui/ui-checkbox selected=copyDocument}}Documents{{/ui/ui-checkbox}}
|
||||||
|
</div>
|
||||||
|
<div class="regular-button button-blue">Add</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="add-space-button" class="regular-button button-white">
|
<div id="add-space-button" class="regular-button button-white">
|
||||||
<i class="material-icons">add</i>
|
<i class="material-icons">add</i>
|
||||||
<div class="name">Space</div>
|
<div class="name">Space</div>
|
||||||
|
@ -17,9 +22,6 @@
|
||||||
{{#dropdown-dialog target="add-space-button" position="bottom left" button="Add" color="flat-green" onAction=(action 'addFolder') focusOn="new-folder-name" }}
|
{{#dropdown-dialog target="add-space-button" position="bottom left" button="Add" color="flat-green" onAction=(action 'addFolder') focusOn="new-folder-name" }}
|
||||||
<div>
|
<div>
|
||||||
<div class="input-control">
|
<div class="input-control">
|
||||||
<label>New space</label>
|
|
||||||
<div class="tip">A repository for related documentation</div>
|
|
||||||
{{input type='text' id="new-folder-name" class="mousetrap" value=newFolder}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/dropdown-dialog}}
|
{{/dropdown-dialog}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue