mirror of
https://github.com/documize/community.git
synced 2025-07-20 13:49:42 +02:00
Implement new toolbar for document view
This commit is contained in:
parent
93253be0f2
commit
329c43eba0
9 changed files with 59 additions and 50 deletions
|
@ -64,6 +64,14 @@ export default Component.extend(ModalMixin, AuthMixin, Notifier, {
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
onShowTemplateModal() {
|
||||||
|
this.modalOpen("#document-template-modal", {show:true}, "#new-template-name");
|
||||||
|
},
|
||||||
|
|
||||||
|
onShowDeleteModal() {
|
||||||
|
this.modalOpen("#document-delete-modal", {show:true});
|
||||||
|
},
|
||||||
|
|
||||||
onDocumentDelete() {
|
onDocumentDelete() {
|
||||||
this.modalClose('#document-delete-modal');
|
this.modalClose('#document-delete-modal');
|
||||||
|
|
||||||
|
|
|
@ -210,12 +210,14 @@ let constants = EmberObject.extend({
|
||||||
BarChart: 'dicon-chart-bar-2',
|
BarChart: 'dicon-chart-bar-2',
|
||||||
Blocks: 'dicon-menu-6',
|
Blocks: 'dicon-menu-6',
|
||||||
Bookmark: 'dicon-bookmark',
|
Bookmark: 'dicon-bookmark',
|
||||||
|
BookmarkSolid: 'dicon-bookmark-2',
|
||||||
BookmarkAdd: 'dicon-bookmark-add',
|
BookmarkAdd: 'dicon-bookmark-add',
|
||||||
BookmarkDelete: 'dicon-bookmark-delete',
|
BookmarkDelete: 'dicon-bookmark-delete',
|
||||||
ButtonAction: 'dicon-button-2',
|
ButtonAction: 'dicon-button-2',
|
||||||
Category: 'dicon-flag',
|
Category: 'dicon-flag',
|
||||||
Checkbox: 'dicon-shape-rectangle',
|
Checkbox: 'dicon-shape-rectangle',
|
||||||
CheckboxChecked: 'dicon-i-check',
|
CheckboxChecked: 'dicon-i-check',
|
||||||
|
Copy: 'dicon-single-copy-04',
|
||||||
Database: 'dicon-database',
|
Database: 'dicon-database',
|
||||||
Download: 'dicon-download',
|
Download: 'dicon-download',
|
||||||
Delete: 'dicon-bin',
|
Delete: 'dicon-bin',
|
||||||
|
@ -242,6 +244,7 @@ let constants = EmberObject.extend({
|
||||||
Send: 'dicon-send',
|
Send: 'dicon-send',
|
||||||
Settings: 'dicon-settings-gear',
|
Settings: 'dicon-settings-gear',
|
||||||
Tag: 'dicon-delete-key',
|
Tag: 'dicon-delete-key',
|
||||||
|
TimeBack: 'dicon-time',
|
||||||
Unlocked: 'dicon-unlocked',
|
Unlocked: 'dicon-unlocked',
|
||||||
World: 'dicon-globe',
|
World: 'dicon-globe',
|
||||||
},
|
},
|
||||||
|
|
|
@ -72,9 +72,6 @@
|
||||||
<div class="document-heading">
|
<div class="document-heading">
|
||||||
<h1 class="name">{{document.name}}</h1>
|
<h1 class="name">{{document.name}}</h1>
|
||||||
<h2 class="desc">{{document.excerpt}}</h2>
|
<h2 class="desc">{{document.excerpt}}</h2>
|
||||||
{{#if document.template}}
|
|
||||||
<span class="bg-warning p-1 pr-2 pl-2">Template</span>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,19 @@
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .label-template {
|
||||||
|
@include border-radius(3px);
|
||||||
|
@extend .no-select;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 5px 5px 5px 0;
|
||||||
|
padding: 0.3rem 0.7rem;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-weight: 500;
|
||||||
|
background-color: map-get($yellow-shades, 300);
|
||||||
|
color: map-get($yellow-shades, 800);
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
> .document-heading {
|
> .document-heading {
|
||||||
.name {
|
.name {
|
||||||
color: map-get($gray-shades, 900);
|
color: map-get($gray-shades, 900);
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
@include border-radius(5px);
|
@include border-radius(5px);
|
||||||
@extend .no-select;
|
@extend .no-select;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
margin: 2rem 0;
|
margin: 1.5rem 0;
|
||||||
display: block;
|
display: block;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
@extend %toolbar-shadow;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: map-get($yellow-shades, 700);
|
color: map-get($yellow-shades, 700);
|
||||||
|
|
|
@ -37,4 +37,10 @@
|
||||||
{{#if (eq document.protection constants.ProtectionType.Lock)}}LOCKED{{/if}}
|
{{#if (eq document.protection constants.ProtectionType.Lock)}}LOCKED{{/if}}
|
||||||
{{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}}
|
{{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}}
|
||||||
</div>
|
</div>
|
||||||
|
{{#if document.template}}
|
||||||
|
<div class="label-template">
|
||||||
|
Template
|
||||||
|
{{#attach-tooltip showDelay=1000}}This is a template{{/attach-tooltip}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,53 +1,34 @@
|
||||||
<div class="no-print">
|
<div class="no-print">
|
||||||
{{#if session.authenticated}}
|
{{#ui/ui-toolbar dark=false light=true raised=true large=true bordered=true}}
|
||||||
{{#if permissions.documentEdit}}
|
{{ui/ui-toolbar-icon icon=constants.Icon.Print color=constants.Color.Gray
|
||||||
{{#link-to "document.settings" space.id space.slug document.id document.slug class="button-icon-gray align-middle"}}
|
tooltip="Print" onClick=(action "onPrintDocument")}}
|
||||||
<i class="material-icons">settings</i>
|
|
||||||
{{#attach-tooltip showDelay=1000}}Settings — meta, lifecycle, workflow{{/attach-tooltip}}
|
|
||||||
{{/link-to}}
|
|
||||||
<div class="button-icon-gap" />
|
|
||||||
{{/if}}
|
|
||||||
{{#if permissions.documentAdd}}
|
|
||||||
<div id="document-template-button" class="button-icon-gray align-middle">
|
|
||||||
<i class="material-icons" data-toggle="modal" data-target="#document-template-modal" data-backdrop="static">content_copy</i>
|
|
||||||
{{#attach-tooltip showDelay=1000}}Save as template{{/attach-tooltip}}
|
|
||||||
</div>
|
|
||||||
<div class="button-icon-gap" />
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
<div id="document-print-button" class="button-icon-gray align-middle" {{action "onPrintDocument"}}>
|
{{ui/ui-toolbar-icon icon=constants.Icon.Download color=constants.Color.Gray
|
||||||
<i class="material-icons">print</i>
|
tooltip="Export as complete HTML file" onClick=(action "onExport")}}
|
||||||
{{#attach-tooltip showDelay=1000}}Print{{/attach-tooltip}}
|
|
||||||
</div>
|
|
||||||
<div class="button-icon-gap" />
|
|
||||||
|
|
||||||
<div id="space-export-button" class="button-icon-danger align-middle" {{action "onExport"}}>
|
|
||||||
<i class="material-icons">import_export</i>
|
|
||||||
{{#attach-tooltip showDelay=1000}}Export as HTML{{/attach-tooltip}}
|
|
||||||
</div>
|
|
||||||
<div class="button-icon-gap" />
|
|
||||||
|
|
||||||
{{#if pinState.isPinned}}
|
{{#if pinState.isPinned}}
|
||||||
<div id="document-pin-button" class="button-icon-gold align-middle" {{action "onUnpin"}}>
|
{{ui/ui-toolbar-icon icon=constants.Icon.BookmarkDelete color=constants.Color.Yellow
|
||||||
<i class="material-icons">star</i>
|
tooltip="Remove from bookmarks" onClick=(action "onUnpin")}}
|
||||||
{{#attach-tooltip showDelay=1000}}Remove bookmark{{/attach-tooltip}}
|
|
||||||
</div>
|
|
||||||
<div class="button-icon-gap" />
|
|
||||||
{{else if session.authenticated}}
|
{{else if session.authenticated}}
|
||||||
<div id="document-pin-button" class="button-icon-gray align-middle" {{action "onPin"}}>
|
{{ui/ui-toolbar-icon icon=constants.Icon.BookmarkAdd color=constants.Color.Gray
|
||||||
<i class="material-icons">star</i>
|
tooltip="Bookmark" onClick=(action "onPin")}}
|
||||||
{{#attach-tooltip showDelay=1000}}Add bookmark{{/attach-tooltip}}
|
{{/if}}
|
||||||
</div>
|
|
||||||
<div class="button-icon-gap" />
|
{{#if permissions.documentAdd}}
|
||||||
|
{{ui/ui-toolbar-icon icon=constants.Icon.Copy color=constants.Color.Gray
|
||||||
|
tooltip="Save as template" onClick=(action "onShowTemplateModal")}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if permissions.documentDelete}}
|
{{#if permissions.documentDelete}}
|
||||||
<div id="document-delete-button" class="button-icon-danger align-middle">
|
{{ui/ui-toolbar-icon icon=constants.Icon.Delete color=constants.Color.Gray
|
||||||
<i class="material-icons" data-toggle="modal" data-target="#document-delete-modal" data-backdrop="static">delete</i>
|
tooltip="Delete" onClick=(action "onShowDeleteModal")}}
|
||||||
{{#attach-tooltip showDelay=1000}}Delete{{/attach-tooltip}}
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if permissions.documentEdit}}
|
||||||
|
{{ui/ui-toolbar-icon icon=constants.Icon.Settings color=constants.Color.Green
|
||||||
|
tooltip="Rename, metadata, workflow" linkTo="document.settings"}}
|
||||||
|
{{/if}}
|
||||||
|
{{/ui/ui-toolbar}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="document-template-modal" class="modal" tabindex="-1" role="dialog">
|
<div id="document-template-modal" class="modal" tabindex="-1" role="dialog">
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if showLikes}}
|
{{#if showLikes}}
|
||||||
<div class=" d-flex justify-content-center non-printable">
|
<div class=" d-flex justify-content-center no-print">
|
||||||
<div class="vote-box">
|
<div class="vote-box">
|
||||||
{{#unless voteThanks}}
|
{{#unless voteThanks}}
|
||||||
<div class="prompt">
|
<div class="prompt">
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
{{#if session.authenticated}}
|
{{#if session.authenticated}}
|
||||||
{{#if hasPins}}
|
{{#if hasPins}}
|
||||||
<div class="bookmarks" id="user-pins-button">
|
<div class="bookmarks" id="user-pins-button">
|
||||||
<i class={{concat "dicon " constants.Icon.Bookmark}}></i>
|
<i class={{concat "dicon " constants.Icon.BookmarkSolid}}></i>
|
||||||
{{#attach-popover class="ember-attacher-popper" hideOn="clickout" showOn="click" isShown=false}}
|
{{#attach-popover class="ember-attacher-popper" hideOn="clickout" showOn="click" isShown=false}}
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
{{#if hasSpacePins}}
|
{{#if hasSpacePins}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue