EventItem.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <q-card flat
  3. class="event-item"
  4. :class="{'isRegistered' : event.is_current_user_registered }">
  5. <q-card-section class="thumbnail">
  6. <router-link :to="{name: 'Public.ShowEventInfo', params: {id: event.id}}">
  7. <div class="RegisteredSign">
  8. <svg class="ribbon"
  9. xmlns="http://www.w3.org/2000/svg"
  10. width="123.945"
  11. height="123.422"
  12. viewBox="0 0 123.945 123.422">
  13. <g id="Group_11524"
  14. data-name="Group 11524"
  15. transform="translate(-361 -1111)">
  16. <g id="Group_7903"
  17. data-name="Group 7903"
  18. transform="translate(361 1111)">
  19. <g id="Group_7901"
  20. data-name="Group 7901"
  21. transform="translate(0 0)">
  22. <rect id="Rectangle_1771"
  23. data-name="Rectangle 1771"
  24. width="13.986"
  25. height="39.668"
  26. transform="translate(0 83.754)"
  27. fill="#cfb184" />
  28. <rect id="Rectangle_1772"
  29. data-name="Rectangle 1772"
  30. width="39.668"
  31. height="13.986"
  32. transform="translate(84.277 0)"
  33. fill="#cfb184" />
  34. <path id="Path_18668"
  35. data-name="Path 18668"
  36. d="M1938.931,282.651l123.945-123.406-.016-.016h-44a9.041,9.041,0,0,0-6.379,2.631l-70.907,70.6a8.962,8.962,0,0,0-2.642,6.352Z"
  37. transform="translate(-1938.931 -159.229)"
  38. fill="#eac38a" />
  39. </g>
  40. </g>
  41. <text id="رویداد_های_من"
  42. data-name="رویداد‌های من"
  43. transform="translate(445.063 1135.174) rotate(-45)"
  44. fill="#fff"
  45. font-size="18"
  46. font-family="SegoeUI-Bold, Segoe UI"
  47. font-weight="700"><tspan x="0"
  48. y="0">رویداد‌های من</tspan></text>
  49. </g>
  50. </svg>
  51. </div>
  52. <img class="thumbnail-img"
  53. :src="event.thumbnail">
  54. </router-link>
  55. </q-card-section>
  56. <div class="infos">
  57. <div class="title ellipsis-2-lines">
  58. <router-link :to="{name: 'Public.ShowEventInfo', params: {id: event.id}}">
  59. {{event.title}}
  60. </router-link>
  61. </div>
  62. <div class="date">
  63. <q-icon name="calendar_month"
  64. size="20px" />
  65. {{ miladiToShamsi() }}
  66. </div>
  67. </div>
  68. <q-card-actions class="action-section">
  69. <q-btn color="primary"
  70. class="btn-show-event"
  71. :to="{name: 'Public.ShowEventInfo', params: {id: event.id}}">
  72. مشاهده و ثبت نام
  73. <svg xmlns="http://www.w3.org/2000/svg"
  74. width="18.387"
  75. height="11.502"
  76. viewBox="0 0 18.387 11.502">
  77. <path id="Combined_Shape"
  78. data-name="Combined Shape"
  79. d="M-9.338,11.408a.748.748,0,0,0,.388-.656V6.5h8.2A.751.751,0,0,0,0,5.75.75.75,0,0,0-.75,5h-8.2V.75A.751.751,0,0,0-9.338.093.769.769,0,0,0-9.7,0a.735.735,0,0,0-.4.115l-7.938,5a.747.747,0,0,0-.35.635.742.742,0,0,0,.35.634l7.938,5a.751.751,0,0,0,.4.116A.746.746,0,0,0-9.338,11.408ZM-10.45,9.392l-5.78-3.641,5.78-3.642Z"
  80. transform="translate(18.387)"
  81. fill="#fff" />
  82. </svg>
  83. </q-btn>
  84. </q-card-actions>
  85. </q-card>
  86. </template>
  87. <script>
  88. import { defineComponent } from 'vue'
  89. // import { Event } from 'src/models/Event.js'
  90. import { Classroom } from 'src/models/Classroom' // using Classroom instead of Event to prevent props warning
  91. import Assist from 'src/assets/js/Assist.js'
  92. export default defineComponent({
  93. name: 'OptionPanel',
  94. props: {
  95. event: {
  96. type: Classroom,
  97. default: new Classroom()
  98. }
  99. },
  100. data() {
  101. return {
  102. size: 'xs',
  103. sizeOptions: ['xs', 'sm', 'md', 'lg', 'xl'],
  104. actionTypes: ['event', 'scroll', 'link'],
  105. defaultOptions: {
  106. imageSource: null,
  107. ratio: null,
  108. hasAction: false,
  109. useAEEEvent: false,
  110. AEEEventBody: {
  111. id: '-',
  112. name: '-',
  113. creative: null,
  114. position: null
  115. },
  116. action: {
  117. name: null,
  118. route: null,
  119. scrollTo: null,
  120. eventName: null,
  121. eventArgs: null
  122. },
  123. xs: {
  124. height: null,
  125. width: null,
  126. src: null
  127. },
  128. sm: {
  129. height: null,
  130. width: null,
  131. src: null
  132. },
  133. md: {
  134. height: null,
  135. width: null,
  136. src: null
  137. },
  138. lg: {
  139. height: null,
  140. width: null,
  141. src: null
  142. },
  143. xl: {
  144. height: null,
  145. width: null,
  146. src: null
  147. }
  148. }
  149. }
  150. },
  151. methods: {
  152. getHoldingType (event) {
  153. return new Classroom(event).holding_type_info.label
  154. },
  155. miladiToShamsi () {
  156. if (!this.event.publish_time) {
  157. return '-'
  158. }
  159. return Assist.miladiToShamsi(this.event.publish_time, 'jD jMMMM jYYYY ساعت HH:mm')
  160. }
  161. }
  162. })
  163. </script>
  164. <style lang="scss" scoped>
  165. .event-item {
  166. width: 100%;
  167. background-color: #F6F6F6;
  168. border-radius: 8px;
  169. position: relative;
  170. z-index: 1;
  171. &.isRegistered {
  172. .thumbnail {
  173. position: relative;
  174. z-index: 1;
  175. .RegisteredSign {
  176. position: absolute;
  177. right: -13px;
  178. top: -13px;
  179. z-index: 2;
  180. display: block;
  181. }
  182. }
  183. }
  184. .thumbnail {
  185. padding: 0;
  186. .RegisteredSign {
  187. display: none;
  188. }
  189. .thumbnail-img {
  190. width: 100%;
  191. height: auto;
  192. }
  193. }
  194. .infos {
  195. position: absolute;
  196. left: 0;
  197. bottom: 60px;
  198. width: 100%;
  199. z-index: 2;
  200. .title {
  201. padding: 0 15px;
  202. text-align: left;
  203. margin-bottom: 49px;
  204. a {
  205. color: white;
  206. font-size: 16px;
  207. font-weight: bold;
  208. }
  209. }
  210. .date {
  211. padding: 0 15px;
  212. text-align: left;
  213. margin-bottom: 24px;
  214. color: white;
  215. font-size: 16px;
  216. font-weight: normal;
  217. .q-icon {
  218. color: #EAC38A;
  219. margin-right: 12.5px;
  220. }
  221. }
  222. }
  223. .action-section {
  224. padding: 0;
  225. .btn-show-event {
  226. width: 100%;
  227. height: 60px;
  228. border-top-right-radius: 0;
  229. border-top-left-radius: 0;
  230. }
  231. }
  232. }
  233. </style>