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
5 changes: 2 additions & 3 deletions resources/js/components/templates/ButtonCard.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div :class="{'d-flex': button.helperEnabled}">
<b-card no-body class="button-card" @mouseenter="addHoverClass" @mouseleave="removeHoverClass" @click="$emit('card-button-clicked')">
<b-card no-body class="button-card" :class="{'col-6 p-0': button.helperEnabled}" @mouseenter="addHoverClass" @mouseleave="removeHoverClass" @click="$emit('card-button-clicked')">
<div class="card-body text-center d-flex justify-content-center flex-column">
<i class="icon mb-1 text-primary" :class="button.icon"></i>
<h5 class="m-0">{{ button.title }}</h5>
</div>
</b-card>

<div v-if="button.helperEnabled" class="helper-container">
<div v-if="button.helperEnabled" class="helper-container col-6 p-0">
<div class="arrow-left"></div>
<b-card no-body class="button-card card-helper p-4">
<div class="card-body card-helper text-center d-flex justify-content-center flex-column">
Expand Down Expand Up @@ -41,7 +41,6 @@ export default {

<style lang="scss" scoped>
.button-card {
width: 292px;
height: 172px;
border-radius: 4px;
padding: 10px 8px 10px 8px;
Expand Down
119 changes: 66 additions & 53 deletions resources/js/components/templates/TemplateSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,69 @@
</b-input-group>
</div>

<b-card-group id="template-options" deck class="d-flex small-deck-margin">
<button-card
v-show="component === 'template-select-card'"
:button="blankProcessButton"
@show-details="showDetails($event)"
@card-button-clicked="$emit('blank-process-button-clicked')"
/>

<div v-if="packageAi">
<div class="cards-container">
<b-card-group id="template-options" deck class="d-flex small-deck-margin">
<button-card
v-if="component === 'template-select-card'"
:button="aiProcessButton"
class="col-4 p-0"
v-show="component === 'template-select-card'"
:button="blankProcessButton"
@show-details="showDetails($event)"
@card-button-clicked="$emit('ai-process-button-clicked')"
@card-button-clicked="$emit('blank-process-button-clicked')"
/>
</div>
<div v-if="component === 'template-select-card'" class="d-flex w-100 align-items-center my-3 card-separator">
<small class="mr-2 text-secondary">Templates</small>
<div class="flex-grow-1 border-bottom"></div>
</div>

</b-card-group>

<div class="pb-2 template-container">
<template v-if="noResults === true">
<div class="no-data-icon d-flex d-block justify-content-center mt-5 pt-5 pb-2">
<i class="fas fa-umbrella-beach mt-5 pt-5" />
</div>
<div class="no-data d-block d-flex justify-content-center">
{{ $t('No Data Available') }}
</div>
</template>
<template v-else>
<b-card-group id="template-options" deck class="d-flex small-deck-margin">
<template-select-card
v-show="component === 'template-select-card'"
v-for="(template, index) in templates"
:key="index"
:template="template"
<div v-if="packageAi" class="col-8 p-0">
<button-card
v-if="component === 'template-select-card'"
:button="aiProcessButton"
@show-details="showDetails($event)"
@card-button-clicked="$emit('ai-process-button-clicked')"
/>
</b-card-group>
</template>
<template-details v-if="component === 'template-details'" :template="template"></template-details>
<template v-else>
<b-pagination
v-model="currentPage"
v-if="templates.length > 0"
class="template-modal-pagination"
:total-rows="totalRow"
:per-page="perPage"
:limit="limit"
prev-class="caretBtn prevBtn"
next-class="caretBtn nextBtn"
size="sm"
last-number
first-number
></b-pagination>
</template>
</div>
<div v-if="component === 'template-select-card'" class="d-flex w-100 align-items-center my-3 card-separator">
<small class="mr-2 text-secondary">Templates</small>
<div class="flex-grow-1 border-bottom"></div>
</div>

</b-card-group>

<div class="pb-2 template-container">
<template v-if="noResults === true">
<div class="no-data-icon d-flex d-block justify-content-center mt-5 pt-5 pb-2">
<i class="fas fa-umbrella-beach mt-5 pt-5" />
</div>
<div class="no-data d-block d-flex justify-content-center">
{{ $t('No Data Available') }}
</div>
</template>
<template v-else>
<b-card-group id="template-options" deck class="d-flex small-deck-margin template-options">
<template-select-card
v-show="component === 'template-select-card'"
v-for="(template, index) in templates"
:key="index"
:template="template"
@show-details="showDetails($event)"
/>
</b-card-group>
</template>
<template-details v-if="component === 'template-details'" :template="template"></template-details>
</div>
</div>
<template v-if="component !== 'template-details'">
<b-pagination
v-model="currentPage"
v-if="templates.length > 0"
class="template-modal-pagination"
:total-rows="totalRow"
:per-page="perPage"
:limit="limit"
prev-class="caretBtn prevBtn"
next-class="caretBtn nextBtn"
size="sm"
last-number
first-number
></b-pagination>
</template>
</div>
</template>

Expand Down Expand Up @@ -212,4 +215,14 @@ export default {
margin-left: 0.7rem;
margin-right: 0.7rem;
}
.cards-container {
overflow-y: auto;
overflow-x: hidden;
height: 415px;
}
.template-options {
display: flex;
flex-wrap: wrap;
padding-left: 0;
}
</style>
7 changes: 5 additions & 2 deletions resources/js/components/templates/TemplateSelectCard.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="pb-2">
<div class="pb-2 template-select-card-container">
<b-card no-body class="template-select-card" @click="showDetails()" @mouseenter="addHoverClass" @mouseleave="removeHoverClass">
<b-card-body :title="template.name | str_limit(30)" class="card-body">
<b-card-text class="mb-2">
Expand Down Expand Up @@ -63,8 +63,11 @@ export default {
</script>

<style lang="scss" scoped>
.template-select-card-container {
flex: 0 0 33.333333%;
}
.template-select-card {
width: 292px;
// width: 292px;
height: 172px;
border-radius: 4px;
padding: 10px 8px 10px 8px;
Expand Down