From f30cdd5246aa05221287dbcd47a6f45cba61caf4 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Wed, 2 Nov 2016 14:51:10 +0100 Subject: [PATCH] Minor style tweaks to attachments form --- pillar/web/utils/forms.py | 5 +-- src/styles/_project.sass | 20 ------------ src/styles/_utils.sass | 5 ++- src/styles/base.sass | 64 ++++++++++++++++++++++++++++++--------- 4 files changed, 55 insertions(+), 39 deletions(-) diff --git a/pillar/web/utils/forms.py b/pillar/web/utils/forms.py index 9c06c9a4..e0bfe7b0 100644 --- a/pillar/web/utils/forms.py +++ b/pillar/web/utils/forms.py @@ -42,13 +42,13 @@ class CustomFileSelectWidget(HiddenInput): except ResourceNotFound: pass else: + button.append(u'
') + filename = Markup.escape(file_item.filename) if file_item.content_type.split('/')[0] == 'image': # If a file of type image is available, display the preview button.append(u''.format( file_item.thumbnail('s', api=api))) - else: - button.append(u'

{}

'.format(filename)) button.append(u'') + button.append(u'
') upload_url = u'%sstorage/stream/{project_id}' % current_app.config[ 'PILLAR_SERVER_ENDPOINT'] diff --git a/src/styles/_project.sass b/src/styles/_project.sass index fddde19f..f930f9c9 100644 --- a/src/styles/_project.sass +++ b/src/styles/_project.sass @@ -2371,27 +2371,7 @@ section.node-children cursor: progress .fieldlist - list-style: none - padding: 0 - margin: 0 - 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*="is_tileable"] padding: 10px 15px diff --git a/src/styles/_utils.sass b/src/styles/_utils.sass index 360bd93b..70edf1be 100644 --- a/src/styles/_utils.sass +++ b/src/styles/_utils.sass @@ -156,9 +156,8 @@ box-shadow: none =label-generic - color: $color-text-dark - font-family: $font-body - font-weight: 300 + color: $color-text-dark-primary + font-weight: normal @mixin badge($mixin-color, $roundness) padding: diff --git a/src/styles/base.sass b/src/styles/base.sass index 5a181727..be111ae6 100644 --- a/src/styles/base.sass +++ b/src/styles/base.sass @@ -760,10 +760,43 @@ label, label.control-label +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 width: 100% - margin: 10px 0 - +clearfix + margin-bottom: 10px + display: flex + flex-direction: column .form-upload-progress margin-top: 10px @@ -783,32 +816,35 @@ label, label.control-label .preview-thumbnail width: 50px height: 50px + margin-right: 10px + margin-bottom: 10px border-radius: 3px background-color: $color-background - margin-right: 10px - float: left + + .form-upload-file-meta-container + display: flex .form-upload-file-meta - float: left - width: 80% list-style: none - font-size: .9em padding: 0 - margin: 0 + margin: 0 0 10px 0 + width: 100% + display: flex li - float: left - padding: 5px + display: inline-block + padding: 5px 10px + + &:first-child + padding-left: 0 &.dimensions, &.size color: $color-text-dark-secondary - &.delete, &.original - float: right + &.delete + margin-left: auto &.name - width: 75px - max-width: 75px +text-overflow-ellipsis .file_delete