Skip to content

Commit

Permalink
Add if for display specialties
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu MARTIN committed Jul 18, 2024
1 parent 9ed81c5 commit fdaba6b
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions resources/js/Pages/Character/Partials/Skills.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ const showDescription = async (entity, id) => {
</template>

<template #content>
<div class="grid grid-cols-3 gap-x-2 justify-center px-2 pb-4 w-full">
<div class="grid grid-cols-3 gap-2 flex justify-center px-2 pb-4 w-full">
<div class="flex flex-col">
<h2 class="column_title">Physiques</h2>
<h2 class="column_title mb-1">Physiques</h2>
<div
v-for="(attribute, index) in physical_skills"
:key="index"
Expand All @@ -70,20 +70,23 @@ const showDescription = async (entity, id) => {
:value="attribute.pivot.attribute_value"
/>

<p class="my-2 text-skin-50 text-sm lg:text-lg">
<p
v-if="attribute.pivot.specialties"
class="my-2 text-skin-50 text-sm lg:text-lg"
>
{{ attribute.pivot.specialties }}
</p>
</div>
</div>
<div class="flex flex-col items-center">
<h2 class="column_title">Sociales</h2>
<h2 class="column_title mb-1">Sociales</h2>
<div
v-for="(attribute, index) in social_skills"
:key="index"
class="flex flex-col items-center"
>
<p
class="my-2 attribute_title"
class="attribute_title"
@click="showDescription('attribute', attribute.id)"
>
{{ attribute.name }}
Expand All @@ -94,14 +97,17 @@ const showDescription = async (entity, id) => {
:value="attribute.pivot.attribute_value"
/>

<p class="my-2 text-skin-50 text-sm lg:text-lg">
<p
v-if="attribute.pivot.specialties"
class="text-skin-50 text-sm lg:text-lg"
>
{{ attribute.pivot.specialties }}
</p>
</div>
</div>

<div class="flex flex-col items-end">
<h2 class="column_title">Mentales</h2>
<h2 class="column_title mb-1">Mentales</h2>
<div
v-for="(attribute, index) in mental_skills"
:key="index"
Expand All @@ -119,7 +125,10 @@ const showDescription = async (entity, id) => {
:value="attribute.pivot.attribute_value"
/>

<p class="text-skin-50 text-sm lg:text-lg">
<p
v-if="attribute.pivot.specialties"
class="text-skin-50 text-sm lg:text-lg"
>
{{ attribute.pivot.specialties }}
</p>
</div>
Expand Down

0 comments on commit fdaba6b

Please sign in to comment.