Merge branch '1986-claim_draggable_pictures' of verdnatura/salix into dev
gitea/salix/dev Build queued... Details

This commit is contained in:
Carlos Jimenez Ruiz 2020-01-09 08:00:35 +00:00 committed by Gitea
commit ff7c6bea6a
10 changed files with 61 additions and 45 deletions

View File

@ -11,11 +11,9 @@
.vn-droppable, .vn-droppable,
[vn-droppable] { [vn-droppable] {
display: block;
&.dropping { &.dropping {
background-color: $color-hover-cd; background-color: $color-hover-cd;
border-color: $color-bg-dark; border-color: $color-font-secondary;
} }
} }

View File

@ -7,7 +7,7 @@ vn-app {
ui-view { ui-view {
display: block; display: block;
box-sizing: border-box; box-sizing: border-box;
height: inherit; height: 100%;
&.ng-enter { &.ng-enter {
animation-name: nothing, slideIn; animation-name: nothing, slideIn;

View File

@ -87,6 +87,8 @@ vn-layout {
& > * { & > * {
display: block; display: block;
padding: $spacing-md; padding: $spacing-md;
box-sizing: border-box;
height: 100%
} }
&.ng-enter { &.ng-enter {
vn-side-menu { vn-side-menu {

View File

@ -11,7 +11,6 @@
transition: all 0.5s; transition: all 0.5s;
padding: $spacing-sm; padding: $spacing-sm;
position: relative; position: relative;
opacity: 0.7;
width: 28em; width: 28em;
.image { .image {
@ -20,6 +19,7 @@
0 1px 5px 0 rgba(0,0,0,.12); 0 1px 5px 0 rgba(0,0,0,.12);
background: no-repeat center center fixed; background: no-repeat center center fixed;
background-size: cover !important; background-size: cover !important;
border: 2px solid transparent;
overflow: hidden; overflow: hidden;
cursor: zoom-in; cursor: zoom-in;
height: 100%; height: 100%;
@ -34,7 +34,7 @@
top: 1em top: 1em
} }
} }
.photo:hover { .photo:hover .image {
opacity: 1 border: 2px solid $color-primary
} }
} }

View File

@ -5,14 +5,11 @@
data="$ctrl.photos"> data="$ctrl.photos">
</vn-crud-model> </vn-crud-model>
<section class="drop-zone" vn-droppable="$ctrl.onDrop($event)"> <vn-horizontal class="photo-list drop-zone" vn-droppable="$ctrl.onDrop($event)">
<section><vn-icon icon="add_circle"></vn-icon></section> <section class="empty-rows" ng-if="!$ctrl.photos.length">
<section translate>Drag & Drop files here...</section> <section><vn-icon icon="image"></vn-icon></section>
</section> <section translate>Drag & Drop photos here...</section>
<vn-data-viewer </section>
model="model"
class="vn-w-xl">
<vn-horizontal class="photo-list">
<section class="photo" ng-repeat="photo in $ctrl.photos"> <section class="photo" ng-repeat="photo in $ctrl.photos">
<section class="image vn-shadow" on-error-src <section class="image vn-shadow" on-error-src
ng-style="{'background': 'url(/api/dms/' + photo.dmsFk + '/downloadFile?access_token=' + $ctrl.accessToken + ')'}" ng-style="{'background': 'url(/api/dms/' + photo.dmsFk + '/downloadFile?access_token=' + $ctrl.accessToken + ')'}"
@ -28,8 +25,8 @@
</vn-button> </vn-button>
</section> </section>
</section> </section>
</vn-horizontal> </vn-horizontal>
</vn-data-viewer>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="workerDescriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>
@ -39,3 +36,9 @@
question="Are you sure you want to continue?" question="Are you sure you want to continue?"
on-response="$ctrl.deleteDms($response)"> on-response="$ctrl.deleteDms($response)">
</vn-confirm> </vn-confirm>
<vn-float-button fixed-bottom-right
icon="add"
vn-tooltip="Select photo"
vn-bind="+"
ng-click="$ctrl.openUploadDialog()">
</vn-float-button>

View File

@ -68,6 +68,19 @@ class Controller {
}); });
} }
openUploadDialog() {
const element = document.createElement('input');
element.setAttribute('type', 'file');
element.setAttribute('multiple', true);
element.click();
element.addEventListener('change', () =>
this.setDefaultParams().then(() => {
this.dms.files = element.files;
this.create();
})
);
}
create() { create() {
const query = `claims/${this.claim.id}/uploadFile`; const query = `claims/${this.claim.id}/uploadFile`;

View File

@ -2,13 +2,16 @@
vn-claim-dms-index { vn-claim-dms-index {
.drop-zone { .drop-zone {
border: 2px dashed $color-font-secondary;
color: $color-font-secondary; color: $color-font-secondary;
box-sizing: border-box; box-sizing: border-box;
padding: 2em $spacing-md;
border-radius: 0.5em; border-radius: 0.5em;
text-align: center; text-align: center;
font-size: 1.4em; min-height: 100%;
.empty-rows {
padding: 5em $spacing-md;
font-size: 1.4em
}
vn-icon { vn-icon {
font-size: 3em font-size: 3em

View File

@ -1,2 +0,0 @@
FileDescription: Ticket id {{ticketId}} from client {{clientName}} id {{clientId}}
ContentTypesInfo: Allowed file types {{allowedContentTypes}}

View File

@ -1,4 +1,5 @@
Are you sure you want to continue?: ¿Seguro que quieres continuar? Are you sure you want to continue?: ¿Seguro que quieres continuar?
Drag & Drop files here...: Arrastra y suelta archivos aquí... Drag & Drop photos here...: Arrastra y suelta fotos aquí...
Photo deleted: Foto eliminada Photo deleted: Foto eliminada
Photo uploaded!: Foto subida! Photo uploaded!: Foto subida!
Select photo: Seleccionar foto

View File

@ -1,12 +1,10 @@
@import "./variables"; @import "./variables";
vn-claim-summary { vn-claim-summary {
.photo { section.photo {
height: 15.5em; height: 15.5em
} }
.photo .image { .photo .image {
border: 2px solid $color-bg-dark; border-radius: 0.2em
border-radius: 0.2em;
} }
} }