Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/app_local.example.php
Original file line number Diff line number Diff line change
Expand Up @@ -614,10 +614,12 @@
// 'bearing' => 'integer',
// 'pitch' => 'integer',
// 'zoom' => 'integer',
// 'caption' => 'richtext'
// ],
// 'videos' => [
// 'controls' => 'boolean',
// 'autoplay' => 'boolean',
// 'caption' => 'richtext',
// ],
// ],

Expand Down
69 changes: 56 additions & 13 deletions resources/js/app/components/placeholder-list/placeholder-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,54 @@
v-for="item in items"
:key="itemKey(item)"
>
<app-icon v-if="item.obj?.type === 'audio'" icon="carbon:document-audio" height="24" />
<app-icon v-if="item.obj?.type === 'documents'" icon="carbon:document" height="24" />
<app-icon v-if="item.obj?.type === 'events'" icon="carbon:event" height="24" />
<app-icon v-if="item.obj?.type === 'files'" icon="carbon:document-blank" height="24" />
<app-icon v-if="item.obj?.type === 'images'" icon="carbon:image" height="24" />
<app-icon v-if="item.obj?.type === 'links'" icon="carbon:link" height="24" />
<app-icon v-if="item.obj?.type === 'locations'" icon="carbon:location" height="24" />
<app-icon v-if="item.obj?.type === 'news'" icon="carbon:calendar" height="24" />
<app-icon v-if="item.obj?.type === 'profiles'" icon="carbon:person" height="24" />
<app-icon v-if="item.obj?.type === 'publications'" icon="carbon:wikis" height="24" />
<app-icon v-if="item.obj?.type === 'videos'" icon="carbon:video" height="24" />
<div class="placeholder-item-name">
<app-icon icon="carbon:document-audio"
height="24"
v-if="item.obj?.type === 'audio'"
/>
<app-icon icon="carbon:document"
height="24"
v-if="item.obj?.type === 'documents'"
/>
<app-icon icon="carbon:event"
height="24"
v-if="item.obj?.type === 'events'"
/>
<app-icon icon="carbon:document-blank"
height="24"
v-if="item.obj?.type === 'files'"
/>
<app-icon icon="carbon:image"
height="24"
v-if="item.obj?.type === 'images'"
/>
<app-icon icon="carbon:link"
height="24"
v-if="item.obj?.type === 'links'"
/>
<app-icon icon="carbon:location"
height="24"
v-if="item.obj?.type === 'locations'"
/>
<app-icon icon="carbon:calendar"
height="24"
v-if="item.obj?.type === 'news'"
/>
<app-icon icon="carbon:person"
height="24"
v-if="item.obj?.type === 'profiles'"
/>
<app-icon icon="carbon:wikis"
height="24"
v-if="item.obj?.type === 'publications'"
/>
<app-icon icon="carbon:video"
height="24"
v-if="item.obj?.type === 'videos'"
/>

<span>{{ item.obj?.title }}</span>
<span>{{ item.obj?.title }}</span>
</div>
<placeholder-params
:id="item.id"
:field="field"
Expand Down Expand Up @@ -163,11 +198,19 @@ div.placeholdersList > div.header {
}
div.placeholdersList > div.placeholder-item {
display: grid;
grid-template-columns: 5% 60% 1fr;
grid-template-columns: 35% 60% 1fr;
text-align: left;
align-items: center;
gap: 8px;
padding: 4px 0;
margin: 4px 0;
border-top: dotted 1px #ccc;
}
div.placeholdersList > div.placeholder-item > div.placeholder-item-name {
display: flex;
align-items: start;
align-self: flex-start;
gap: 8px;
margin: 4px 0;
}
</style>
67 changes: 55 additions & 12 deletions resources/js/app/components/placeholder-list/placeholder-params.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,51 @@
<template>
<div class="placeholderParams">
<div v-for="column in Object.keys(parameters)">
<span>{{ t(column) }}</span>
<div v-for="column in Object.keys(parameters)"
:key="column"
>
<span class="paramName">{{ t(column) }}</span>
<template v-if="parameters[column] === 'integer'">
<input type="number" :placeholder="column" v-model="decodedValue[column]" @change="changeParams" />
<input type="number"
:placeholder="column"
v-model="decodedValue[column]"
@change="changeParams"
>
</template>
<template v-if="parameters[column] === 'string'">
<input type="text" :placeholder="column" v-model="decodedValue[column]" @change="changeParams" />
<input type="text"
:placeholder="column"
v-model="decodedValue[column]"
@change="changeParams"
>
</template>
<template v-if="parameters[column] === 'boolean'">
<input type="checkbox" v-model="decodedValue[column]" @click="changeParams" />
<input type="checkbox"
v-model="decodedValue[column]"
@change="changeParams"
>
</template>
<template v-if="parameters[column] === 'richtext'">
<field-textarea
:id="`${column}-${Math.random().toString(36)}`"
:name="column"
:field="column"
:value="decodedValue[column]"
@change="(value) => changeRichText(value, column)"
/>
</template>
<template v-if="typeof parameters[column] === 'object' ">
<select v-model="decodedValue[column]" @change="changeParams">
<option v-for="option in parameters[column]" :value="option">{{ t(option) }}</option>
</select>
<div>
<select v-model="decodedValue[column]"
@change="changeParams"
>
<option v-for="option in parameters[column]"
:key="option"
:value="option"
>
{{ t(option) }}
</option>
</select>
</div>
</template>
</div>
</div>
Expand Down Expand Up @@ -82,6 +113,14 @@ export default {
});
this.oldValue = this.newValue;
},
changeParamsBoolean(value, column) {
this.decodedValue[column] = value;
this.changeParams();
},
changeRichText(value, column) {
this.decodedValue[column] = value;
this.changeParams();
},
decoded(item) {
return atob(item);
},
Expand All @@ -90,11 +129,15 @@ export default {
</script>
<style>
div.placeholderParams {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
text-align: center;
align-items: center;
display: flex;
flex-direction: column;
gap: 8px;
margin: 4px 0;
}

.paramName {
display: block;
margin-bottom: 4px;
text-transform: capitalize;
}
</style>
Loading