mirror of
https://github.com/documize/community.git
synced 2025-07-23 15:19:42 +02:00
Merge pull request #48 from documize/edit-template
edit saved templates
This commit is contained in:
commit
06ef6d3a09
4 changed files with 33 additions and 21 deletions
|
@ -39,6 +39,7 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
||||||
title: "Empty",
|
title: "Empty",
|
||||||
description: "An empty canvas for your words",
|
description: "An empty canvas for your words",
|
||||||
img: "template-blank",
|
img: "template-blank",
|
||||||
|
locked: true
|
||||||
};
|
};
|
||||||
|
|
||||||
saved.forEach(function(t) {
|
saved.forEach(function(t) {
|
||||||
|
|
|
@ -179,7 +179,7 @@
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
background-image: url("/assets/img/no-documents.png");
|
background-image: url("/assets/img/no-documents.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
|
||||||
> .box {
|
> .box {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
|
@ -209,25 +209,10 @@
|
||||||
|
|
||||||
> .item {
|
> .item {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
cursor: pointer;
|
|
||||||
padding: 10px 5px;
|
padding: 10px 5px;
|
||||||
margin: 5px 0;
|
margin: 20px 0;
|
||||||
@include ease-in();
|
@include ease-in();
|
||||||
|
|
||||||
&:hover {
|
|
||||||
@include ease-in();
|
|
||||||
|
|
||||||
> .details {
|
|
||||||
> .title {
|
|
||||||
color: $color-primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .desc {
|
|
||||||
color: $color-primary;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -240,12 +225,26 @@
|
||||||
height: 40px;
|
height: 40px;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .edit-control {
|
||||||
|
color: $color-gray;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
text-align: center;
|
||||||
|
float: left;
|
||||||
|
margin: 5px 0 0 9px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: $color-link;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .details {
|
> .details {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
> .title {
|
> .title {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
|
@ -255,10 +254,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
> .desc {
|
> .desc {
|
||||||
color: $color-gray;
|
color: $color-off-black;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
> .title, > .desc {
|
||||||
|
color: $color-link !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
{{folder/start-document
|
{{folder/start-document
|
||||||
savedTemplates=savedTemplates
|
savedTemplates=savedTemplates
|
||||||
folder=folder
|
folder=folder
|
||||||
|
editor=folderService.canEditCurrentFolder
|
||||||
onEditTemplate=(action 'onEditTemplate')
|
onEditTemplate=(action 'onEditTemplate')
|
||||||
onDocumentTemplate=(action 'onDocumentTemplate')}}
|
onDocumentTemplate=(action 'onDocumentTemplate')}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -2,12 +2,17 @@
|
||||||
|
|
||||||
<div class="templates-list">
|
<div class="templates-list">
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
{{#each savedTemplates key="id"as |template|}}
|
{{#each savedTemplates key="id" as |template|}}
|
||||||
<li class="item" {{action 'startDocument' template}}>
|
<li class="item">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<img class="img" src="/assets/img/{{template.img}}.png" srcset="/assets/img/{{template.img}}@2x.png" />
|
<img class="img" src="/assets/img/{{template.img}}.png" srcset="/assets/img/{{template.img}}@2x.png" />
|
||||||
|
{{#if editor}}
|
||||||
|
{{#unless template.locked}}
|
||||||
|
<div class="edit-control" {{action 'editTemplate' template}}>edit</div>
|
||||||
|
{{/unless}}
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="details">
|
<div class="details" {{action 'startDocument' template}}>
|
||||||
<div class='title'>
|
<div class='title'>
|
||||||
{{template.title}}
|
{{template.title}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue