Browse Source

resolve merge conflicts

Olivier Massot 3 years ago
parent
commit
5bfb1289f6
1 changed files with 38 additions and 31 deletions
  1. 38 31
      pages/subscription.vue

+ 38 - 31
pages/subscription.vue

@@ -6,8 +6,6 @@ Page 'Mon abonnement'
 <template>
   <LayoutContainer>
     <v-col cols="12" sm="12" md="12">
-      <h3 class="mb-5">{{ $t('my_subscription') }}</h3>
-
       <v-expansion-panels focusable multiple :value="[0,1,2]">
         <UiExpansionPanel id="informations" icon="fa-info">
           <v-container fluid class="container">
@@ -24,20 +22,19 @@ Page 'Mon abonnement'
                   </tr>
                   <tr v-if="dolibarrAccount && dolibarrAccount.contract">
                     <td>{{ $t('services') }}</td>
-                    <td>
+                    <td class="py-2">
                       <div
                         v-for="line in dolibarrAccount.contract.lines"
                         :key="line.id"
-                        style="list-style: none;"
                       >
                         {{ line.serviceLabel }}
                       </div>
                     </td>
                   </tr>
-                  <tr>
+                  <tr v-if="show_sms_row">
                     <td>{{ $t('remaining_sms_credit') }}</td>
                     <td>
-                      <UiDisplayMobytStatus />
+                      <UiTemplateMobytStatus @disabled_sms_row="show_sms_row = false"/>
                     </td>
                   </tr>
                 </tbody>
@@ -46,10 +43,10 @@ Page 'Mon abonnement'
           </v-container>
         </UiExpansionPanel>
 
-        <UiExpansionPanel id="bills" icon="fa-file">
+        <UiExpansionPanel id="bills" icon="fa-file" v-if="!dolibarrAccountFetch.pending && dolibarrAccount && dolibarrAccount.bills.length > 0">
           <v-container fluid class="container">
             <v-row>
-              <v-simple-table v-if="!dolibarrAccountFetch.pending && dolibarrAccount && dolibarrAccount.bills">
+              <v-simple-table>
                 <thead>
                   <tr>
                     <th>{{ $t('reference') }}</th>
@@ -66,17 +63,13 @@ Page 'Mon abonnement'
                     <td>{{ bill.ref }}</td>
                     <td>{{ $moment(bill.date).format($moment.localeData($i18n.locale).longDateFormat('L')) }}</td>
                     <td>{{ bill.taxExcludedAmount.toLocaleString($i18n.locale, { style: 'currency', currency: 'EUR' }) }}</td>
-                    <td>{{ bill.status === 1 ? $t('paid') : $t('unpaid') }}</td>
+                    <td>{{ bill.paid === true ? $t('paid') : $t('unpaid') }}</td>
                   </tr>
                 </tbody>
               </v-simple-table>
-              <div v-else class="ma-2">
-                <i>{{ $t('no_bill_to_display') }}</i>
-              </div>
             </v-row>
           </v-container>
         </UiExpansionPanel>
-
         <UiExpansionPanel id="more_features" icon="fa-plus">
           <v-container id="products-section" fluid class="container">
             <v-row>
@@ -84,10 +77,10 @@ Page 'Mon abonnement'
                 <template #default>
                   <thead>
                     <tr>
-                      <th v-if="organizationProfile.isArtistProduct">
+                      <th v-if="organizationProfile.isArtistProduct()">
                         {{ $t('PRODUCT_ARTIST_PREMIUM') }}
                       </th>
-                      <th v-if="organizationProfile.isArtist">
+                      <th v-if="organizationProfile.isArtist()">
                         {{ $t('PRODUCT_SCHOOL') }}
                       </th>
                       <th>
@@ -100,10 +93,10 @@ Page 'Mon abonnement'
                   </thead>
                   <tbody>
                     <tr class="center-td-content">
-                      <td v-if="organizationProfile.isArtistProduct">
+                      <td v-if="organizationProfile.isArtistProduct()">
                         <nuxt-img src="/images/Artist-Square.jpg" />
                       </td>
-                      <td v-if="organizationProfile.isArtist">
+                      <td v-if="organizationProfile.isArtist()">
                         <nuxt-img src="/images/School-Square.jpg" />
                       </td>
                       <td>
@@ -115,13 +108,13 @@ Page 'Mon abonnement'
                     </tr>
                     <tr>
                       <!-- Opentalent Artist Premium -->
-                      <td v-if="organizationProfile.isArtistProduct">
+                      <td v-if="organizationProfile.isArtistProduct()">
                         <p>
                           {{ $t('get_more_functionalities_with_version') }} <b>{{ $t('PRODUCT_ARTIST_PREMIUM') }}</b>
                         </p>
 
                         <!-- Cmf member -->
-                        <div v-if="organizationProfile.isCmf">
+                        <div v-if="organizationProfile.isCmf()">
                           <p>
                             <b>{{ $t('for_only_x_eur_ttc_by_month', { price: formatCurrency(7.25, 'EUR') }) }} *</b>
                           </p>
@@ -142,25 +135,25 @@ Page 'Mon abonnement'
                         </div>
 
                         <p class="mt-3">
-                          <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentartist.pdf" target="_blank">
+                          <a href="/resources/Fiche_produit_Opentalent_Artist.pdf" target="_blank">
                             {{ $t('product_sheet') }} {{ $t('PRODUCT_ARTIST_PREMIUM') }}
                           </a>
                         </p>
 
-                        <p v-if="organizationProfile.isCmf" class="mt-3">
-                          <a href="">
+                        <p v-if="organizationProfile.isCmf()" class="mt-3">
+                          <a href="/resources/BDC_Artist_Premium_CMF.pdf">
                             <b>{{ $t('download_cmf_order_form') }}</b>
                           </a>
                         </p>
                         <p v-else class="mt-3">
-                          <a href="">
+                          <a href="/resources/BDC_Artist_Premium_Public.pdf">
                             <b>{{ $t('download_order_form') }}</b>
                           </a>
                         </p>
                       </td>
 
                       <!-- Opentalent School Premium -->
-                      <td v-if="organizationProfile.isArtist">
+                      <td v-if="organizationProfile.isArtist()">
                         <p>
                           {{ $t('switch_to_version') }} <b>{{ $t('PRODUCT_SCHOOL_PREMIUM') }}</b> {{ $t('and_benefit') }} :
                         </p>
@@ -171,7 +164,7 @@ Page 'Mon abonnement'
                         </ul>
 
                         <!-- Cmf member -->
-                        <div v-if="organizationProfile.isCmf">
+                        <div v-if="organizationProfile.isCmf()">
                           <p><b>{{ $t('starting_from_x_eur_ttc_per_month', { price: formatCurrency(26.50, 'EUR') }) }} *</b></p>
                           <div><i>* {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(318.00, 'EUR') }) }}</i></div>
                           <div><i>{{ $t('version_x_up_to_x_students', { product: $t('PRODUCT_SCHOOL_PREMIUM'), max_students: '69' }) }}</i></div>
@@ -187,7 +180,7 @@ Page 'Mon abonnement'
                         </div>
 
                         <p class="mt-4">
-                          <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentschool" target="_blank">
+                          <a href="/resources/Fiche_produit_Opentalent_School.pdf" target="_blank">
                             {{ $t('product_sheet') }} {{ $t('PRODUCT_SCHOOL') }}
                           </a>
                         </p>
@@ -203,13 +196,13 @@ Page 'Mon abonnement'
                         <p><b>{{ $t('send_sms') }} {{ $t('to_your_members_from_app') }}</b></p>
 
                         <!-- Cmf member -->
-                        <div v-if="organizationProfile.isCmf">
+                        <div v-if="organizationProfile.isCmf()">
                           <p><b>{{ $t('starting_from_x_eur_ttc_per_sms', { price: formatCurrency(0.10, 'EUR') }) }} *</b></p>
                           <p><i>* {{ $t('for_x_sms', { amount: '5000' }) }}</i></p>
 
                           <p>
                             <b>
-                              <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-CMF.pdf" target="_blank">
+                              <a href="/resources/BDC_SMS_CMF.pdf" target="_blank">
                                 {{ $t('download_cmf_order_form') }}
                               </a>
                             </b>
@@ -221,7 +214,7 @@ Page 'Mon abonnement'
                           <p><i>* {{ $t('for_x_sms', { amount: '5000' }) }}</i></p>
 
                           <p>
-                            <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-public.pdf" target="_blank">
+                            <a href="/resources/BDC_SMS_Public.pdf" target="_blank">
                               <b>{{ $t('download_order_form') }}</b>
                             </a>
                           </p>
@@ -253,6 +246,12 @@ Page 'Mon abonnement'
                             </tr>
                           </tbody>
                         </table>
+
+                        <p>
+                          <a href="/resources/BDC_Nom_de_domaine.pdf" target="_blank">
+                            <b>{{ $t('download_order_form') }}</b>
+                          </a>
+                        </p>
                       </td>
                     </tr>
                   </tbody>
@@ -271,10 +270,13 @@ import { defineComponent, useFetch, useContext, ref, Ref } from '@nuxtjs/composi
 import { $organizationProfile } from '~/services/profile/organizationProfile'
 import { QUERY_TYPE } from '~/types/enums'
 import { ApiResponse, DolibarrAccount } from '~/types/interfaces'
-import {trimEnd} from "lodash";
 
 export default defineComponent({
   name: 'Subscription',
+  middleware({ $ability, redirect }) {
+    if(!$ability.can('display', 'subscription_page'))
+      return redirect('/error')
+  },
   setup () {
     const { store, $dataProvider } = useContext()
     const organizationProfile = ref($organizationProfile(store))
@@ -298,7 +300,8 @@ export default defineComponent({
     return {
       organizationProfile,
       dolibarrAccount,
-      dolibarrAccountFetch: fetchState
+      dolibarrAccountFetch: fetchState,
+      show_sms_row: true
     }
   },
   methods: {
@@ -328,4 +331,8 @@ export default defineComponent({
     padding: 12px 18px;
     vertical-align: top;
   }
+
+  .theme--light.v-data-table > .v-data-table__wrapper > table > tbody > tr:hover:not(.v-data-table__expanded__content):not(.v-data-table__empty-wrapper) {
+    background:none;
+  }
 </style>