file previews
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import {selectRecord, toggleAll} from "./functions/recordSelect.js";
|
||||
import Checkbox from "../common/Checkbox.svelte";
|
||||
import Preview from "../files/Preview.svelte";
|
||||
import {fileurl} from "../files/imageserver.js";
|
||||
|
||||
const channel = getContext("channel");
|
||||
|
||||
@@ -80,15 +81,38 @@
|
||||
|
||||
{/if}
|
||||
{#if record._file?.path}
|
||||
<Preview record={record} size={record._file?.width > 0 ? "medium" : "tiny"}/>
|
||||
<div class="file-table-row">
|
||||
<Preview record={record} size={record._file?.width > 0 ? "medium" : "small"}/>
|
||||
<div>
|
||||
<a
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
target={inModal ? "_blank" : "_self"}
|
||||
>
|
||||
{previewTitle(channel.schemas, record, graph)}
|
||||
</a>
|
||||
<span>{(record._file.size / 1024).toFixed(1)}kB</span>
|
||||
|
||||
{#if record._file.width > 0}
|
||||
<span>{record._file.width + "x" + record._file.height}</span>
|
||||
{/if}
|
||||
<a
|
||||
href="{fileurl(record)}"
|
||||
target="_blank"
|
||||
>
|
||||
Download
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{:else}
|
||||
<a
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
target={inModal ? "_blank" : "_self"}
|
||||
>
|
||||
{previewTitle(channel.schemas, record, graph)}
|
||||
</a>
|
||||
{/if}
|
||||
<a
|
||||
class="me-2 text-decoration-none text-dark fs-6"
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
target={inModal ? "_blank" : "_self"}
|
||||
>
|
||||
{previewTitle(channel.schemas, record, graph)}
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -7,49 +7,42 @@
|
||||
</script>
|
||||
|
||||
{#if schema.type === "files"}
|
||||
<div class="row mb-4">
|
||||
<div class="col" style="max-width:276px">
|
||||
<div class="record-edit-file-preview">
|
||||
<div>
|
||||
<Preview {record} size="large"/>
|
||||
</div>
|
||||
<div class="col">
|
||||
<ul class="list-group ">
|
||||
<li class="list-group-item border-primary">
|
||||
<span class="text-muted">Filename</span>
|
||||
<span>{record._file.path}</span>
|
||||
</li>
|
||||
<li class="list-group-item border-primary">
|
||||
<span class="text-muted">Original name</span>
|
||||
<span>{record._file.originalName}</span>
|
||||
</li>
|
||||
<li class="list-group-item border-primary">
|
||||
<span class="text-muted">Mime type</span>
|
||||
<span>{record._file.mime}</span>
|
||||
</li>
|
||||
{#if record._file.width}
|
||||
<li class="list-group-item border-primary">
|
||||
<span class="text-muted">Dimensions</span>
|
||||
<span>{record._file.width}x{record._file.height}</span>
|
||||
</li>
|
||||
{/if}
|
||||
<li class="list-group-item border-primary">
|
||||
<span class="text-muted">File size</span>
|
||||
<span>{(record._file.size / 1024).toFixed(1)}kB</span>
|
||||
</li>
|
||||
<li class="list-group-item border-primary">
|
||||
<span class="text-muted">Checksum</span>
|
||||
<span>{record._file.checksum}</span>
|
||||
</li>
|
||||
<li class="list-group-item border-primary">
|
||||
<span class="text-muted">Download</span>
|
||||
<a href="{fileurl(record)}">{record._file.path}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="file-details">
|
||||
|
||||
<div class="file-details-item">
|
||||
<span class="text-muted">Filename</span>
|
||||
<span>{record._file.path}</span>
|
||||
</div>
|
||||
<div class="file-details-item">
|
||||
<span class="text-muted">Original name</span>
|
||||
<span>{record._file.originalName}</span>
|
||||
</div>
|
||||
<div class="file-details-item">
|
||||
<span class="text-muted">Mime type</span>
|
||||
<span>{record._file.mime}</span>
|
||||
</div>
|
||||
{#if record._file.width}
|
||||
<div class="file-details-item">
|
||||
<span class="text-muted">Dimensions</span>
|
||||
<span>{record._file.width}x{record._file.height}</span>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="file-details-item">
|
||||
<span class="text-muted">File size</span>
|
||||
<span>{(record._file.size / 1024).toFixed(1)}kB</span>
|
||||
</div>
|
||||
<div class="file-details-item">
|
||||
<span class="text-muted">Checksum</span>
|
||||
<span>{record._file.checksum}</span>
|
||||
</div>
|
||||
<div class="file-details-item">
|
||||
<a class="button primary" target="_blank" style="display: inline-flex" href="{fileurl(record)}">Download</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.list-group {
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -36,10 +36,7 @@ export function previewTitle(schemas, record, graph) {
|
||||
|
||||
function noTemplate(schema, record) {
|
||||
if (schema?.type === "files") {
|
||||
if(record._file.width === 0){
|
||||
return record._file.path;
|
||||
}
|
||||
return record._file.path + " " + record._file.width+"x"+record._file.height ;
|
||||
return record._file.path;
|
||||
}
|
||||
|
||||
let title = stripHtml(
|
||||
|
||||
@@ -21,7 +21,7 @@ dialog {
|
||||
border-radius: 12px;
|
||||
overflow: auto;
|
||||
max-height: 96vh;
|
||||
box-shadow: none;
|
||||
box-shadow: none!important;
|
||||
//position: relative;
|
||||
|
||||
.close {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
flex-grow: 1;
|
||||
top: 35px;
|
||||
min-width: max-content;
|
||||
border: 1px solid var(--p30);
|
||||
|
||||
|
||||
&.orientation-right {
|
||||
|
||||
@@ -44,12 +44,25 @@
|
||||
margin: 6px 0;
|
||||
border-color: transparent;
|
||||
|
||||
.button{
|
||||
.button {
|
||||
background: var(--p30);
|
||||
&:hover{
|
||||
|
||||
&:hover {
|
||||
background: var(--p40);
|
||||
}
|
||||
}
|
||||
|
||||
dialog {
|
||||
.button {
|
||||
background: var(--p20);
|
||||
|
||||
&:hover {
|
||||
background: var(--p30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.field-header {
|
||||
@@ -109,4 +122,24 @@
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.record-edit-file-preview {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
|
||||
.file-details {
|
||||
width: 50%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
|
||||
}
|
||||
|
||||
.file-details-item {
|
||||
.text-muted {
|
||||
color: var(--grey-dark);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+116
-94
@@ -1,106 +1,128 @@
|
||||
.table {
|
||||
min-width: 600px;
|
||||
overflow: auto;
|
||||
min-width: 600px;
|
||||
overflow: auto;
|
||||
background: var(--p20);
|
||||
padding: 1px;
|
||||
font-size: 14px;
|
||||
border-radius: 12px;
|
||||
|
||||
table {
|
||||
background: var(--p20);
|
||||
padding: 1px;
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
border-collapse: separate;
|
||||
border: none;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
thead {
|
||||
border-radius: 12px;
|
||||
table {
|
||||
|
||||
tr {
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
th {
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
max-width: 400px;
|
||||
border: none;
|
||||
background: var(--p20);
|
||||
text-align: left;
|
||||
padding: 8px 16px;
|
||||
|
||||
&.is-sort {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
border-radius: 12px 0 0 0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-radius: 0 12px 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
td {
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
max-width: 400px;
|
||||
height: 48px;
|
||||
padding: 4px 16px;
|
||||
border: none;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
//img{
|
||||
// width: 48px;
|
||||
//}
|
||||
|
||||
.status {
|
||||
color: var(--text);
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.row-name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.title-td-contents {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 14px;
|
||||
line-height: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
tbody {
|
||||
tr {
|
||||
border-radius: 12px;
|
||||
background: var(--p10);
|
||||
border: none;
|
||||
|
||||
&:has(input:checked) {
|
||||
background: var(--p30);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: var(--p20);
|
||||
width: 100%;
|
||||
border-collapse:separate;
|
||||
border: none;
|
||||
border-spacing: 0;
|
||||
}
|
||||
}
|
||||
thead{
|
||||
border-radius: 12px;
|
||||
tr{
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
th {
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
max-width: 400px;
|
||||
border: none;
|
||||
background: var(--p20);
|
||||
text-align: left;
|
||||
padding: 8px 16px;
|
||||
|
||||
&.is-sort {
|
||||
font-weight: 700;
|
||||
}
|
||||
&:first-child{
|
||||
border-radius: 12px 0 0 0 ;
|
||||
}
|
||||
&:last-child{
|
||||
border-radius: 0 12px 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
td {
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
max-width: 400px;
|
||||
height: 48px;
|
||||
padding: 4px 16px;
|
||||
border: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
//img{
|
||||
// width: 48px;
|
||||
//}
|
||||
tr:nth-child(odd) {
|
||||
//background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.status{
|
||||
color:var(--text);
|
||||
font-size: 80%;
|
||||
}
|
||||
.row-name{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
td:nth-child(odd) {
|
||||
// border-left: 1px solid #e4e4e4;
|
||||
// border-right: 1px solid #e4e4e4;
|
||||
}
|
||||
|
||||
.title-td-contents{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 14px;
|
||||
line-height: 14px;
|
||||
}
|
||||
}
|
||||
tbody{
|
||||
tr {
|
||||
border-radius: 12px;
|
||||
background: var(--p10);
|
||||
border: none;
|
||||
&:has(input:checked){
|
||||
background: var(--p30);
|
||||
}
|
||||
&:hover{
|
||||
background: var(--p20);
|
||||
}
|
||||
}
|
||||
}
|
||||
th:nth-child(odd) {
|
||||
|
||||
}
|
||||
|
||||
tr:nth-child(odd) {
|
||||
//background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
td:nth-child(odd) {
|
||||
// border-left: 1px solid #e4e4e4;
|
||||
// border-right: 1px solid #e4e4e4;
|
||||
}
|
||||
th:nth-child(odd) {
|
||||
|
||||
}
|
||||
|
||||
.field-ui-number {
|
||||
text-align: right;
|
||||
}
|
||||
.field-ui-number {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.file-table-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
|
||||
& > div {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
gap: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user