You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.5 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <v-row class="mb-6">
  3. <v-col cols="12">
  4. <div v-if="exhibition.categories">
  5. <b>{{ $t('Categories')}}</b>
  6. <span
  7. v-for="(category, index) in exhibition.categories"
  8. :key="category.CategoryID"
  9. >
  10. <nuxt-link
  11. class="black--text"
  12. :to="localePath('/exhibition?category=' + category.CategoryID)"
  13. >
  14. <span class="text-decoration-underline">
  15. {{ category.CategoryName }}</span>
  16. </nuxt-link> <span v-if="index < exhibition.categories.length - 1"></span>
  17. </span>
  18. </div>
  19. <p></p>
  20. <div v-if="exhibition.subcategories">
  21. <b>{{ $t('Subcategories')}}</b>
  22. <span
  23. v-for="(subcategory, index) in exhibition.subcategories"
  24. :key="subcategory.CategoryID"
  25. >
  26. <nuxt-link
  27. class="black--text"
  28. :to="localePath('/exhibition?subcategory=' + subcategory.CategoryID)"
  29. >
  30. <span class="text-decoration-underline">{{ subcategory.CategoryName }}</span>
  31. </nuxt-link><span v-if="index < exhibition.subcategories.length - 1">,&nbsp;</span>
  32. </span>
  33. </div>
  34. <p></p>
  35. <div ref="profiletextarea" :class=" expand ? 'lineProfileClamp' : ''" v-html="exhibition.profile"></div>
  36. <p></p>
  37. <div class="tw-hidden lg:tw-block">
  38. <div
  39. v-if="hide"
  40. class="d-flex justify-center primary--text"
  41. @click="expand = !expand"
  42. >
  43. <a
  44. >{{ expand ? $t("See more") : $t("See less") }} &nbsp;&nbsp;<v-icon
  45. color="primary"
  46. >{{ expand ? "mdi-chevron-down" : "mdi-chevron-up" }}</v-icon
  47. ></a
  48. >
  49. </div>
  50. </div>
  51. <div class="lg:tw-hidden">
  52. <button v-if="hide"
  53. class="d-flex justify-center primary--text tw-w-full tw-body-3 tw-rounded-lg tw-text-primary-1 tw-border-solid tw-border-[1px] tw-border-primary-1 tw-py-[10px] tw-px-[130px] tw-whitespace-nowrap"
  54. @click="$modal.show('SeeMoreExhibitProfile')">
  55. See more
  56. </button>
  57. </div>
  58. <SeeMoreExhibitProfile v-bind:SeeMoreExhibitProfile="exhibition.profile" v-bind:Exhibit="exhibition"></SeeMoreExhibitProfile>
  59. </v-col>
  60. </v-row>
  61. </template>
  62. <script>
  63. import VClamp from 'vue-clamp'
  64. import SeeMoreExhibitProfile from "@/components/exhibition/SeeMoreExhibitProfile.vue";
  65. export default {
  66. name: "ExhibitionExhibitProfile",
  67. components: {
  68. VClamp,
  69. SeeMoreExhibitProfile,
  70. },
  71. props: {
  72. exhibition: {
  73. type: Object,
  74. default: () => ({
  75. categories: [],
  76. subcategories:[],
  77. })
  78. },
  79. },
  80. data() {
  81. return {
  82. expand: true,
  83. hide: false,
  84. SeeMoreExhibitProfile: {
  85. type:Object,
  86. },
  87. Exhibit: {
  88. type:Object,
  89. categories: {
  90. name: "categories.name",
  91. id: "categories.id"
  92. },
  93. subcategories: {
  94. name: "subcategories.name",
  95. id: "subcategories.id"
  96. }
  97. }
  98. };
  99. },
  100. mounted () {
  101. this.$refs.profiletextarea.scrollHeight > 120 ? this.hide = true : this.hide = false;
  102. },
  103. updated () {
  104. this.$refs.profiletextarea.scrollHeight > 120 ? this.hide = true : this.hide = false;
  105. },
  106. methods: {
  107. },
  108. };
  109. </script>
  110. <style lang="scss" scoped>
  111. .lineProfileClamp {
  112. display: -webkit-box;
  113. -webkit-box-orient: vertical;
  114. -webkit-line-clamp: 5;
  115. overflow: hidden;
  116. }
  117. a:hover{
  118. color: #ee9546;
  119. }
  120. </style>