File attachments: show file size, bold filename, make icon bigger
FREEBIE
This commit is contained in:
parent
2a04fa02df
commit
ee00ad0e15
4 changed files with 39 additions and 17 deletions
|
@ -152,8 +152,11 @@
|
||||||
<a class='x close' alt='remove attachment' href='#'></a>
|
<a class='x close' alt='remove attachment' href='#'></a>
|
||||||
</script>
|
</script>
|
||||||
<script type='text/x-tmpl-mustache' id='file-view'>
|
<script type='text/x-tmpl-mustache' id='file-view'>
|
||||||
<span class='icon'></span>
|
<div class='icon'></div>
|
||||||
<span class='fileName' alt='{{ fileName }}' title='{{ altText }}'>{{ fileName }}</a>
|
<div class='text'>
|
||||||
|
<div class='fileName' alt='{{ fileName }}' title='{{ altText }}'>{{ fileName }}</div>
|
||||||
|
<div class='fileSize'>{{ fileSize }}</div>
|
||||||
|
</div>
|
||||||
</script>
|
</script>
|
||||||
<script type='text/x-tmpl-mustache' id='hasRetry'>
|
<script type='text/x-tmpl-mustache' id='hasRetry'>
|
||||||
{{ messageNotSent }}
|
{{ messageNotSent }}
|
||||||
|
|
|
@ -9,10 +9,7 @@
|
||||||
className: 'fileView',
|
className: 'fileView',
|
||||||
templateName: 'file-view',
|
templateName: 'file-view',
|
||||||
render_attributes: function() {
|
render_attributes: function() {
|
||||||
return {
|
return this.model;
|
||||||
fileName : this.model.fileName,
|
|
||||||
altText : i18n('unsupportedAttachment')
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -163,7 +160,14 @@
|
||||||
this.renderFileView();
|
this.renderFileView();
|
||||||
},
|
},
|
||||||
renderFileView: function() {
|
renderFileView: function() {
|
||||||
this.view = new FileView({model: {fileName: this.suggestedName()}});
|
this.view = new FileView({
|
||||||
|
model: {
|
||||||
|
fileName: this.suggestedName(),
|
||||||
|
fileSize: window.filesize(this.model.size),
|
||||||
|
altText: i18n('unsupportedAttachment')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.view.$el.appendTo(this.$el.empty());
|
this.view.$el.appendTo(this.$el.empty());
|
||||||
this.view.render();
|
this.view.render();
|
||||||
this.update();
|
this.update();
|
||||||
|
|
|
@ -466,21 +466,30 @@ li.entry .error-icon-container {
|
||||||
}
|
}
|
||||||
|
|
||||||
.fileView {
|
.fileView {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
|
||||||
background-color: #fafafa;
|
background-color: #fafafa;
|
||||||
border: 1px solid $grey_l2;
|
border: 1px solid $grey_l2;
|
||||||
border-radius: $border-radius;
|
border-radius: $border-radius;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: $grey_d;
|
color: $grey_d;
|
||||||
|
|
||||||
.icon, .fileName {
|
.fileName {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon, .text {
|
||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
.icon, .fileName {
|
.icon, .text {
|
||||||
opacity: 1.0;
|
opacity: 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -491,8 +500,8 @@ li.entry .error-icon-container {
|
||||||
&:before {
|
&:before {
|
||||||
content: '';
|
content: '';
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: $button-height;
|
width: $button-height * 2;
|
||||||
height: $button-height;
|
height: $button-height * 2;
|
||||||
@include color-svg('/images/file.svg', black);
|
@include color-svg('/images/file.svg', black);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1315,6 +1315,8 @@ li.entry .error-icon-container {
|
||||||
cursor: pointer; }
|
cursor: pointer; }
|
||||||
.message-container .attachments .fileView,
|
.message-container .attachments .fileView,
|
||||||
.message-list .attachments .fileView {
|
.message-list .attachments .fileView {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
@ -1323,13 +1325,17 @@ li.entry .error-icon-container {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #454545; }
|
color: #454545; }
|
||||||
.message-container .attachments .fileView .icon, .message-container .attachments .fileView .fileName,
|
.message-container .attachments .fileView .fileName,
|
||||||
.message-list .attachments .fileView .icon,
|
|
||||||
.message-list .attachments .fileView .fileName {
|
.message-list .attachments .fileView .fileName {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 0.25em; }
|
||||||
|
.message-container .attachments .fileView .icon, .message-container .attachments .fileView .text,
|
||||||
|
.message-list .attachments .fileView .icon,
|
||||||
|
.message-list .attachments .fileView .text {
|
||||||
opacity: 0.75; }
|
opacity: 0.75; }
|
||||||
.message-container .attachments .fileView:hover .icon, .message-container .attachments .fileView:hover .fileName,
|
.message-container .attachments .fileView:hover .icon, .message-container .attachments .fileView:hover .text,
|
||||||
.message-list .attachments .fileView:hover .icon,
|
.message-list .attachments .fileView:hover .icon,
|
||||||
.message-list .attachments .fileView:hover .fileName {
|
.message-list .attachments .fileView:hover .text {
|
||||||
opacity: 1.0; }
|
opacity: 1.0; }
|
||||||
.message-container .attachments .fileView .icon,
|
.message-container .attachments .fileView .icon,
|
||||||
.message-list .attachments .fileView .icon {
|
.message-list .attachments .fileView .icon {
|
||||||
|
@ -1339,8 +1345,8 @@ li.entry .error-icon-container {
|
||||||
.message-list .attachments .fileView .icon:before {
|
.message-list .attachments .fileView .icon:before {
|
||||||
content: '';
|
content: '';
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 24px;
|
width: 48px;
|
||||||
height: 24px;
|
height: 48px;
|
||||||
-webkit-mask: url("/images/file.svg") no-repeat center;
|
-webkit-mask: url("/images/file.svg") no-repeat center;
|
||||||
-webkit-mask-size: 100%;
|
-webkit-mask-size: 100%;
|
||||||
background-color: black; }
|
background-color: black; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue