Tweaks to style of file attachments

This commit is contained in:
Pablo Vazquez 2016-11-02 19:42:44 +01:00
parent ef326a2193
commit 324d500edb
4 changed files with 37 additions and 12 deletions

View File

@ -60,6 +60,13 @@ class CustomFileSelectWidget(HiddenInput):
if file_item.content_type.split('/')[0] == 'image': if file_item.content_type.split('/')[0] == 'image':
button.append(u'<li class="dimensions">{0}x{1}</li>'.format( button.append(u'<li class="dimensions">{0}x{1}</li>'.format(
file_item.width, file_item.height)) file_item.width, file_item.height))
button.append(u'</ul>')
button.append(u'<ul class="form-upload-file-actions">')
# Download button for original file
button.append(u'<li class="original">'
u'<a href="{}" class="file_original"> '
u'<i class="pi-download"></i>Original</a></li>'
.format(file_item.link))
# Delete button # Delete button
button.append(u'<li class="delete">' button.append(u'<li class="delete">'
u'<a href="#" class="file_delete" ' u'<a href="#" class="file_delete" '
@ -67,11 +74,6 @@ class CustomFileSelectWidget(HiddenInput):
u'data-file_id="{file_id}"> ' u'data-file_id="{file_id}"> '
u'<i class="pi-trash"></i> Delete</a></li>'.format( u'<i class="pi-trash"></i> Delete</a></li>'.format(
field_name=field.name, file_id=field.data)) field_name=field.name, file_id=field.data))
# Download button for original file
button.append(u'<li class="original">'
u'<a href="{}" class="file_original"> '
u'<i class="pi-download"></i>Original</a></li>'
.format(file_item.link))
button.append(u'</ul>') button.append(u'</ul>')
button.append(u'</div>') button.append(u'</div>')

View File

@ -191,8 +191,6 @@
z-index: $z-index-base + 3 z-index: $z-index-base + 3
position: fixed position: fixed
top: $project_header-height top: $project_header-height
left: 0
right: 0
height: $project_header-height height: $project_header-height
min-height: $project_header-height min-height: $project_header-height
width: auto width: auto
@ -2174,7 +2172,6 @@ section.node-children
.form-group .form-group
position: relative position: relative
margin: 0 auto 30px auto margin: 0 auto 30px auto
font-family: $font-body
input, textarea, select input, textarea, select
+input-generic +input-generic
@ -2357,6 +2354,12 @@ section.node-children
pointer-events: none pointer-events: none
cursor: progress cursor: progress
.fieldlist
li.fieldlist-item
div[class$="file"]
width: 75%
margin: 0
.files-header .files-header
width: 100% width: 100%
@ -2378,6 +2381,7 @@ section.node-children
div[class*="is_tileable"] div[class*="is_tileable"]
padding: 10px 15px padding: 10px 15px
width: 25% width: 25%
float: right
border-left: thin solid $color-background border-left: thin solid $color-background
div[class*="map_type"] div[class*="map_type"]
@ -2392,7 +2396,9 @@ section.node-children
padding-left: 0 padding-left: 0
div[class$="file"] div[class$="file"]
flex: 1 float: left
width: auto
label label
display: none display: none

View File

@ -825,8 +825,10 @@ label, label.control-label
.preview-thumbnail .preview-thumbnail
width: 50px width: 50px
height: 50px height: 50px
min-width: 50px
min-height: 50px
margin-right: 10px margin-right: 10px
margin-bottom: 10px margin-top: 5px
border-radius: 3px border-radius: 3px
background-color: $color-background background-color: $color-background
@ -836,10 +838,11 @@ label, label.control-label
.form-upload-file-meta .form-upload-file-meta
list-style: none list-style: none
padding: 0 padding: 0
margin: 0 0 10px 0 margin: 0
width: 100% width: 100%
display: flex display: flex
flex-wrap: wrap flex-wrap: wrap
flex: 1
li li
display: inline-block display: inline-block
@ -860,6 +863,20 @@ label, label.control-label
.file_delete .file_delete
color: $color-danger color: $color-danger
.form-upload-file-actions
list-style: none
padding: 0
margin: 0
display: flex
flex-wrap: wrap
li
display: inline-block
padding: 5px 10px
.file_delete
color: $color-danger
.form-group .form-group
&.error &.error
.form-control, input .form-control, input

View File

@ -6,7 +6,7 @@
.checkbox .checkbox
label label
| {{ field(class='checkbox') }} | {{ field(class='checkbox') }}
| {{ field.name | undertitle }} label {{ field.name | undertitle }}
| {% elif field.type == 'FieldList' %} | {% elif field.type == 'FieldList' %}