1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 05:09:42 +02:00

document tab basics

This commit is contained in:
Harvey Kandola 2016-11-09 15:16:44 -08:00
parent 5c09407d2f
commit 8caa53bed7
49 changed files with 493 additions and 239 deletions

View file

@ -5,7 +5,17 @@
"indent_with_tabs": true, "indent_with_tabs": true,
"preserve_newlines": true, "preserve_newlines": true,
"max_preserve_newlines": 2, "max_preserve_newlines": 2,
"newline_between_rules": true "newline_between_rules": true,
"selector_separator_newlines": true
},
"scss": {
"indent_size": 4,
"indent_level": 0,
"indent_with_tabs": true,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"newline_between_rules": true,
"selector_separator_newlines": true
}, },
"html": { "html": {
"indent_size": 4, "indent_size": 4,
@ -49,4 +59,4 @@
"indent_level": 0, "indent_level": 0,
"indent_with_tabs": true "indent_with_tabs": true
} }
} }

View file

@ -0,0 +1,45 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
import Ember from 'ember';
import NotifierMixin from '../../mixins/notifier';
import TooltipMixin from '../../mixins/tooltip';
export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
viewMode: true,
editMode: false,
actions: {
onEdit() {
this.set('viewMode', false);
this.set('editMode', true);
},
onView() {
this.set('viewMode', true);
this.set('editMode', false);
},
onCancel() {
this.send('onView');
},
onAction(page, meta) {
this.get('onAction')(page, meta);
this.send('onView');
},
onDelete() {
this.get('onDelete')(this.get('model.document'), this.get('model.page'));
return true;
}
}
});

View file

@ -30,6 +30,12 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
this.set('saveTemplate.description', this.get('document.excerpt')); this.set('saveTemplate.description', this.get('document.excerpt'));
}, },
didRender() {
if (this.session.isEditor) {
this.addTooltip(document.getElementById("add-document-tab"));
}
},
willDestroyElement() { willDestroyElement() {
this.destroyTooltips(); this.destroyTooltips();
}, },
@ -67,4 +73,4 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
return true; return true;
} }
} }
}); });

View file

@ -18,26 +18,17 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
sectionService: Ember.inject.service('section'), sectionService: Ember.inject.service('section'),
appMeta: Ember.inject.service(), appMeta: Ember.inject.service(),
link: Ember.inject.service(), link: Ember.inject.service(),
/* Parameters */
document: null, document: null,
// pages: [],
attachments: [],
folder: null, folder: null,
folders: [], folders: [],
isEditor: false, isEditor: false,
/* Internal */
drop: null,
deleteAttachment: {
id: "",
name: "",
},
noSections: Ember.computed('pages', function () { noSections: Ember.computed('pages', function () {
return this.get('pages.length') === 0; return this.get('pages.length') === 0;
}), }),
didInsertElement() { didInsertElement() {
let self = this; // let self = this;
// this.get('sectionService').refresh(this.get('document.id')).then(function (changes) { // this.get('sectionService').refresh(this.get('document.id')).then(function (changes) {
// changes.forEach(function (newPage) { // changes.forEach(function (newPage) {
@ -57,12 +48,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
willDestroyElement() { willDestroyElement() {
this.destroyTooltips(); this.destroyTooltips();
let drop = this.get('drop');
if (is.not.null(drop)) {
drop.destroy();
}
}, },
contentLinkHandler() { contentLinkHandler() {
@ -70,7 +55,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
let doc = this.get('document'); let doc = this.get('document');
let self = this; let self = this;
$("a[data-documize='true']").off('click').on('click', function(e) { $("a[data-documize='true']").off('click').on('click', function (e) {
let link = links.getLinkObject(self.get('meta.outboundLinks'), this); let link = links.getLinkObject(self.get('meta.outboundLinks'), this);
// local link? exists? // local link? exists?
@ -99,55 +84,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
}, },
actions: { actions: {
confirmDeleteAttachment(id, name) {
this.set('deleteAttachment', {
id: id,
name: name
});
$(".delete-attachment-dialog").css("display", "block");
let drop = new Drop({
target: $(".delete-attachment-" + id)[0],
content: $(".delete-attachment-dialog")[0],
classes: 'drop-theme-basic',
position: "bottom right",
openOn: "always",
tetherOptions: {
offset: "5px 0",
targetOffset: "10px 0"
},
remove: false
});
this.set('drop', drop);
},
cancel() {
let drop = this.get('drop');
drop.close();
this.set('deleteAttachment', {
id: "",
name: ""
});
},
deleteAttachment() {
let attachment = this.get('deleteAttachment');
let drop = this.get('drop');
drop.close();
this.showNotification(`Deleted ${attachment.name}`);
this.attrs.onAttachmentDeleted(this.get('deleteAttachment').id);
this.set('deleteAttachment', {
id: "",
name: ""
});
return true;
},
onDeletePage(id, deleteChildren) { onDeletePage(id, deleteChildren) {
let page = this.get('pages').findBy("id", id); let page = this.get('pages').findBy("id", id);
@ -164,7 +100,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
this.attrs.onDeletePage(params); this.attrs.onDeletePage(params);
}, },
// onTagChange event emitted from document/tag-editor component
onTagChange(tags) { onTagChange(tags) {
let doc = this.get('document'); let doc = this.get('document');
doc.set('tags', tags); doc.set('tags', tags);

View file

@ -13,31 +13,28 @@ import Ember from 'ember';
import NotifierMixin from '../../mixins/notifier'; import NotifierMixin from '../../mixins/notifier';
export default Ember.Component.extend(NotifierMixin, { export default Ember.Component.extend(NotifierMixin, {
sectionService: Ember.inject.service('section'), display: 'section', // which CSS to use
didReceiveAttrs() { didRender() {
let self = this; let self = this;
this.get('sectionService').getAll().then(function(sections) {
self.set('sections', sections); Mousetrap.bind('esc', function () {
if (self.get('isDestroyed') || self.get('isDestroying')) {
return;
}
self.send('onCancel');
return false;
}); });
}, },
didRender() { actions: {
let self = this;
Mousetrap.bind('esc', function() {
self.send('onCancel');
return false;
});
},
actions: {
onCancel() { onCancel() {
this.attrs.onCancel(); this.attrs.onCancel();
}, },
addSection(section) { addSection(section) {
this.attrs.onAction(section); this.attrs.onAction(section);
} }
} }
}); });

View file

@ -18,6 +18,7 @@ export default Model.extend({
documentId: attr('string'), documentId: attr('string'),
orgId: attr('string'), orgId: attr('string'),
contentType: attr('string'), contentType: attr('string'),
pageType: attr('string'),
level: attr('number', { defaultValue: 1 }), level: attr('number', { defaultValue: 1 }),
sequence: attr('number', { defaultValue: 0 }), sequence: attr('number', { defaultValue: 0 }),
revisions: attr('number', { defaultValue: 0 }), revisions: attr('number', { defaultValue: 0 }),
@ -41,4 +42,4 @@ export default Model.extend({
}), }),
created: attr(), created: attr(),
revised: attr() revised: attr()
}); });

View file

@ -16,6 +16,7 @@ import Ember from 'ember';
export default Model.extend({ export default Model.extend({
contentType: attr('string'), contentType: attr('string'),
pageType: attr('string'),
title: attr('string'), title: attr('string'),
description: attr('string'), description: attr('string'),
iconFont: attr('string'), iconFont: attr('string'),
@ -24,6 +25,7 @@ export default Model.extend({
hasImage: Ember.computed('iconFont', 'iconFile', function () { hasImage: Ember.computed('iconFont', 'iconFile', function () {
return this.get('iconFile').length > 0; return this.get('iconFile').length > 0;
}), }),
created: attr(), created: attr(),
revised: attr() revised: attr()
}); });

View file

@ -172,7 +172,8 @@ export default Ember.Controller.extend(NotifierMixin, {
level: 1, level: 1,
sequence: 2048, sequence: 2048,
body: "", body: "",
contentType: section.get('contentType') contentType: section.get('contentType'),
pageType: section.get('pageType')
}; };
let data = this.get('store').normalize('page', page); let data = this.get('store').normalize('page', page);
@ -212,4 +213,4 @@ export default Ember.Controller.extend(NotifierMixin, {
}); });
} }
} }
}); });

View file

@ -93,13 +93,6 @@ export default Ember.Controller.extend(NotifierMixin, {
} }
self.set('pages', _.sortBy(self.get('pages'), "sequence")); self.set('pages', _.sortBy(self.get('pages'), "sequence"));
self.audit.record("deleted-page");
// fetch document meta
self.get('documentService').getMeta(self.model.get('id')).then(function (meta) {
self.set('meta', meta);
});
}); });
} else { } else {
// page delete followed by re-leveling child pages // page delete followed by re-leveling child pages
@ -107,17 +100,12 @@ export default Ember.Controller.extend(NotifierMixin, {
self.set('pages', _.reject(self.get('pages'), function (p) { self.set('pages', _.reject(self.get('pages'), function (p) {
return p.get('id') === deleteId; return p.get('id') === deleteId;
})); }));
self.audit.record("deleted-page");
// fetch document meta
self.get('documentService').getMeta(self.model.get('id')).then(function (meta) {
self.set('meta', meta);
});
}); });
self.send('onPageLevelChange', pendingChanges); self.send('onPageLevelChange', pendingChanges);
} }
self.audit.record("deleted-page");
}, },
} }
}); });

View file

@ -62,6 +62,6 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
controller.set('folders', this.get('folders').rejectBy('id', 0)); controller.set('folders', this.get('folders').rejectBy('id', 0));
controller.set('currentPage', this.pageId); controller.set('currentPage', this.pageId);
controller.set('isEditor', this.get('folderService').get('canEditCurrentFolder')); controller.set('isEditor', this.get('folderService').get('canEditCurrentFolder'));
controller.set('pages', this.get('pages')); controller.set('pages', this.get('pages').filterBy('pageType', 'section'));
} }
}); });

View file

@ -13,6 +13,7 @@ import Ember from 'ember';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, { export default Ember.Route.extend(AuthenticatedRouteMixin, {
sectionService: Ember.inject.service('section'),
documentService: Ember.inject.service('document'), documentService: Ember.inject.service('document'),
folderService: Ember.inject.service('folder'), folderService: Ember.inject.service('folder'),
userService: Ember.inject.service('user'), userService: Ember.inject.service('user'),
@ -46,7 +47,11 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
return new Ember.RSVP.Promise(function (resolve) { return new Ember.RSVP.Promise(function (resolve) {
self.get('documentService').getPages(documentId).then(function (pages) { self.get('documentService').getPages(documentId).then(function (pages) {
self.set('pages', pages); self.set('pages', pages);
resolve();
self.get('sectionService').getAll().then(function (sections) {
self.set('sections', sections.filterBy('pageType', 'section'));
resolve();
});
}); });
}); });
}, },
@ -57,7 +62,9 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
controller.set('folders', this.get('folders').rejectBy('id', 0)); controller.set('folders', this.get('folders').rejectBy('id', 0));
controller.set('currentPage', this.pageId); controller.set('currentPage', this.pageId);
controller.set('isEditor', this.get('folderService').get('canEditCurrentFolder')); controller.set('isEditor', this.get('folderService').get('canEditCurrentFolder'));
controller.set('pages', this.get('pages')); controller.set('pages', this.get('pages').filterBy('pageType', 'section'));
controller.set('tabs', this.get('pages').filterBy('pageType', 'tab'));
controller.set('sections', this.get('sections'));
// setup document owner // setup document owner
let owner = this.get('users').findBy('id', model.get('userId')); let owner = this.get('users').findBy('id', model.get('userId'));

View file

@ -0,0 +1,46 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
import Ember from 'ember';
import NotifierMixin from '../../../mixins/notifier';
export default Ember.Controller.extend(NotifierMixin, {
documentService: Ember.inject.service('document'),
actions: {
onAction(page, meta) {
let self = this;
this.showNotification("Saving");
let model = {
page: page.toJSON({ includeId: true }),
meta: meta.toJSON({ includeId: true })
};
this.get('documentService').updatePage(page.get('documentId'), page.get('id'), model).then(function (page) {
self.audit.record("edited-page");
let data = self.get('store').normalize('page', page);
self.get('store').push(data);
});
},
onDelete(document, page) {
let self = this;
this.get('documentService').deletePage(document.get('id'), page.get('id')).then(function () {
page.deleteRecord();
self.audit.record("deleted-page");
self.showNotification('Deleted');
self.transitionToRoute('document');
});
}
}
});

View file

@ -0,0 +1,48 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
import Ember from 'ember';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
documentService: Ember.inject.service('document'),
folderService: Ember.inject.service('folder'),
userService: Ember.inject.service('user'),
pageId: '',
model(params) {
let self = this;
let document = this.modelFor('document');
let folders = this.get('store').peekAll('folder');
let folder = this.get('store').peekRecord('folder', this.paramsFor('document').folder_id);
let pages = this.get('store').peekAll('page').filter((page) => {
return page.get('documentId') === document.get('id') && page.get('pageType') === 'section';
});
let tabs = this.get('store').peekAll('page').filter((page) => {
return page.get('documentId') === document.get('id') && page.get('pageType') === 'tab';
});
let page = tabs.findBy('id', params.page_id);
this.audit.record("viewed-document-section-" + page.get('contentType'));
return Ember.RSVP.hash({
folders: folders,
folder: folder,
document: document,
pages: pages,
page: page,
meta: self.get('documentService').getPageMeta(document.get('id'), params.page_id)
});
},
});

View file

@ -0,0 +1 @@
{{document/document-tab model=model onAction=(action 'onAction') onDelete=(action 'onDelete')}}

View file

@ -1,15 +1,9 @@
{{layout/zone-navigation}} {{layout/zone-navigation}}
{{#layout/zone-sidebar}} {{#layout/zone-sidebar}}
{{document/document-sidebar document=model folder=folder pages=pages page=page isEditor=isEditor onAddSection=(action {{document/document-sidebar document=model folder=folder pages=pages page=page isEditor=isEditor sections=sections onAddSection=(action 'onAddSection') changePageSequence=(action 'onPageSequenceChange') changePageLevel=(action 'onPageLevelChange') gotoPage=(action 'gotoPage')}}
'onAddSection') changePageSequence=(action 'onPageSequenceChange') changePageLevel=(action 'onPageLevelChange') gotoPage=(action
'gotoPage')}}
{{/layout/zone-sidebar}} {{/layout/zone-sidebar}}
{{#layout/zone-content}} {{#layout/zone-content}}
{{document/document-toolbar document=model pages=pages folder=folder isEditor=isEditor onSaveTemplate=(action {{document/document-toolbar document=model pages=pages tabs=tabs folder=folder isEditor=isEditor onSaveTemplate=(action 'onSaveTemplate') onDocumentDelete=(action 'onDocumentDelete')}} {{outlet}}
'onSaveTemplate') onDocumentDelete=(action
'onDocumentDelete')}}
{{outlet}}
{{/layout/zone-content}} {{/layout/zone-content}}

View file

@ -2,7 +2,7 @@ import Ember from 'ember';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, { export default Ember.Route.extend(AuthenticatedRouteMixin, {
documentService: Ember.inject.service('document'), documentService: Ember.inject.service('document'),
folderService: Ember.inject.service('folder'), folderService: Ember.inject.service('folder'),
sectionService: Ember.inject.service('section'), sectionService: Ember.inject.service('section'),
@ -12,7 +12,9 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
return Ember.RSVP.hash({ return Ember.RSVP.hash({
folder: self.get('folderService').getFolder(self.paramsFor('document').folder_id), folder: self.get('folderService').getFolder(self.paramsFor('document').folder_id),
document: self.get('documentService').getDocument(self.paramsFor('document').document_id), document: self.get('documentService').getDocument(self.paramsFor('document').document_id),
sections: self.get('sectionService').getAll() sections: this.get('sectionService').getAll().then(function (sections) {
return sections.filterBy('pageType', 'tab');
})
}); });
} }
}); });

View file

@ -1 +1 @@
{{document/page-wizard document=model.document folder=model.folder sections=model.sections onCancel=(action 'onCancel') onAction=(action 'onAddSection')}} {{document/page-wizard display='tab' document=model.document folder=model.folder sections=model.sections onCancel=(action 'onCancel') onAction=(action 'onAddSection')}}

View file

@ -41,6 +41,9 @@ export default Router.map(function () {
this.route('activity', { this.route('activity', {
path: 'activity' path: 'activity'
}); });
this.route('section', {
path: 'section/:page_id'
});
this.route('edit', { this.route('edit', {
path: 'edit/:page_id' path: 'edit/:page_id'
}); });

View file

@ -20,7 +20,7 @@ $color-blue: #2667af;
$color-gray: #8b9096; $color-gray: #8b9096;
$color-goldy: #cc9933; $color-goldy: #cc9933;
$color-header: #f3f5f8; $color-sidebar: #f3f5f8;
$color-link: #0092d3; $color-link: #0092d3;
$color-border: #f3f5f8; $color-border: #f3f5f8;
@ -40,36 +40,47 @@ $color-chip-text: #1b88e3;
.color-white { .color-white {
color: $color-white !important; color: $color-white !important;
} }
.color-off-white { .color-off-white {
color: $color-off-white !important; color: $color-off-white !important;
} }
.color-black { .color-black {
color: $color-black !important; color: $color-black !important;
} }
.color-off-black { .color-off-black {
color: $color-off-black !important; color: $color-off-black !important;
} }
.color-primary { .color-primary {
color: $color-primary !important; color: $color-primary !important;
} }
.color-link { .color-link {
color: $color-link !important; color: $color-link !important;
} }
.color-blue { .color-blue {
color: $color-blue !important; color: $color-blue !important;
} }
.color-red { .color-red {
color: $color-red !important; color: $color-red !important;
} }
.color-green { .color-green {
color: $color-green !important; color: $color-green !important;
} }
.color-gray { .color-gray {
color: $color-gray !important; color: $color-gray !important;
} }
.background-color-white { .background-color-white {
background-color: $color-white !important; background-color: $color-white !important;
} }
.background-color-primary { .background-color-primary {
background-color: $color-primary !important; background-color: $color-primary !important;
} }

View file

@ -7,7 +7,7 @@
width: 100%; width: 100%;
padding: 10px; padding: 10px;
white-space: nowrap; white-space: nowrap;
overflow: auto overflow: auto;
} }
.github-repo-title { .github-repo-title {
@ -21,7 +21,6 @@
} }
.github-list-title { .github-list-title {
font-weight: bold;
color: #4c4c4c; color: #4c4c4c;
font-size: 14px; font-size: 14px;
margin: 5px; margin: 5px;
@ -34,17 +33,16 @@
.github-issue-label { .github-issue-label {
font-size: 11px; font-size: 11px;
color: white; color: white;
padding: 0px 4px; padding: 0 4px;
margin-right: 5px; margin-right: 5px;
border-radius: 2px; border-radius: 2px;
box-shadow: inset 0 -1px 0 rgba(0,0,0,0.12); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.12);
display: inline-block; display: inline-block;
line-height: 22px; line-height: 22px;
} }
} }
.section-github-render { .section-github-render {
a:hover { a:hover {
text-decoration: underline; text-decoration: underline;
} }
@ -62,7 +60,7 @@
.heading { .heading {
font-size: 1.6rem; font-size: 1.6rem;
margin: 30px 0 0 0; margin: 30px 0 0;
} }
.github-table thead tr th { .github-table thead tr th {
@ -73,36 +71,37 @@
text-align: left; text-align: left;
span { span {
color:#838d94; color: #838d94;
} }
} }
.github-table tbody tr td { .github-table tbody tr td {
border: none!important; border: none!important;
padding: 5px 20px 5px 20px !important; padding: 5px 20px !important;
} }
.github-table .right-column { .github-table .right-column {
text-align: right; text-align: right;
color:#838d94; color: #838d94;
} }
span.data { span.data {
color:#838d94; color: #838d94;
} }
.issue-label { .issue-label {
color:white; color: white;
font-size: 11px; font-size: 11px;
padding: 4px 6px; padding: 4px 6px;
border-radius: 4px; border-radius: 4px;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
margin-left: 10px; margin-left: 10px;
} }
.progress-bar { .progress-bar {
display: inline-block; border-radius: 3px; display: inline-block;
border-radius: 3px;
width: 40%; width: 40%;
background-color: #f1f1f1; background-color: #f1f1f1;
height: 8px; height: 8px;
@ -117,8 +116,8 @@
span.issue-state { span.issue-state {
float: left; float: left;
margin-right: 10px; margin-right: 10px;
margin-top: 3px; margin-top: 3px;
} }
img.github-avatar { img.github-avatar {

View file

@ -1,9 +1,7 @@
.document-editor { .document-editor {
> .toolbar { > .toolbar {
@extend .z-depth-tiny;
background-color: $color-white;
width: 100%; width: 100%;
padding: 20px 40px; padding: 0;
> .title { > .title {
width: 50%; width: 50%;
@ -12,7 +10,7 @@
margin: 0; margin: 0;
> input { > input {
margin: 0 0 5px 0; margin: 0 0 5px;
} }
} }
} }
@ -23,7 +21,7 @@
} }
> .canvas { > .canvas {
padding: 40px 40px; padding: 40px 0;
} }
.cancel-edits-dialog { .cancel-edits-dialog {

View file

@ -0,0 +1,9 @@
.document-section {
> .toolbar {
margin-bottom: 10px;
> .buttons {
margin: 10px 0;
}
}
}

View file

@ -3,7 +3,7 @@
margin: -30px 0 40px; margin: -30px 0 40px;
height: 60px; height: 60px;
padding: 5px 30px 0; padding: 5px 30px 0;
background-color: $color-off-white; background-color: $color-sidebar;
@include border-radius-bottom-right(5px); @include border-radius-bottom-right(5px);
@include border-radius-bottom-left(5px); @include border-radius-bottom-left(5px);
@extend .no-select; @extend .no-select;
@ -33,6 +33,26 @@
> .active { > .active {
color: $color-link; color: $color-link;
> .add-tab {
> i {
color: $color-link;
}
}
}
.add-tab {
display: inline-block;
vertical-align: text-top;
> i {
font-size: 1.5rem;
color: $color-gray;
&:hover {
color: $color-green;
}
}
} }
} }
} }

View file

@ -1,5 +1,5 @@
.section-wizard { .section-wizard {
margin: 20px 0 30px 0; margin: 20px 0 30px;
> .canvas { > .canvas {
padding: 0; padding: 0;
@ -27,7 +27,7 @@
color: $color-primary; color: $color-primary;
} }
} }
} }
.icon { .icon {
text-align: center; text-align: center;
@ -65,3 +65,73 @@
} }
} }
} }
.tab-wizard {
margin: 20px 0 30px;
> .canvas {
padding: 0;
> .list {
margin: 0;
padding: 0;
> .item {
list-style: none;
cursor: pointer;
padding: 20px;
float: left;
@include ease-in();
&:hover {
@include ease-in();
> .details {
> .title {
color: $color-primary;
}
> .desc {
color: $color-primary;
}
}
}
.icon {
text-align: center;
display: inline-block;
width: 50px;
margin-right: 10px;
float: left;
> .img {
float: left;
text-align: center;
display: inline-block;
height: 40px;
width: 40px;
}
}
> .details {
vertical-align: top;
display: inline-block;
float: left;
> .title {
font-size: 1rem;
font-weight: bold;
color: $color-off-black;
letter-spacing: 0.5px;
}
> .desc {
color: $color-gray;
font-size: 0.9rem;
margin-top: 5px;
}
}
}
}
}
}

View file

@ -9,8 +9,8 @@
z-index: 999; z-index: 999;
overflow-x: hidden; overflow-x: hidden;
> .top-zone, > .bottom-zone,
> .bottom-zone { > .top-zone {
position: absolute; position: absolute;
padding: 0; padding: 0;
width: 100%; width: 100%;
@ -101,7 +101,7 @@
} }
.zone-sidebar { .zone-sidebar {
background-color: $color-header; background-color: $color-sidebar;
height: 100%; height: 100%;
min-height: 100%; min-height: 100%;
padding: 30px 40px 0; padding: 30px 40px 0;
@ -116,8 +116,8 @@
font-weight: bold; font-weight: bold;
margin-bottom: 10px; margin-bottom: 10px;
> a > .material-icons, > .material-icons,
> .material-icons { > a > .material-icons {
font-size: 1rem; font-size: 1rem;
vertical-align: middle; vertical-align: middle;
} }

View file

@ -1,55 +1,55 @@
.page-search { .page-search {
.input-control { .input-control {
> input { > input {
background-color: $color-header; background-color: $color-sidebar;
} }
} }
.search-results { .search-results {
.heading { .heading {
font-size: 1.2rem; font-size: 1.2rem;
color: $color-off-black; color: $color-off-black;
} }
> .list { > .list {
margin-top: 20px; margin-top: 20px;
list-style: none; list-style: none;
> .item { > .item {
cursor: pointer; cursor: pointer;
margin: 0 30px 30px 0; margin: 0 30px 30px 0;
padding-bottom: 40px; padding-bottom: 40px;
border-bottom: 1px solid #e1e1e1; border-bottom: 1px solid #e1e1e1;
> .link { > .link {
text-decoration: none; text-decoration: none;
color: $color-off-black; color: $color-off-black;
&:hover { &:hover {
color: $color-link; color: $color-link;
} }
> .title { > .title {
display: inline-block; display: inline-block;
font-size: 1.2rem; font-size: 1.2rem;
} }
> .folder { > .folder {
display: inline-block; display: inline-block;
font-size: 0.8rem; font-size: 0.8rem;
color: $color-gray; color: $color-gray;
margin-left: 15px; margin-left: 15px;
} }
> .excerpt { > .excerpt {
margin-top: 1rem; margin-top: 1rem;
font-size: 0.9rem; font-size: 0.9rem;
} }
> .chips { > .chips {
margin-top: 1rem; margin-top: 1rem;
} }
} }
> .references { > .references {
margin-top: 1rem; margin-top: 1rem;
@ -69,7 +69,7 @@
} }
} }
} }
} }
} }
} }
} }

View file

@ -51,8 +51,8 @@
overflow-y: hidden; overflow-y: hidden;
} }
> div select, > select,
> select { > div select {
background-color: $color-white; background-color: $color-white;
padding: 5px; padding: 5px;
border: 1px solid $color-input; border: 1px solid $color-input;
@ -167,25 +167,25 @@
padding: 30px 40px; padding: 30px 40px;
border: 10px solid $color-border; border: 10px solid $color-border;
@include border-radius(15px); @include border-radius(15px);
}
> .form-header { .form-header {
> .title { > .title {
font-size: 1.4rem; font-size: 1.4rem;
font-weight: normal; font-weight: normal;
font-family: $font-semibold; font-family: $font-semibold;
pointer-events: none; pointer-events: none;
font-weight: bold; font-weight: bold;
color: $color-off-black; color: $color-off-black;
} }
> .tip { > .tip {
color: $color-input; color: $color-input;
font-size: 1.2rem; font-size: 1.2rem;
margin: 5px 0 30px; margin: 5px 0 30px;
padding: 0; padding: 0;
font-family: $font-light; font-family: $font-light;
text-align: left; text-align: left;
}
} }
} }

View file

@ -25,6 +25,6 @@
gotoPage=(action 'gotoPage')}} gotoPage=(action 'gotoPage')}}
{{/if}} {{/if}}
{{#if showSections}} {{#if showSections}}
{{document/page-wizard document=document folder=folder onCancel=(action 'onCancel') onAction=(action 'onAddSection')}} {{document/page-wizard display='section' document=document folder=folder sections=sections onCancel=(action 'onCancel') onAction=(action 'onAddSection')}}
{{/if}} {{/if}}
</div> </div>

View file

@ -0,0 +1,31 @@
<div class="document-section">
{{#if viewMode}}
<div class="toolbar pull-right">
<div class="buttons">
<div class="round-button-mono" {{action 'onEdit'}}>
<i class="material-icons color-gray">edit</i>
</div>
<div class="button-gap"></div>
<div class="round-button-mono" id="delete-section-button">
<i class="material-icons color-gray">delete</i>
</div>
</div>
</div>
<div class="clearfix"/>
{{#dropdown-dialog target="delete-section-button" position="bottom right" button="Delete" color="flat-red" onAction=(action 'onDelete')}}
<p>Are you sure you want to delete this section?</p>
<p>There is no undo!</p>
{{/dropdown-dialog}}
<div class="wysiwyg">
<h1>{{model.page.title}}</h1>
{{section/base-renderer page=model.page}}
</div>
{{/if}}
{{#if editMode}}
{{document/document-editor document=model.document folder=model.folder page=model.page meta=model.meta onCancel=(action 'onCancel') onAction=(action 'onAction')}}
{{/if}}
</div>

View file

@ -17,6 +17,20 @@
{{#link-to 'document.activity'}}Activity{{/link-to}} {{#link-to 'document.activity'}}Activity{{/link-to}}
</li> </li>
{{/if}} {{/if}}
{{#each tabs as |tab|}}
<li class="tab">
{{#link-to 'document.section' tab.id}}{{tab.title}}{{/link-to}}
</li>
{{/each}}
{{#if isEditor}}
<li class="tab">
{{#link-to 'document.wizard'}}
<div id="add-document-tab" class="add-tab" data-tooltip="Tab" data-tooltip-position="bottom center">
<i class="material-icons">add</i>
</div>
{{/link-to}}
</li>
{{/if}}
</ul> </ul>
<ul class="options"> <ul class="options">
@ -39,7 +53,7 @@
<p>Are you sure you want to delete this document?</p> <p>Are you sure you want to delete this document?</p>
<p>There is no undo!</p> <p>There is no undo!</p>
{{/dropdown-dialog}} {{/dropdown-dialog}}
{{#dropdown-dialog target="save-template-button" position="bottom right" button="Save as Template" color="flat-green" onAction=(action 'saveTemplate') focusOn="new-template-name"}} {{#dropdown-dialog target="save-template-button" position="bottom right" button="Save as Template" color="flat-green" onAction=(action 'saveTemplate') focusOn="new-template-name" }}
<div> <div>
<div class="input-control"> <div class="input-control">
<label>Name</label> <label>Name</label>
@ -57,4 +71,4 @@
</div> </div>
<div class="clearfix"/> <div class="clearfix" />

View file

@ -1,5 +1,4 @@
<div class="document-view"> <div class="document-view">
<div class="wysiwyg"> <div class="wysiwyg">
<h1 class="doc-name">{{document.name}}</h1> <h1 class="doc-name">{{document.name}}</h1>
</div> </div>
@ -18,7 +17,8 @@
{{#each pages key="id" as |page index|}} {{#each pages key="id" as |page index|}}
<div class="wysiwyg"> <div class="wysiwyg">
<div id="page-{{ page.id }}" class="is-a-page" data-id="{{ page.id }}" data-type="{{ page.contentType }}"> <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')}} {{section/base-renderer page=page}} {{document/page-heading tagName=page.tagName document=document folder=folder page=page isEditor=isEditor onDeletePage=(action 'onDeletePage')}}
{{section/base-renderer page=page}}
</div> </div>
</div> </div>
{{/each}} {{/each}}

View file

@ -1,4 +1,4 @@
<div class="section-wizard"> <div class="{{display}}-wizard">
<div class="canvas"> <div class="canvas">
<ul class="list"> <ul class="list">
{{#each sections as |section|}} {{#each sections as |section|}}

View file

@ -1,4 +1,4 @@
<div class="document-editor"> <div class="document-editor form-bordered">
<div class="toolbar"> <div class="toolbar">
<div class="title pull-left"> <div class="title pull-left">
<div class="input-control"> <div class="input-control">
@ -34,4 +34,5 @@
<div class="canvas"> <div class="canvas">
{{yield}} {{yield}}
</div> </div>
<div class="clearfix"></div>
</div> </div>

View file

@ -5,31 +5,26 @@
{{#if authenticated}} {{#if authenticated}}
<div class="pull-left width-45"> <div class="pull-left width-45">
<div class="input-form"> <div class="input-control">
<div class="heading"> <label>Select repository</label>
<div class="title">Select Repository</div> <div class="tip">Select organization or user whose repository you want to show</div>
<div class="tip">Choose source of code information to be displayed</div> {{ui-select id="owners-dropdown" content=owners action=(action 'onOwnerChange') optionValuePath="id" optionLabelPath="name" selection=config.owner}}
</div> </div>
<div class="input-control"> <div class="input-control">
<label>Organization or User</label> <label>Show items since</label>
<div class="tip">Select organization or username whose repository you want to show</div> <div class="tip">default is 7 days ago</div>
{{ui-select id="owners-dropdown" content=owners action=(action 'onOwnerChange') optionValuePath="id" optionLabelPath="name" selection=config.owner}} {{input id="branch-since" value=config.branchSince type="text" }}<br>
</div> </div>
<div class="input-control"> <div class="input-control">
<label>Show items since (default 7 days ago)</label> <label>GitHub Views</label>
{{input id="branch-since" value=config.branchSince type="text" }}<br> <div class="tip">Select the views you want to show</div>
</div> <div class="github-view">
<div class="input-control"> {{input id="show-milestone" checked=config.showMilestones type="checkbox"}}
<label>GitHub Views</label> <label>Show Milestones</label>
<div class="tip">Select the views you want to show</div> {{input id="show-issues" checked=config.showIssues type="checkbox"}}
<div class="github-view"> <label>Show Issues</label>
{{input id="show-milestone" checked=config.showMilestones type="checkbox"}} {{input id="show-commits" checked=config.showCommits type="checkbox" }}
<label>Show Milestones</label> <label>Show Commits</label>
{{input id="show-issues" checked=config.showIssues type="checkbox"}}
<label>Show Issues</label>
{{input id="show-commits" checked=config.showCommits type="checkbox" }}
<label>Show Commits</label>
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -182,6 +182,7 @@ type Page struct {
DocumentID string `json:"documentId"` DocumentID string `json:"documentId"`
UserID string `json:"userId"` UserID string `json:"userId"`
ContentType string `json:"contentType"` ContentType string `json:"contentType"`
PageType string `json:"pageType"`
Level uint64 `json:"level"` Level uint64 `json:"level"`
Sequence float64 `json:"sequence"` Sequence float64 `json:"sequence"`
Title string `json:"title"` Title string `json:"title"`
@ -193,6 +194,7 @@ type Page struct {
func (p *Page) SetDefaults() { func (p *Page) SetDefaults() {
if len(p.ContentType) == 0 { if len(p.ContentType) == 0 {
p.ContentType = "wysiwyg" p.ContentType = "wysiwyg"
p.PageType = "section"
} }
p.Title = strings.TrimSpace(p.Title) p.Title = strings.TrimSpace(p.Title)

View file

@ -50,7 +50,7 @@ func (p *Persister) AddPage(model models.PageModel) (err error) {
model.Page.Sequence = maxSeq * 2 model.Page.Sequence = maxSeq * 2
} }
stmt, err := p.Context.Transaction.Preparex("INSERT INTO page (refid, orgid, documentid, userid, contenttype, level, title, body, revisions, sequence, created, revised) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") stmt, err := p.Context.Transaction.Preparex("INSERT INTO page (refid, orgid, documentid, userid, contenttype, pagetype, level, title, body, revisions, sequence, created, revised) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
defer utility.Close(stmt) defer utility.Close(stmt)
if err != nil { if err != nil {
@ -58,7 +58,7 @@ func (p *Persister) AddPage(model models.PageModel) (err error) {
return return
} }
_, err = stmt.Exec(model.Page.RefID, model.Page.OrgID, model.Page.DocumentID, model.Page.UserID, model.Page.ContentType, model.Page.Level, model.Page.Title, model.Page.Body, model.Page.Revisions, model.Page.Sequence, model.Page.Created, model.Page.Revised) _, err = stmt.Exec(model.Page.RefID, model.Page.OrgID, model.Page.DocumentID, model.Page.UserID, model.Page.ContentType, model.Page.PageType, model.Page.Level, model.Page.Title, model.Page.Body, model.Page.Revisions, model.Page.Sequence, model.Page.Created, model.Page.Revised)
if err != nil { if err != nil {
log.Error("Unable to execute insert for page", err) log.Error("Unable to execute insert for page", err)
@ -91,7 +91,7 @@ func (p *Persister) AddPage(model models.PageModel) (err error) {
func (p *Persister) GetPage(pageID string) (page entity.Page, err error) { func (p *Persister) GetPage(pageID string) (page entity.Page, err error) {
err = nil err = nil
stmt, err := Db.Preparex("SELECT a.id, a.refid, a.orgid, a.documentid, a.userid, a.contenttype, a.level, a.sequence, a.title, a.body, a.revisions, a.created, a.revised FROM page a WHERE a.orgid=? AND a.refid=?") stmt, err := Db.Preparex("SELECT a.id, a.refid, a.orgid, a.documentid, a.userid, a.contenttype, a.pagetype, a.level, a.sequence, a.title, a.body, a.revisions, a.created, a.revised FROM page a WHERE a.orgid=? AND a.refid=?")
defer utility.Close(stmt) defer utility.Close(stmt)
if err != nil { if err != nil {
@ -113,7 +113,7 @@ func (p *Persister) GetPage(pageID string) (page entity.Page, err error) {
func (p *Persister) GetPages(documentID string) (pages []entity.Page, err error) { func (p *Persister) GetPages(documentID string) (pages []entity.Page, err error) {
err = nil err = nil
err = Db.Select(&pages, "SELECT a.id, a.refid, a.orgid, a.documentid, a.userid, a.contenttype, a.level, a.sequence, a.title, a.body, a.revisions, a.created, a.revised FROM page a WHERE a.orgid=? AND a.documentid=? ORDER BY a.sequence", p.Context.OrgID, documentID) err = Db.Select(&pages, "SELECT a.id, a.refid, a.orgid, a.documentid, a.userid, a.contenttype, a.pagetype, a.level, a.sequence, a.title, a.body, a.revisions, a.created, a.revised FROM page a WHERE a.orgid=? AND a.documentid=? ORDER BY a.sequence", p.Context.OrgID, documentID)
if err != nil { if err != nil {
log.Error(fmt.Sprintf("Unable to execute select pages for org %s and document %s", p.Context.OrgID, documentID), err) log.Error(fmt.Sprintf("Unable to execute select pages for org %s and document %s", p.Context.OrgID, documentID), err)
@ -130,7 +130,7 @@ func (p *Persister) GetPagesWhereIn(documentID, inPages string) (pages []entity.
args := []interface{}{p.Context.OrgID, documentID} args := []interface{}{p.Context.OrgID, documentID}
tempValues := strings.Split(inPages, ",") tempValues := strings.Split(inPages, ",")
sql := "SELECT a.id, a.refid, a.orgid, a.documentid, a.userid, a.contenttype, a.level, a.sequence, a.title, a.body, a.revisions, a.created, a.revised FROM page a WHERE a.orgid=? AND a.documentid=? AND a.refid IN (?" + strings.Repeat(",?", len(tempValues)-1) + ") ORDER BY sequence" sql := "SELECT a.id, a.refid, a.orgid, a.documentid, a.userid, a.contenttype, a.pagetype, a.level, a.sequence, a.title, a.body, a.revisions, a.created, a.revised FROM page a WHERE a.orgid=? AND a.documentid=? AND a.refid IN (?" + strings.Repeat(",?", len(tempValues)-1) + ") ORDER BY sequence"
inValues := make([]interface{}, len(tempValues)) inValues := make([]interface{}, len(tempValues))
@ -180,7 +180,7 @@ func (p *Persister) GetPagesWhereIn(documentID, inPages string) (pages []entity.
// GetPagesWithoutContent returns a slice containing all the page records for a given documentID, in presentation sequence, // GetPagesWithoutContent returns a slice containing all the page records for a given documentID, in presentation sequence,
// but without the body field (which holds the HTML content). // but without the body field (which holds the HTML content).
func (p *Persister) GetPagesWithoutContent(documentID string) (pages []entity.Page, err error) { func (p *Persister) GetPagesWithoutContent(documentID string) (pages []entity.Page, err error) {
err = Db.Select(&pages, "SELECT id, refid, orgid, documentid, userid, contenttype, sequence, level, title, revisions, created, revised FROM page WHERE orgid=? AND documentid=? ORDER BY sequence", p.Context.OrgID, documentID) err = Db.Select(&pages, "SELECT id, refid, orgid, documentid, userid, contenttype, pagetype, sequence, level, title, revisions, created, revised FROM page WHERE orgid=? AND documentid=? ORDER BY sequence", p.Context.OrgID, documentID)
if err != nil { if err != nil {
log.Error(fmt.Sprintf("Unable to execute select pages for org %s and document %s", p.Context.OrgID, documentID), err) log.Error(fmt.Sprintf("Unable to execute select pages for org %s and document %s", p.Context.OrgID, documentID), err)
@ -199,7 +199,7 @@ func (p *Persister) UpdatePage(page entity.Page, refID, userID string, skipRevis
// Store revision history // Store revision history
if !skipRevision { if !skipRevision {
var stmt *sqlx.Stmt var stmt *sqlx.Stmt
stmt, err = p.Context.Transaction.Preparex("INSERT INTO revision (refid, orgid, documentid, ownerid, pageid, userid, contenttype, title, body, rawbody, config, created, revised) SELECT ? as refid, a.orgid, a.documentid, a.userid as ownerid, a.refid as pageid, ? as userid, a.contenttype, a.title, a.body, b.rawbody, b.config, ? as created, ? as revised FROM page a, pagemeta b WHERE a.refid=? AND a.refid=b.pageid") stmt, err = p.Context.Transaction.Preparex("INSERT INTO revision (refid, orgid, documentid, ownerid, pageid, userid, contenttype, pagetype, title, body, rawbody, config, created, revised) SELECT ? as refid, a.orgid, a.documentid, a.userid as ownerid, a.refid as pageid, ? as userid, a.contenttype, a.pagetype, a.title, a.body, b.rawbody, b.config, ? as created, ? as revised FROM page a, pagemeta b WHERE a.refid=? AND a.refid=b.pageid")
defer utility.Close(stmt) defer utility.Close(stmt)

View file

@ -149,6 +149,7 @@ CREATE TABLE IF NOT EXISTS `page` (
`documentid` CHAR(16) NOT NULL COLLATE utf8_bin, `documentid` CHAR(16) NOT NULL COLLATE utf8_bin,
`userid` CHAR(16) DEFAULT '' COLLATE utf8_bin, `userid` CHAR(16) DEFAULT '' COLLATE utf8_bin,
`contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg', `contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg',
`pagetype` CHAR(10) NOT NULL DEFAULT 'section',
`level` INT UNSIGNED NOT NULL, `level` INT UNSIGNED NOT NULL,
`sequence` DOUBLE NOT NULL, `sequence` DOUBLE NOT NULL,
`title` NVARCHAR(2000) NOT NULL, `title` NVARCHAR(2000) NOT NULL,
@ -239,6 +240,7 @@ CREATE TABLE IF NOT EXISTS `revision` (
`pageid` CHAR(16) NOT NULL COLLATE utf8_bin, `pageid` CHAR(16) NOT NULL COLLATE utf8_bin,
`userid` CHAR(16) NOT NULL COLLATE utf8_bin, `userid` CHAR(16) NOT NULL COLLATE utf8_bin,
`contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg', `contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg',
`pagetype` CHAR(10) NOT NULL DEFAULT 'section',
`title` NVARCHAR(2000) NOT NULL, `title` NVARCHAR(2000) NOT NULL,
`body` LONGTEXT, `body` LONGTEXT,
`rawbody` LONGBLOB, `rawbody` LONGBLOB,

View file

@ -0,0 +1,6 @@
/* community edition */
ALTER TABLE page ADD COLUMN `pagetype` CHAR(10) NOT NULL DEFAULT 'section' AFTER `contenttype`;
UPDATE page SET pagetype='tab' WHERE refid IN (SELECT pageid FROM pagemeta WHERE externalsource=1);
ALTER TABLE revision ADD COLUMN `pagetype` CHAR(10) NOT NULL DEFAULT 'section' AFTER `contenttype`;
UPDATE revision SET pagetype='tab' WHERE pageid IN (SELECT pageid FROM pagemeta WHERE externalsource=1);

View file

@ -29,6 +29,7 @@ func (*Provider) Meta() provider.TypeMeta {
section.Title = "Airtable" section.Title = "Airtable"
section.Description = "Databases, tables, views" section.Description = "Databases, tables, views"
section.ContentType = "airtable" section.ContentType = "airtable"
section.PageType = "tab"
return section return section
} }

View file

@ -29,6 +29,7 @@ func (*Provider) Meta() provider.TypeMeta {
section.Title = "Code" section.Title = "Code"
section.Description = "Formatted code snippets" section.Description = "Formatted code snippets"
section.ContentType = "code" section.ContentType = "code"
section.PageType = "section"
section.Order = 9997 section.Order = 9997
return section return section

View file

@ -35,6 +35,7 @@ func (*Provider) Meta() provider.TypeMeta {
section.Title = "Gemini" section.Title = "Gemini"
section.Description = "Work items and tickets" section.Description = "Work items and tickets"
section.ContentType = "gemini" section.ContentType = "gemini"
section.PageType = "tab"
return section return section
} }

View file

@ -39,6 +39,7 @@ func init() {
meta.Title = "GitHub" meta.Title = "GitHub"
meta.Description = "Link code commits and issues" meta.Description = "Link code commits and issues"
meta.ContentType = "github" meta.ContentType = "github"
meta.PageType = "tab"
meta.Callback = Callback meta.Callback = Callback
} }

View file

@ -30,6 +30,7 @@ func (*Provider) Meta() provider.TypeMeta {
section.Title = "Markdown" section.Title = "Markdown"
section.Description = "CommonMark based content" section.Description = "CommonMark based content"
section.ContentType = "markdown" section.ContentType = "markdown"
section.PageType = "section"
section.Order = 9998 section.Order = 9998
return section return section

View file

@ -38,6 +38,7 @@ func (*Provider) Meta() provider.TypeMeta {
section.Title = "Papertrail" section.Title = "Papertrail"
section.Description = "Display log entries" section.Description = "Display log entries"
section.ContentType = "papertrail" section.ContentType = "papertrail"
section.PageType = "tab"
return section return section
} }

View file

@ -35,6 +35,7 @@ type TypeMeta struct {
ID string `json:"id"` ID string `json:"id"`
Order int `json:"order"` Order int `json:"order"`
ContentType string `json:"contentType"` ContentType string `json:"contentType"`
PageType string `json:"pageType"`
Title string `json:"title"` Title string `json:"title"`
Description string `json:"description"` Description string `json:"description"`
Preview bool `json:"preview"` // coming soon! Preview bool `json:"preview"` // coming soon!

View file

@ -39,5 +39,5 @@ func Register() {
provider.Register("wysiwyg", &wysiwyg.Provider{}) provider.Register("wysiwyg", &wysiwyg.Provider{})
provider.Register("airtable", &airtable.Provider{}) provider.Register("airtable", &airtable.Provider{})
p := provider.List() p := provider.List()
log.Info(fmt.Sprintf("Documize registered %d smart sections", len(p))) log.Info(fmt.Sprintf("Documize registered %d sections and tabs", len(p)))
} }

View file

@ -29,6 +29,7 @@ func (*Provider) Meta() provider.TypeMeta {
section.Title = "Tabular" section.Title = "Tabular"
section.Description = "Rows, columns for tabular data" section.Description = "Rows, columns for tabular data"
section.ContentType = "table" section.ContentType = "table"
section.PageType = "section"
section.Order = 9996 section.Order = 9996
return section return section

View file

@ -36,6 +36,7 @@ func init() {
meta.Title = "Trello" meta.Title = "Trello"
meta.Description = "Embed cards from boards and lists" meta.Description = "Embed cards from boards and lists"
meta.ContentType = "trello" meta.ContentType = "trello"
meta.PageType = "tab"
} }
// Provider represents Trello // Provider represents Trello

View file

@ -29,6 +29,7 @@ func (*Provider) Meta() provider.TypeMeta {
section.Title = "Rich Text" section.Title = "Rich Text"
section.Description = "Rich text WYSIWYG" section.Description = "Rich text WYSIWYG"
section.ContentType = "wysiwyg" section.ContentType = "wysiwyg"
section.PageType = "section"
section.Order = 9999 section.Order = 9999
return section return section