Fix documents list UI

pull/3890/head
Julio Montoya 4 years ago
parent bcc9e910c5
commit a6ac179a68
  1. 2
      assets/css/app.scss
  2. 35
      assets/vue/views/documents/List.vue
  3. 3
      assets/vue/views/documents/ResourceFileIcon.vue

@ -155,6 +155,6 @@ a.router-link-exact-active {
@import "~primeicons/primeicons.css"; @import "~primeicons/primeicons.css";
//@import "~jquery-ui-timepicker-addon/dist/jquery-ui-timepicker-addon.css"; //@import "~jquery-ui-timepicker-addon/dist/jquery-ui-timepicker-addon.css";
//@import "~@fancyapps/fancybox/dist/jquery.fancybox.css"; @import "~@fancyapps/fancybox/dist/jquery.fancybox.css";
//@import "~jquery-contextmenu/dist/jquery.contextMenu.css"; //@import "~jquery-contextmenu/dist/jquery.contextMenu.css";
//@import '~pretty-checkbox/src/pretty-checkbox.scss'; //@import '~pretty-checkbox/src/pretty-checkbox.scss';

@ -40,6 +40,7 @@
<Toolbar class="p-mb-4"> <Toolbar class="p-mb-4">
<template #left> <template #left>
<div class="flex flex-row gap-2">
<!-- <Button label="New" icon="pi pi-plus" class="p-button-primary p-button-sm p-mr-2" @click="openNew" />--> <!-- <Button label="New" icon="pi pi-plus" class="p-button-primary p-button-sm p-mr-2" @click="openNew" />-->
<Button label="New" icon="pi pi-plus" class="btn btn-primary" @click="openNew" /> <Button label="New" icon="pi pi-plus" class="btn btn-primary" @click="openNew" />
@ -49,6 +50,7 @@
<Button label="Upload" icon="pi pi-plus" class="btn btn-primary" @click="uploadDocumentHandler()" /> <Button label="Upload" icon="pi pi-plus" class="btn btn-primary" @click="uploadDocumentHandler()" />
<Button label="Delete" icon="pi pi-trash" class="btn btn-danger " @click="confirmDeleteSelected" :disabled="!selectedItems || !selectedItems.length" /> <Button label="Delete" icon="pi pi-trash" class="btn btn-danger " @click="confirmDeleteSelected" :disabled="!selectedItems || !selectedItems.length" />
</div>
</template> </template>
<!-- <template #right>--> <!-- <template #right>-->
@ -75,7 +77,30 @@
currentPageReportTemplate="Showing {first} to {last} of {totalRecords}" currentPageReportTemplate="Showing {first} to {last} of {totalRecords}"
> >
<Column selectionMode="multiple" style="width: 3rem" :exportable="false"></Column> <Column selectionMode="multiple" style="width: 3rem" :exportable="false"></Column>
<Column field="resourceNode.title" :header="$t('Title')" :sortable="true"></Column> <Column field="resourceNode.title" :header="$t('Title')" :sortable="true">
<template #body="slotProps">
<div v-if="slotProps.data.resourceNode.resourceFile">
<a
data-fancybox="gallery"
:href="slotProps.data.contentUrl"
>
<ResourceFileIcon :file="slotProps.data" />
{{ slotProps.data.title }}
</a>
</div>
<div v-else>
<a @click="handleClick(slotProps.data)" class="cursor-pointer" >
<font-awesome-icon
icon="folder"
size="lg"
/>
{{ slotProps.data.resourceNode.title }}
</a>
</div>
</template>
</Column>
<Column field="resourceNode.updatedAt" :header="$t('Modified')" :sortable="true"> <Column field="resourceNode.updatedAt" :header="$t('Modified')" :sortable="true">
<template #body="slotProps"> <template #body="slotProps">
{{$luxonDateTime.fromISO(slotProps.data.resourceNode.updatedAt).toRelative() }} {{$luxonDateTime.fromISO(slotProps.data.resourceNode.updatedAt).toRelative() }}
@ -92,9 +117,11 @@
<Column :exportable="false"> <Column :exportable="false">
<template #body="slotProps"> <template #body="slotProps">
<Button label="Show" class="p-button-sm p-button p-button-success p-mr-2" @click="showHandler(slotProps.data)" /> <div class="flex flex-row gap-2">
<Button label="Edit" icon="pi pi-pencil" class="p-button-sm p-button p-button-success p-mr-2" @click="editHandler(slotProps.data)" /> <Button label="Show" class="p-button-sm p-button p-button-success p-mr-2" @click="showHandler(slotProps.data)" />
<Button label="Delete" icon="pi pi-trash" class="p-button-sm p-button p-button-danger" @click="confirmDeleteSelected(slotProps.data)" /> <Button label="Edit" icon="pi pi-pencil" class="p-button-sm p-button p-button-success p-mr-2" @click="editHandler(slotProps.data)" />
<Button label="Delete" icon="pi pi-trash" class="p-button-sm p-button p-button-danger" @click="confirmDeleteSelected(slotProps.data)" />
</div>
</template> </template>
</Column> </Column>

@ -3,16 +3,19 @@
<font-awesome-icon <font-awesome-icon
v-if="file.image" v-if="file.image"
icon="file-image" icon="file-image"
size="lg"
/> />
<font-awesome-icon <font-awesome-icon
v-else-if="file.video" v-else-if="file.video"
icon="file-video" icon="file-video"
size="lg"
/> />
<font-awesome-icon <font-awesome-icon
v-else v-else
icon="file-alt" icon="file-alt"
size="lg"
/> />
</span> </span>
</template> </template>

Loading…
Cancel
Save