modalcard accordeon improved

This commit is contained in:
Bachir Soussi Chiadmi 2021-03-09 14:53:22 +01:00
parent a1bff5d4b8
commit e29bed914c
4 changed files with 103 additions and 12 deletions

View File

@ -2060,6 +2060,10 @@ article.card {
height: 2em; } height: 2em; }
article.card.modal-card section.col-right .vsa-list .vsa-item .vsa-item__heading button.vsa-item__trigger:hover, article.card.modal-card section.col-right .vsa-list .vsa-item .vsa-item__heading button.vsa-item__trigger:focus { article.card.modal-card section.col-right .vsa-list .vsa-item .vsa-item__heading button.vsa-item__trigger:hover, article.card.modal-card section.col-right .vsa-list .vsa-item .vsa-item__heading button.vsa-item__trigger:focus {
color: var(--vsa-text-color); } color: var(--vsa-text-color); }
article.card.modal-card section.col-right .vsa-list .vsa-item .vsa-item__heading {
padding-bottom: 0.2em; }
article.card.modal-card section.col-right .vsa-list .vsa-item .vsa-item__heading > button {
border-bottom: 0.5px dotted #1A1A1A; }
article.card.modal-card section.col-right section.linked-materials > ul { article.card.modal-card section.col-right section.linked-materials > ul {
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;

File diff suppressed because one or more lines are too long

View File

@ -1248,6 +1248,12 @@ article.card{
} }
} }
} }
.vsa-item__heading{
padding-bottom: 0.2em;
>button{
border-bottom: 0.5px dotted $color-main-text;
}
}
.vsa-item__content{ .vsa-item__content{
} }

View File

@ -33,23 +33,35 @@
{{ coll.name }} {{ coll.name }}
</span> </span>
</li> </li>
<li v-if="collsLength<15" class="create-flag">
<input
placeholder="new folder"
v-model="new_folder_name"
@keyup.enter.prevent.stop="onCreateFlagColl"
/>
<span
class="add-btn mdi"
:class="addFlagBtnClassObj"
@click.prevent.stop="onCreateFlagColl"
/>
</li>
</ul> </ul>
</div> </div>
</section> </section>
<!-- <section class="tool samples" v-if="item.samples && item.samples.length"> <section class="tool samples" v-if="item.samples && item.samples.length">
<span class="btn mdi mdi-beaker-outline"/> <span class="btn mdi mdi-beaker-outline"/>
<div class="tool-content"> <div class="tool-content">
<span class="label">{{ $t("materio.Samples") }}</span> <span class="label">{{ $t("materio.Samples") }}</span>
<ul> <ul>
<li <li
v-for="sample in material.samples" v-for="sample in item.samples"
:key="sample.showroom.id" :key="sample.showroom.id"
> >
<span class="showroom">{{ sample.showroom.name }}</span>: {{ sample.location }} <span class="showroom">{{ sample.showroom.name }}</span>: {{ sample.location }}
</li> </li>
</ul> </ul>
</div> </div>
</section> --> </section>
<section class="tool note"> <section class="tool note">
<span class="btn mdi mdi-square-edit-outline"/> <span class="btn mdi mdi-square-edit-outline"/>
<div class="tool-content"> <div class="tool-content">
@ -98,10 +110,48 @@
</vsa-heading> </vsa-heading>
<vsa-content> <vsa-content>
<section class="body" v-html="material.body"/> <section class="body" v-html="material.body"/>
<section class="attachments">
<!-- <h4 class="label">{{ $t("materio.Attachments") }}</h4> -->
<ul>
<li
v-for="attachmt in material.attachments" :key="attachmt.file.fid"
>
<a target="_blank" :href="attachmt.file.url">{{ attachmt.file.filename}} <span>({{ prettyFileSize(attachmt.file.filesize) }})</span></a>
<p v-if="attachmt.description" class="description" v-html="attachmt.description" />
</li>
</ul>
</section>
<section class="industriels">
<!-- <h4 class="label">{{ $t("default.Contact") }}</h4> -->
<section v-if="material.manufacturer">
<span class="label">{{ $t("materio.Manufacturer") }}</span>
<ul>
<li v-for="manu in material.manufacturer" v-bind:key="manu.id">
<h2>{{ manu.name }}</h2>
<p v-if="manu.website">
<a target="_blank" :href="manu.website.url">{{shortUrl(manu.website.url)}}</a>
</p>
<p v-if="manu.email"><a :href="'mailto:'+manu.email">{{ manu.email }}</a></p>
</li>
</ul>
</section>
<section v-if="material.distributor">
<span class="label">{{ $t("materio.Distributor") }}</span>
<ul>
<li v-for="distrib in material.distributor" v-bind:key="distrib.id">
<h2>{{ distrib.name }}</h2>
<p v-if="distrib.website">
<a target="_blank" :href="distrib.website.url">{{shortUrl(distrib.website.url)}}</a>
</p>
<p v-if="distrib.email"><a :href="'mailto:'+distrib.email">{{ distrib.email }}</a></p>
</li>
</ul>
</section>
</section>
</vsa-content> </vsa-content>
</vsa-item> </vsa-item>
<vsa-item v-if="item.samples && item.samples.length"> <!-- <vsa-item v-if="item.samples && item.samples.length">
<vsa-heading> <vsa-heading>
<span class="label">{{ $t("materio.Samples") }}</span> <span class="label">{{ $t("materio.Samples") }}</span>
</vsa-heading> </vsa-heading>
@ -117,7 +167,7 @@
</ul> </ul>
</section> </section>
</vsa-content> </vsa-content>
</vsa-item> </vsa-item> -->
<vsa-item v-if="material.linked_materials"> <vsa-item v-if="material.linked_materials">
<vsa-heading> <vsa-heading>
@ -134,7 +184,7 @@
</vsa-content> </vsa-content>
</vsa-item> </vsa-item>
<vsa-item v-if="material.manufacturer || material.distributor"> <!-- <vsa-item v-if="material.manufacturer || material.distributor">
<vsa-heading> <vsa-heading>
<span class="label">{{ $t("default.Contact") }}</span> <span class="label">{{ $t("default.Contact") }}</span>
</vsa-heading> </vsa-heading>
@ -166,9 +216,9 @@
</section> </section>
</section> </section>
</vsa-content> </vsa-content>
</vsa-item> </vsa-item> -->
<vsa-item v-if="material.attachments && material.attachments.length"> <!-- <vsa-item v-if="material.attachments && material.attachments.length">
<vsa-heading> <vsa-heading>
<span class="label">{{ $t("materio.Attachments") }}</span> <span class="label">{{ $t("materio.Attachments") }}</span>
</vsa-heading> </vsa-heading>
@ -184,7 +234,7 @@
</ul> </ul>
</section> </section>
</vsa-content> </vsa-content>
</vsa-item> </vsa-item> -->
</vsa-list> </vsa-list>
</section> </section>
<section class="col col-left images" v-switcher> <section class="col col-left images" v-switcher>
@ -244,6 +294,8 @@ export default {
material: null, material: null,
loading: false, loading: false,
blanksrc:`${drupalSettings.path.themePath}/assets/img/blank.gif`, blanksrc:`${drupalSettings.path.themePath}/assets/img/blank.gif`,
new_folder_name: "",
is_creating_folder: false,
loadingFlag: false, loadingFlag: false,
lightbox_index: null, lightbox_index: null,
note: "", note: "",
@ -255,7 +307,18 @@ export default {
csrf_token: state => state.User.csrf_token, csrf_token: state => state.User.csrf_token,
flagcolls: state => state.User.flagcolls, flagcolls: state => state.User.flagcolls,
showrooms: state => state.Showrooms.showrooms_by_tid showrooms: state => state.Showrooms.showrooms_by_tid
}) }),
collsLength() {
return Object.keys(this.flagcolls).length
},
addFlagBtnClassObj() {
return {
'mdi-plus-circle-outline': !this.is_creating_folder,
'mdi-loading': this.is_creating_folder,
active: this.new_folder_name.length > 4 && !this.is_creating_folder,
loading: this.is_creating_folder
}
}
}, },
created () { created () {
console.log('modale item', this.item) console.log('modale item', this.item)
@ -271,6 +334,7 @@ export default {
}, },
methods: { methods: {
...mapActions({ ...mapActions({
createFlagColl: 'User/createFlagColl',
flagUnflag: 'User/flagUnflag' flagUnflag: 'User/flagUnflag'
}), }),
loadMaterial(){ loadMaterial(){
@ -304,6 +368,23 @@ export default {
Promise.reject(error) Promise.reject(error)
}) })
}, },
onCreateFlagColl () {
console.log("Card onCreateFlagColl", this.new_folder_name)
this.is_creating_folder = true;
this.createFlagColl(this.new_folder_name)
.then(data => {
console.log("Card onCreateFlagColl then", data);
this.new_folder_name = "";
this.is_creating_folder = false;
let collid = data.id
this.loadingFlag = collid;
this.flagUnflag({ action: 'flag', id: this.item.id, collid: collid})
.then(data => {
console.log("onFlagActionCard then", data);
this.loadingFlag = false;
})
})
},
flagIsActive(collid) { flagIsActive(collid) {
// console.log(this.item.uuid); // console.log(this.item.uuid);
// console.log(this.flagcolls[collid].items_uuids); // console.log(this.flagcolls[collid].items_uuids);