diff --git a/src/formio/templates/file.ejs b/src/formio/templates/file.ejs index 009c48b79..10899a309 100644 --- a/src/formio/templates/file.ejs +++ b/src/formio/templates/file.ejs @@ -1,53 +1,55 @@ {%/* taken from https://github.com/formio/formio.js/blob/v4.12.7/src/templates/bootstrap/file/form.ejs */%} {% if (!ctx.self.imageUpload) { %} - - - - {% if (!ctx.disabled) { %} - - {% } %} - - - {% if (ctx.self.hasTypes) { %} - - {% } %} - - - - {% ctx.files.forEach(function(file) { %} - + - {% } %} - - - {% if (ctx.self.hasTypes && !ctx.disabled) { %} - +
{% } %} - {% if (ctx.self.hasTypes && ctx.disabled) { %} - +
{{ctx.t('File Name')}}
+
{{ctx.t('Size')}}
+ {% if (ctx.self.hasTypes) { %} +
{{ctx.t('Type')}}
{% } %} + + + {% ctx.files.forEach(function(file) { %} +
  • +
    + {% if (!ctx.disabled) { %} +
    + +
    + {% } %} +
    + {% if (ctx.component.uploadOnly) { %} + {{{file.originalName || file.name}}} + {% } else { %} + {{{file.originalName || file.name}}} + {% } %} +
    +
    + {{ctx.fileSize(file.size)}} +
    + {% if (ctx.self.hasTypes) { %} +
    + {% if (!ctx.disabled) { %} + + {% } else { %} + {{file.fileType}} + {% } %} +
    + {% } %}
    -
  • + {% }) %} - -
    {{ctx.t('File Name')}}{{ctx.t('Size')}}{{ctx.t('Type')}}
    - - - {% if (ctx.component.uploadOnly) { %} - {{{file.originalName || file.name}}} - {% } else { %} - {{{file.originalName || file.name}}} - {% } %} - {{ctx.fileSize(file.size)}} - - {{file.fileType}}
    + {% } else { %}
    {% ctx.files.forEach(function(file) { %} diff --git a/src/scss/components/_file-upload.scss b/src/scss/components/_file-upload.scss index ff7e87217..9d669a0ab 100644 --- a/src/scss/components/_file-upload.scss +++ b/src/scss/components/_file-upload.scss @@ -15,33 +15,28 @@ we don't have strict BEM naming here. @include body; @include anchor.extend-utrecht-link; - .table { - width: 100%; - margin-block-end: 20px; - border-collapse: collapse; - - &__header { - border-bottom: solid 1px var(--of-color-border); - } + .list-group { + padding: 0; + margin: 0; + list-style: none; + @include margin(auto); - &__column { - text-align: left; - - &--1 { - @include bootstrap-span(width, 1); - } + .list-group-header { + @include hide-on-mobile(block); - &--2 { - @include bootstrap-span(width, 2); - } - - &--7 { - @include bootstrap-span(width, 7); + .row { + border-bottom: solid 1px var(--of-color-border); } + } - &--9 { - @include bootstrap-span(width, 9); - } + .list-group-item { + @include responsive( + padding-top, + $grid-margin-1, + $grid-margin-1, + $grid-margin-1, + $grid-margin-1 + ); } } @@ -49,6 +44,31 @@ we don't have strict BEM naming here. display: flex; align-items: center; + .col-md-1 { + @include bootstrap-span(width, 1); + @include mobile-only { + flex-grow: 1; + } + } + .col-md-2 { + @include bootstrap-span(width, 2); + @include mobile-only { + flex-grow: 2; + } + } + .col-md-7 { + @include bootstrap-span(width, 7); + @include mobile-only { + flex-grow: 1; + } + } + .col-md-9 { + @include bootstrap-span(width, 9); + @include mobile-only { + flex-grow: 5; + } + overflow-wrap: break-word; + } .col-sm-2 { @include bootstrap-span(width, 2); }