mirror of
https://github.com/documize/community.git
synced 2025-07-23 07:09:43 +02:00
[WIP] refactoring start document UX
This commit is contained in:
parent
aee9345886
commit
18fc5db8c6
13 changed files with 145 additions and 198 deletions
|
@ -118,18 +118,6 @@ export default Component.extend(AuthMixin, {
|
|||
});
|
||||
},
|
||||
|
||||
onImport() {
|
||||
this.attrs.onRefresh();
|
||||
},
|
||||
|
||||
onStartDocument() {
|
||||
this.set('showStartDocument', !this.get('showStartDocument'));
|
||||
},
|
||||
|
||||
onHideStartDocument() {
|
||||
this.set('showStartDocument', false);
|
||||
},
|
||||
|
||||
onDocumentFilter(filter, id) {
|
||||
let docs = this.get('documents');
|
||||
let categories = this.get('categories');
|
||||
|
|
|
@ -56,7 +56,7 @@ export default Component.extend(NotifierMixin, AuthMixin, {
|
|||
|
||||
$('#add-space-modal').on('show.bs.modal', function(event) { // eslint-disable-line no-unused-vars
|
||||
schedule('afterRender', () => {
|
||||
$("#new-space-name").focus();
|
||||
$("#new-document-name").focus();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -86,11 +86,6 @@ export default Component.extend(NotifierMixin, AuthMixin, {
|
|||
folderId: this.get('space.id')
|
||||
};
|
||||
|
||||
if (is.empty(pin.pin)) {
|
||||
$('#pin-space-name').addClass('error').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
this.get('pinned').pinItem(pin).then((pin) => {
|
||||
$('#pin-space-button').tooltip('dispose');
|
||||
this.set('pinState.isPinned', true);
|
||||
|
@ -149,6 +144,14 @@ export default Component.extend(NotifierMixin, AuthMixin, {
|
|||
$('#add-space-modal').modal('dispose');
|
||||
|
||||
this.attrs.onAddSpace(payload);
|
||||
},
|
||||
|
||||
onImport() {
|
||||
this.attrs.onRefresh();
|
||||
},
|
||||
|
||||
onHideStartDocument() {
|
||||
// this.set('showStartDocument', false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
{{layout/nav-bar}}
|
||||
|
||||
<div class="container">
|
||||
{{toolbar/for-space spaces=model.folders space=model.folder permissions=model.permissions onDeleteSpace=(action 'onDeleteSpace')}}
|
||||
{{toolbar/for-space
|
||||
spaces=model.folders
|
||||
space=model.folder
|
||||
permissions=model.permissions
|
||||
templates=model.templates
|
||||
onRefresh=(action 'onRefresh')
|
||||
onDeleteSpace=(action 'onDeleteSpace')}}
|
||||
|
||||
{{folder/space-view
|
||||
spaces=model.folders
|
||||
|
|
6
gui/app/styles/bootstrap.scss
vendored
6
gui/app/styles/bootstrap.scss
vendored
|
@ -45,12 +45,12 @@ $modal-footer-border-color: $color-white;
|
|||
}
|
||||
|
||||
// rounded corners
|
||||
$border-radius: .125rem;
|
||||
$border-radius-lg: .15rem;
|
||||
$border-radius-sm: .1rem;
|
||||
$border-radius: 0;
|
||||
$border-radius-lg: 0;
|
||||
$border-radius-sm: 0;
|
||||
$border-radius: .125rem;
|
||||
$border-radius-lg: .15rem;
|
||||
$border-radius-sm: .1rem;
|
||||
|
||||
// dropdown
|
||||
$dropdown-link-color: $color-off-black;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
.modal-content {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
@import "document.scss";
|
||||
@import "wizard.scss";
|
||||
@import "settings.scss";
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
.move-document-options {
|
||||
height: 200px;
|
||||
overflow-y: auto;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
> .option {
|
||||
vertical-align: bottom;
|
||||
cursor: pointer;
|
||||
font-size: 0.9rem;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
||||
> .material-icons {
|
||||
font-size: 0.9rem;
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
|
||||
> .selected {
|
||||
color: $color-link;
|
||||
}
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
.new-document-wizard {
|
||||
@include content-container();
|
||||
|
||||
.import-document-button {
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
margin: 0 0 30px 0;
|
||||
text-align: center;
|
||||
color: $color-gray;
|
||||
cursor: pointer;
|
||||
font-size: 1.2rem;
|
||||
line-height: 1.7rem;
|
||||
@include ease-in();
|
||||
@extend .no-select;
|
||||
border: 1px solid $color-stroke;
|
||||
background-color: $color-off-white;
|
||||
|
||||
&:hover {
|
||||
border-color: $color-link;
|
||||
color: $color-link;
|
||||
}
|
||||
|
||||
> .dz-preview,
|
||||
.dz-processing {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
> .input-control {
|
||||
> .list-wrapper {
|
||||
> .template-list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
.item {
|
||||
@include ease-in();
|
||||
@include border-radius(4px);
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
background-color: $color-blue;
|
||||
margin: 0 20px 20px 0;
|
||||
padding: 12px 0 0 20px;
|
||||
width: 423px;
|
||||
height: 60px;
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
@include ease-in();
|
||||
border-color: $color-link;
|
||||
|
||||
> .template-actions {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
> .template-actions {
|
||||
@include ease-in();
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 8px;
|
||||
|
||||
.material-icons {
|
||||
color: $color-stroke;
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
> .details {
|
||||
width: 350px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
> .title {
|
||||
font-size: 1rem;
|
||||
font-weight: normal;
|
||||
color: $color-white;
|
||||
letter-spacing: 0.5px;
|
||||
margin-top: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
> .desc {
|
||||
color: $color-white;
|
||||
font-size: 0.8rem;
|
||||
margin-top: 5px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
87
gui/app/styles/view/new-doc.scss
Normal file
87
gui/app/styles/view/new-doc.scss
Normal file
|
@ -0,0 +1,87 @@
|
|||
.new-document-wizard {
|
||||
|
||||
> .import-zone {
|
||||
.import-document-button {
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
margin: 0 0 30px 0;
|
||||
text-align: center;
|
||||
color: $color-gray;
|
||||
cursor: pointer;
|
||||
font-size: 1.2rem;
|
||||
line-height: 1.7rem;
|
||||
@include ease-in();
|
||||
@extend .no-select;
|
||||
border: 1px solid $color-stroke;
|
||||
background-color: $color-off-white;
|
||||
|
||||
&:hover {
|
||||
border-color: $color-link;
|
||||
color: $color-link;
|
||||
}
|
||||
|
||||
> .dz-preview,
|
||||
.dz-processing {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> .fresh-zone {
|
||||
> .template-list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
.item {
|
||||
@include ease-in();
|
||||
@include border-radius(4px);
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
background-color: $color-blue;
|
||||
margin: 0 20px 20px 0;
|
||||
padding: 12px 0 0 20px;
|
||||
height: 60px;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
border-color: $color-link;
|
||||
|
||||
> .template-actions {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
> .template-actions {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 8px;
|
||||
|
||||
.material-icons {
|
||||
color: $color-stroke;
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
> .details {
|
||||
> .title {
|
||||
font-size: 1rem;
|
||||
font-weight: normal;
|
||||
color: $color-white;
|
||||
letter-spacing: 0.5px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
> .desc {
|
||||
color: $color-white;
|
||||
font-size: 0.8rem;
|
||||
margin-top: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
@import "spaces.scss";
|
||||
@import "space.scss";
|
||||
@import "new-doc.scss";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{folder/space-heading space=space permissions=permissions}}
|
||||
{{folder/space-heading space=space permissions=permissions }}
|
||||
|
||||
{{#if hasCategories}}
|
||||
<div class="clearfix">
|
||||
|
@ -33,6 +33,3 @@
|
|||
{{folder/documents-list documents=filteredDocs spaces=spaces space=space
|
||||
templates=templates permissions=permissions
|
||||
onDeleteDocument=(action 'onDeleteDocument') onMoveDocument=(action 'onMoveDocument')}}
|
||||
|
||||
{{folder/start-document folder=space templates=templates permissions=permissions
|
||||
onImport=(action 'onImport') onHideStartDocument=(action 'onHideStartDocument')}}
|
||||
|
|
|
@ -1,48 +1,39 @@
|
|||
<div id="new-document-wizard" class="new-document-wizard">
|
||||
|
||||
<div class="input-control pull-left width-80">
|
||||
<label>Document Name</label>
|
||||
<div class="tip">Provide a concise name for the new document</div>
|
||||
{{focus-input type="text" id="new-document-name" value=newDocumentName class=(if newDocumentNameMissing 'document-name error-inline' 'document-name mousetrap') autocomplete="off"}}
|
||||
</div>
|
||||
<div class="round-button-mono pull-right" {{action 'onHideStartDocument'}}>
|
||||
<i class="material-icons color-gray">close</i>
|
||||
</div>
|
||||
<div class="clearfix" />
|
||||
<div class="import-zone">
|
||||
<div id="import-document-button" class="import-document-button">
|
||||
Click to select or drag-drop files <br/>(doc, docx, md, markdown)
|
||||
</div>
|
||||
|
||||
<div class="input-control">
|
||||
<label>Select Template</label>
|
||||
<div class="tip">Start a blank document or pick a template</div>
|
||||
|
||||
<div class="list-wrapper">
|
||||
<ul class="template-list">
|
||||
{{#each savedTemplates key="id" as |template|}}
|
||||
<li class="item">
|
||||
{{#if permissions.documentTemplate}}
|
||||
{{#unless template.locked}}
|
||||
<div class="template-actions">
|
||||
<i class="material-icons" {{action 'editTemplate' template}}>mode_edit</i>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
<div class="details" {{action 'startDocument' template}}>
|
||||
<div class='title'>{{template.title}}</div>
|
||||
<div class='desc'>{{template.description}}</div>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
<div class="import-status">
|
||||
{{#each importStatus as |status|}}
|
||||
<p>{{status}}</p>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="import-document-button" class="import-document-button">
|
||||
Alternatively, click to select or drag-drop files <br/>(doc, docx, md, markdown)
|
||||
</div>
|
||||
|
||||
<div class="import-status">
|
||||
{{#each importStatus as |status|}}
|
||||
<p>{{status}}</p>
|
||||
{{/each}}
|
||||
<div class="fresh-zone">
|
||||
<div class="form-group">
|
||||
<label for="new-document-name">Or start new document</label>
|
||||
{{input type='text' id="new-document-name" class="form-control mousetrap" placeholder="Provide document name" value=newDocumentName class=(if newDocumentNameMissing 'document-name is-invalid' 'document-name mousetrap') autocomplete="off"}}
|
||||
</div>
|
||||
<ul class="template-list">
|
||||
{{#each savedTemplates key="id" as |template|}}
|
||||
<li class="item">
|
||||
{{#if permissions.documentTemplate}}
|
||||
{{#unless template.locked}}
|
||||
<div class="template-actions">
|
||||
<i class="material-icons" {{action 'editTemplate' template}}>mode_edit</i>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
<div class="details text-truncate" {{action 'startDocument' template}}>
|
||||
<div class='title text-truncate'>{{template.title}}</div>
|
||||
<div class='desc text-truncate'>{{template.description}}</div>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -57,14 +57,11 @@
|
|||
<div class="modal" tabindex="-1" role="dialog" id="add-space-modal">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Add Space</div>
|
||||
<div class="modal-header">New Document</div>
|
||||
<div class="modal-body">
|
||||
<form onsubmit={{action 'onAddSpace'}}>
|
||||
<div class="form-group">
|
||||
<label for="new-space-name">Space Name</label>
|
||||
{{input type='text' id="new-space-name" class="form-control mousetrap" placeholder="Space name" value=spaceName}}
|
||||
<small id="emailHelp" class="form-text text-muted">Characters and numbers only</small>
|
||||
</div>
|
||||
{{folder/start-document folder=space templates=templates permissions=permissions
|
||||
onImport=(action 'onImport') onHideStartDocument=(action 'onHideStartDocument')}}
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue