Minor style tweaks to attachments form

This commit is contained in:
Pablo Vazquez 2016-11-02 14:51:10 +01:00
parent 3fc08bcafd
commit f30cdd5246
4 changed files with 55 additions and 39 deletions

View File

@ -42,13 +42,13 @@ class CustomFileSelectWidget(HiddenInput):
except ResourceNotFound: except ResourceNotFound:
pass pass
else: else:
button.append(u'<div class="form-upload-file-meta-container">')
filename = Markup.escape(file_item.filename) filename = Markup.escape(file_item.filename)
if file_item.content_type.split('/')[0] == 'image': if file_item.content_type.split('/')[0] == 'image':
# If a file of type image is available, display the preview # If a file of type image is available, display the preview
button.append(u'<img class="preview-thumbnail" src="{0}" />'.format( button.append(u'<img class="preview-thumbnail" src="{0}" />'.format(
file_item.thumbnail('s', api=api))) file_item.thumbnail('s', api=api)))
else:
button.append(u'<p>{}</p>'.format(filename))
button.append(u'<ul class="form-upload-file-meta">') button.append(u'<ul class="form-upload-file-meta">')
# File name # File name
@ -73,6 +73,7 @@ class CustomFileSelectWidget(HiddenInput):
u'<i class="pi-download"></i>Original</a></li>' u'<i class="pi-download"></i>Original</a></li>'
.format(file_item.link)) .format(file_item.link))
button.append(u'</ul>') button.append(u'</ul>')
button.append(u'</div>')
upload_url = u'%sstorage/stream/{project_id}' % current_app.config[ upload_url = u'%sstorage/stream/{project_id}' % current_app.config[
'PILLAR_SERVER_ENDPOINT'] 'PILLAR_SERVER_ENDPOINT']

View File

@ -2371,27 +2371,7 @@ section.node-children
cursor: progress cursor: progress
.fieldlist .fieldlist
list-style: none
padding: 0
margin: 0
li.fieldlist-item li.fieldlist-item
background-color: $color-background-light
border: thin solid $color-background
border-bottom: 2px solid $color-background
border-radius: 3px
margin-bottom: 10px
padding: 0 15px
display: flex
flex-direction: row-reverse
align-items: center
.form-group
margin-bottom: 0 !important
.form-upload-file
margin-bottom: 0 !important
div[class*="map_type"], div[class*="map_type"],
div[class*="is_tileable"] div[class*="is_tileable"]
padding: 10px 15px padding: 10px 15px

View File

@ -156,9 +156,8 @@
box-shadow: none box-shadow: none
=label-generic =label-generic
color: $color-text-dark color: $color-text-dark-primary
font-family: $font-body font-weight: normal
font-weight: 300
@mixin badge($mixin-color, $roundness) @mixin badge($mixin-color, $roundness)
padding: padding:

View File

@ -760,10 +760,43 @@ label, label.control-label
+label-generic +label-generic
/* File Upload forms */
.fieldlist
list-style: none
padding: 0
margin: 10px 0 0 0
li.fieldlist-item
background-color: $color-background-light
border: thin solid $color-background
border-left: 3px solid $color-primary
border-top-right-radius: 3px
border-bottom-right-radius: 3px
margin-bottom: 10px
padding: 10px
display: flex
flex-direction: column
align-items: center
.form-group
margin-bottom: 0 !important // override bs
width: 100%
&:not(:first-child)
border-top: thin solid $color-background-dark
padding-top: 10px
input.form-control
background-color: white !important
padding: 0 10px !important
border: thin solid $color-background-dark !important
.form-upload-file .form-upload-file
width: 100% width: 100%
margin: 10px 0 margin-bottom: 10px
+clearfix display: flex
flex-direction: column
.form-upload-progress .form-upload-progress
margin-top: 10px margin-top: 10px
@ -783,32 +816,35 @@ label, label.control-label
.preview-thumbnail .preview-thumbnail
width: 50px width: 50px
height: 50px height: 50px
margin-right: 10px
margin-bottom: 10px
border-radius: 3px border-radius: 3px
background-color: $color-background background-color: $color-background
margin-right: 10px
float: left .form-upload-file-meta-container
display: flex
.form-upload-file-meta .form-upload-file-meta
float: left
width: 80%
list-style: none list-style: none
font-size: .9em
padding: 0 padding: 0
margin: 0 margin: 0 0 10px 0
width: 100%
display: flex
li li
float: left display: inline-block
padding: 5px padding: 5px 10px
&:first-child
padding-left: 0
&.dimensions, &.size &.dimensions, &.size
color: $color-text-dark-secondary color: $color-text-dark-secondary
&.delete, &.original &.delete
float: right margin-left: auto
&.name &.name
width: 75px
max-width: 75px
+text-overflow-ellipsis +text-overflow-ellipsis
.file_delete .file_delete