mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-29 04:31:08 -04:00 
			
		
		
		
	Compare commits
	
		
			6 Commits
		
	
	
		
			dark-sideb
			...
			dark-dropd
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 973179a351 | |||
| 1749e34396 | |||
| 953abe6ec6 | |||
| 3ea10de182 | |||
| 1f5bb49333 | |||
| 15f3f566e3 | 
| @ -7,11 +7,12 @@ | |||||||
|     <!-- edit customField  --> |     <!-- edit customField  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.EDIT_CUSTOM_FIELDS)" |       v-if="userStore.hasAbilities(abilities.EDIT_CUSTOM_FIELDS)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="editCustomField(row.id)" |       @click="editCustomField(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="PencilIcon" |         name="PencilIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.edit') }} |       {{ $t('general.edit') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -19,11 +20,12 @@ | |||||||
|     <!-- delete customField  --> |     <!-- delete customField  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.DELETE_CUSTOM_FIELDS)" |       v-if="userStore.hasAbilities(abilities.DELETE_CUSTOM_FIELDS)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removeCustomField(row.id)" |       @click="removeCustomField(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -12,10 +12,10 @@ | |||||||
|       v-if="userStore.hasAbilities(abilities.EDIT_CUSTOMER)" |       v-if="userStore.hasAbilities(abilities.EDIT_CUSTOMER)" | ||||||
|       :to="`/admin/customers/${row.id}/edit`" |       :to="`/admin/customers/${row.id}/edit`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="PencilIcon" |           name="PencilIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.edit') }} |         {{ $t('general.edit') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
| @ -29,10 +29,10 @@ | |||||||
|       " |       " | ||||||
|       :to="`customers/${row.id}/view`" |       :to="`customers/${row.id}/view`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="EyeIcon" |           name="EyeIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.view') }} |         {{ $t('general.view') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
| @ -41,11 +41,12 @@ | |||||||
|     <!-- Delete Customer  --> |     <!-- Delete Customer  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.DELETE_CUSTOMER)" |       v-if="userStore.hasAbilities(abilities.DELETE_CUSTOMER)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removeCustomer(row.id)" |       @click="removeCustomer(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -10,11 +10,12 @@ | |||||||
|     <!-- Copy PDF url  --> |     <!-- Copy PDF url  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="route.name === 'estimates.view'" |       v-if="route.name === 'estimates.view'" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="copyPdfUrl" |       @click="copyPdfUrl" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="LinkIcon" |         name="LinkIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.copy_pdf_url') }} |       {{ $t('general.copy_pdf_url') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -24,10 +25,10 @@ | |||||||
|       v-if="userStore.hasAbilities(abilities.EDIT_ESTIMATE)" |       v-if="userStore.hasAbilities(abilities.EDIT_ESTIMATE)" | ||||||
|       :to="`/admin/estimates/${row.id}/edit`" |       :to="`/admin/estimates/${row.id}/edit`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="PencilIcon" |           name="PencilIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.edit') }} |         {{ $t('general.edit') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
| @ -36,11 +37,12 @@ | |||||||
|     <!-- Delete Estimate  --> |     <!-- Delete Estimate  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.DELETE_ESTIMATE)" |       v-if="userStore.hasAbilities(abilities.DELETE_ESTIMATE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removeEstimate(row.id)" |       @click="removeEstimate(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -53,10 +55,10 @@ | |||||||
|       " |       " | ||||||
|       :to="`estimates/${row.id}/view`" |       :to="`estimates/${row.id}/view`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="EyeIcon" |           name="EyeIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.view') }} |         {{ $t('general.view') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
| @ -65,11 +67,12 @@ | |||||||
|     <!-- Convert into Invoice  --> |     <!-- Convert into Invoice  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.CREATE_INVOICE)" |       v-if="userStore.hasAbilities(abilities.CREATE_INVOICE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="convertInToinvoice(row.id)" |       @click="convertInToinvoice(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="DocumentTextIcon" |         name="DocumentTextIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('estimates.convert_to_invoice') }} |       {{ $t('estimates.convert_to_invoice') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -81,11 +84,12 @@ | |||||||
|         route.name !== 'estimates.view' && |         route.name !== 'estimates.view' && | ||||||
|         userStore.hasAbilities(abilities.SEND_ESTIMATE) |         userStore.hasAbilities(abilities.SEND_ESTIMATE) | ||||||
|       " |       " | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="onMarkAsSent(row.id)" |       @click="onMarkAsSent(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="CheckCircleIcon" |         name="CheckCircleIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('estimates.mark_as_sent') }} |       {{ $t('estimates.mark_as_sent') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -97,20 +101,21 @@ | |||||||
|         route.name !== 'estimates.view' && |         route.name !== 'estimates.view' && | ||||||
|         userStore.hasAbilities(abilities.SEND_ESTIMATE) |         userStore.hasAbilities(abilities.SEND_ESTIMATE) | ||||||
|       " |       " | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="sendEstimate(row)" |       @click="sendEstimate(row)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="PaperAirplaneIcon" |         name="PaperAirplaneIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('estimates.send_estimate') }} |       {{ $t('estimates.send_estimate') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  |  | ||||||
|     <!-- Resend Estimate --> |     <!-- Resend Estimate --> | ||||||
|     <BaseDropdownItem v-if="canResendEstimate(row)" @click="sendEstimate(row)"> |     <BaseDropdownItem v-if="canResendEstimate(row)" v-slot="slotProps"  @click="sendEstimate(row)"> | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="PaperAirplaneIcon" |         name="PaperAirplaneIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('estimates.resend_estimate') }} |       {{ $t('estimates.resend_estimate') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -121,11 +126,12 @@ | |||||||
|         row.status !== 'ACCEPTED' && |         row.status !== 'ACCEPTED' && | ||||||
|         userStore.hasAbilities(abilities.EDIT_ESTIMATE) |         userStore.hasAbilities(abilities.EDIT_ESTIMATE) | ||||||
|       " |       " | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="onMarkAsAccepted(row.id)" |       @click="onMarkAsAccepted(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="CheckCircleIcon" |         name="CheckCircleIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('estimates.mark_as_accepted') }} |       {{ $t('estimates.mark_as_accepted') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -136,11 +142,12 @@ | |||||||
|         row.status !== 'REJECTED' && |         row.status !== 'REJECTED' && | ||||||
|         userStore.hasAbilities(abilities.EDIT_ESTIMATE) |         userStore.hasAbilities(abilities.EDIT_ESTIMATE) | ||||||
|       " |       " | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="onMarkAsRejected(row.id)" |       @click="onMarkAsRejected(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="XCircleIcon" |         name="XCircleIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('estimates.mark_as_rejected') }} |       {{ $t('estimates.mark_as_rejected') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -13,11 +13,12 @@ | |||||||
|     <!-- edit expenseCategory  --> |     <!-- edit expenseCategory  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.EDIT_EXPENSE)" |       v-if="userStore.hasAbilities(abilities.EDIT_EXPENSE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="editExpenseCategory(row.id)" |       @click="editExpenseCategory(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="PencilIcon" |         name="PencilIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.edit') }} |       {{ $t('general.edit') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -25,11 +26,12 @@ | |||||||
|     <!-- delete expenseCategory  --> |     <!-- delete expenseCategory  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.DELETE_EXPENSE)" |       v-if="userStore.hasAbilities(abilities.DELETE_EXPENSE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removeExpenseCategory(row.id)" |       @click="removeExpenseCategory(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -12,10 +12,10 @@ | |||||||
|       v-if="userStore.hasAbilities(abilities.EDIT_EXPENSE)" |       v-if="userStore.hasAbilities(abilities.EDIT_EXPENSE)" | ||||||
|       :to="`/admin/expenses/${row.id}/edit`" |       :to="`/admin/expenses/${row.id}/edit`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="PencilIcon" |           name="PencilIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.edit') }} |         {{ $t('general.edit') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
| @ -24,11 +24,12 @@ | |||||||
|     <!-- delete expense  --> |     <!-- delete expense  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.DELETE_EXPENSE)" |       v-if="userStore.hasAbilities(abilities.DELETE_EXPENSE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removeExpense(row.id)" |       @click="removeExpense(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -12,20 +12,20 @@ | |||||||
|       v-if="userStore.hasAbilities(abilities.EDIT_INVOICE)" |       v-if="userStore.hasAbilities(abilities.EDIT_INVOICE)" | ||||||
|       :to="`/admin/invoices/${row.id}/edit`" |       :to="`/admin/invoices/${row.id}/edit`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem v-show="row.allow_edit"> |       <BaseDropdownItem v-show="row.allow_edit" v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="PencilIcon" |           name="PencilIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.edit') }} |         {{ $t('general.edit') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
|     </router-link> |     </router-link> | ||||||
|  |  | ||||||
|     <!-- Copy PDF url  --> |     <!-- Copy PDF url  --> | ||||||
|     <BaseDropdownItem v-if="route.name === 'invoices.view'" @click="copyPdfUrl"> |     <BaseDropdownItem v-if="route.name === 'invoices.view'" v-slot="slotProps" @click="copyPdfUrl"> | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="LinkIcon" |         name="LinkIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.copy_pdf_url') }} |       {{ $t('general.copy_pdf_url') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -38,29 +38,29 @@ | |||||||
|       " |       " | ||||||
|       :to="`/admin/invoices/${row.id}/view`" |       :to="`/admin/invoices/${row.id}/view`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="EyeIcon" |           name="EyeIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.view') }} |         {{ $t('general.view') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
|     </router-link> |     </router-link> | ||||||
|  |  | ||||||
|     <!-- Send Invoice Mail  --> |     <!-- Send Invoice Mail  --> | ||||||
|     <BaseDropdownItem v-if="canSendInvoice(row)" @click="sendInvoice(row)"> |     <BaseDropdownItem v-if="canSendInvoice(row)" v-slot="slotProps" @click="sendInvoice(row)"> | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="PaperAirplaneIcon" |         name="PaperAirplaneIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('invoices.send_invoice') }} |       {{ $t('invoices.send_invoice') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  |  | ||||||
|     <!-- Resend Invoice --> |     <!-- Resend Invoice --> | ||||||
|     <BaseDropdownItem v-if="canReSendInvoice(row)" @click="sendInvoice(row)"> |     <BaseDropdownItem v-if="canReSendInvoice(row)" v-slot="slotProps" @click="sendInvoice(row)"> | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="PaperAirplaneIcon" |         name="PaperAirplaneIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('invoices.resend_invoice') }} |       {{ $t('invoices.resend_invoice') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -69,20 +69,21 @@ | |||||||
|     <router-link :to="`/admin/payments/${row.id}/create`"> |     <router-link :to="`/admin/payments/${row.id}/create`"> | ||||||
|       <BaseDropdownItem |       <BaseDropdownItem | ||||||
|         v-if="row.status == 'SENT' && route.name !== 'invoices.view'" |         v-if="row.status == 'SENT' && route.name !== 'invoices.view'" | ||||||
|  |         v-slot="slotProps" | ||||||
|       > |       > | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="CreditCardIcon" |           name="CreditCardIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('invoices.record_payment') }} |         {{ $t('invoices.record_payment') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
|     </router-link> |     </router-link> | ||||||
|  |  | ||||||
|     <!-- Mark as sent Invoice --> |     <!-- Mark as sent Invoice --> | ||||||
|     <BaseDropdownItem v-if="canSendInvoice(row)" @click="onMarkAsSent(row.id)"> |     <BaseDropdownItem v-if="canSendInvoice(row)" v-slot="slotProps" @click="onMarkAsSent(row.id)"> | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="CheckCircleIcon" |         name="CheckCircleIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('invoices.mark_as_sent') }} |       {{ $t('invoices.mark_as_sent') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -90,11 +91,12 @@ | |||||||
|     <!-- Clone Invoice into new invoice  --> |     <!-- Clone Invoice into new invoice  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.CREATE_INVOICE)" |       v-if="userStore.hasAbilities(abilities.CREATE_INVOICE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="cloneInvoiceData(row)" |       @click="cloneInvoiceData(row)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="DocumentTextIcon" |         name="DocumentTextIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('invoices.clone_invoice') }} |       {{ $t('invoices.clone_invoice') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -102,11 +104,12 @@ | |||||||
|     <!--  Delete Invoice  --> |     <!--  Delete Invoice  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.DELETE_INVOICE)" |       v-if="userStore.hasAbilities(abilities.DELETE_INVOICE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removeInvoice(row.id)" |       @click="removeInvoice(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -12,11 +12,8 @@ | |||||||
|       v-if="userStore.hasAbilities(abilities.EDIT_ITEM)" |       v-if="userStore.hasAbilities(abilities.EDIT_ITEM)" | ||||||
|       :to="`/admin/items/${row.id}/edit`" |       :to="`/admin/items/${row.id}/edit`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon name="PencilIcon" :class="slotProps.class" /> | ||||||
|           name="PencilIcon" |  | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |  | ||||||
|         /> |  | ||||||
|         {{ $t('general.edit') }} |         {{ $t('general.edit') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
|     </router-link> |     </router-link> | ||||||
| @ -24,12 +21,10 @@ | |||||||
|     <!-- delete item  --> |     <!-- delete item  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.DELETE_ITEM)" |       v-if="userStore.hasAbilities(abilities.DELETE_ITEM)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removeItem(row.id)" |       @click="removeItem(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon name="TrashIcon" :class="slotProps.class" /> | ||||||
|         name="TrashIcon" |  | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |  | ||||||
|       /> |  | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|   </BaseDropdown> |   </BaseDropdown> | ||||||
|  | |||||||
| @ -10,11 +10,12 @@ | |||||||
|     <!-- edit note  --> |     <!-- edit note  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.MANAGE_NOTE)" |       v-if="userStore.hasAbilities(abilities.MANAGE_NOTE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="editNote(row.id)" |       @click="editNote(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="PencilIcon" |         name="PencilIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.edit') }} |       {{ $t('general.edit') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -22,11 +23,12 @@ | |||||||
|     <!-- delete note  --> |     <!-- delete note  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.MANAGE_NOTE)" |       v-if="userStore.hasAbilities(abilities.MANAGE_NOTE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removeNote(row.id)" |       @click="removeNote(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -8,30 +8,31 @@ | |||||||
|     </template> |     </template> | ||||||
|  |  | ||||||
|     <!-- Copy pdf url  --> |     <!-- Copy pdf url  --> | ||||||
|     <BaseDropdown-item |     <BaseDropdownItem | ||||||
|       v-if=" |       v-if=" | ||||||
|         route.name === 'payments.view' && |         route.name === 'payments.view' && | ||||||
|         userStore.hasAbilities(abilities.VIEW_PAYMENT) |         userStore.hasAbilities(abilities.VIEW_PAYMENT) | ||||||
|       " |       " | ||||||
|  |       v-slot="slotProps" | ||||||
|       class="rounded-md" |       class="rounded-md" | ||||||
|       @click="copyPdfUrl" |       @click="copyPdfUrl" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="LinkIcon" |         name="LinkIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.copy_pdf_url') }} |       {{ $t('general.copy_pdf_url') }} | ||||||
|     </BaseDropdown-item> |     </BaseDropdownItem> | ||||||
|  |  | ||||||
|     <!-- edit payment  --> |     <!-- edit payment  --> | ||||||
|     <router-link |     <router-link | ||||||
|       v-if="userStore.hasAbilities(abilities.EDIT_PAYMENT)" |       v-if="userStore.hasAbilities(abilities.EDIT_PAYMENT)" | ||||||
|       :to="`/admin/payments/${row.id}/edit`" |       :to="`/admin/payments/${row.id}/edit`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="PencilIcon" |           name="PencilIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.edit') }} |         {{ $t('general.edit') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
| @ -45,10 +46,10 @@ | |||||||
|       " |       " | ||||||
|       :to="`/admin/payments/${row.id}/view`" |       :to="`/admin/payments/${row.id}/view`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="EyeIcon" |           name="EyeIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.view') }} |         {{ $t('general.view') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
| @ -61,11 +62,12 @@ | |||||||
|         route.name !== 'payments.view' && |         route.name !== 'payments.view' && | ||||||
|         userStore.hasAbilities(abilities.SEND_PAYMENT) |         userStore.hasAbilities(abilities.SEND_PAYMENT) | ||||||
|       " |       " | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="sendPayment(row)" |       @click="sendPayment(row)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="PaperAirplaneIcon" |         name="PaperAirplaneIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('payments.send_payment') }} |       {{ $t('payments.send_payment') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -73,11 +75,12 @@ | |||||||
|     <!-- delete payment  --> |     <!-- delete payment  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.DELETE_PAYMENT)" |       v-if="userStore.hasAbilities(abilities.DELETE_PAYMENT)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removePayment(row.id)" |       @click="removePayment(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -8,19 +8,19 @@ | |||||||
|     </template> |     </template> | ||||||
|  |  | ||||||
|     <!-- edit paymentMode  --> |     <!-- edit paymentMode  --> | ||||||
|     <BaseDropdownItem @click="editPaymentMode(row.id)"> |     <BaseDropdownItem v-slot="slotProps"  @click="editPaymentMode(row.id)"> | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="PencilIcon" |         name="PencilIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.edit') }} |       {{ $t('general.edit') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  |  | ||||||
|     <!-- delete paymentMode  --> |     <!-- delete paymentMode  --> | ||||||
|     <BaseDropdownItem @click="removePaymentMode(row.id)"> |     <BaseDropdownItem v-slot="slotProps"  @click="removePaymentMode(row.id)"> | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -15,10 +15,10 @@ | |||||||
|       v-if="userStore.hasAbilities(abilities.EDIT_RECURRING_INVOICE)" |       v-if="userStore.hasAbilities(abilities.EDIT_RECURRING_INVOICE)" | ||||||
|       :to="`/admin/recurring-invoices/${row.id}/edit`" |       :to="`/admin/recurring-invoices/${row.id}/edit`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="PencilIcon" |           name="PencilIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.edit') }} |         {{ $t('general.edit') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
| @ -32,10 +32,10 @@ | |||||||
|       " |       " | ||||||
|       :to="`recurring-invoices/${row.id}/view`" |       :to="`recurring-invoices/${row.id}/view`" | ||||||
|     > |     > | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="EyeIcon" |           name="EyeIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.view') }} |         {{ $t('general.view') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
| @ -44,11 +44,12 @@ | |||||||
|     <!-- Delete Recurring Invoice  --> |     <!-- Delete Recurring Invoice  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.DELETE_RECURRING_INVOICE)" |       v-if="userStore.hasAbilities(abilities.DELETE_RECURRING_INVOICE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removeMultipleRecurringInvoices(row.id)" |       @click="removeMultipleRecurringInvoices(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -10,11 +10,12 @@ | |||||||
|     <!-- edit role  --> |     <!-- edit role  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.currentUser.is_owner" |       v-if="userStore.currentUser.is_owner" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="editRole(row.id)" |       @click="editRole(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="PencilIcon" |         name="PencilIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.edit') }} |       {{ $t('general.edit') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -22,11 +23,12 @@ | |||||||
|     <!-- delete role  --> |     <!-- delete role  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.currentUser.is_owner" |       v-if="userStore.currentUser.is_owner" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removeRole(row.id)" |       @click="removeRole(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -10,11 +10,12 @@ | |||||||
|     <!-- edit tax-type  --> |     <!-- edit tax-type  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.EDIT_TAX_TYPE)" |       v-if="userStore.hasAbilities(abilities.EDIT_TAX_TYPE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="editTaxType(row.id)" |       @click="editTaxType(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="PencilIcon" |         name="PencilIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.edit') }} |       {{ $t('general.edit') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
| @ -22,11 +23,12 @@ | |||||||
|     <!-- delete tax-type  --> |     <!-- delete tax-type  --> | ||||||
|     <BaseDropdownItem |     <BaseDropdownItem | ||||||
|       v-if="userStore.hasAbilities(abilities.DELETE_TAX_TYPE)" |       v-if="userStore.hasAbilities(abilities.DELETE_TAX_TYPE)" | ||||||
|  |       v-slot="slotProps" | ||||||
|       @click="removeTaxType(row.id)" |       @click="removeTaxType(row.id)" | ||||||
|     > |     > | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -9,20 +9,20 @@ | |||||||
|  |  | ||||||
|     <!-- edit user  --> |     <!-- edit user  --> | ||||||
|     <router-link :to="`/admin/users/${row.id}/edit`"> |     <router-link :to="`/admin/users/${row.id}/edit`"> | ||||||
|       <BaseDropdownItem> |       <BaseDropdownItem v-slot="slotProps"> | ||||||
|         <BaseIcon |         <BaseIcon | ||||||
|           name="PencilIcon" |           name="PencilIcon" | ||||||
|           class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |           :class="slotProps.class" | ||||||
|         /> |         /> | ||||||
|         {{ $t('general.edit') }} |         {{ $t('general.edit') }} | ||||||
|       </BaseDropdownItem> |       </BaseDropdownItem> | ||||||
|     </router-link> |     </router-link> | ||||||
|  |  | ||||||
|     <!-- delete user  --> |     <!-- delete user  --> | ||||||
|     <BaseDropdownItem @click="removeUser(row.id)"> |     <BaseDropdownItem v-slot="slotProps" @click="removeUser(row.id)"> | ||||||
|       <BaseIcon |       <BaseIcon | ||||||
|         name="TrashIcon" |         name="TrashIcon" | ||||||
|         class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |         :class="slotProps.class" | ||||||
|       /> |       /> | ||||||
|       {{ $t('general.delete') }} |       {{ $t('general.delete') }} | ||||||
|     </BaseDropdownItem> |     </BaseDropdownItem> | ||||||
|  | |||||||
| @ -15,8 +15,17 @@ | |||||||
|       bg-gradient-to-r |       bg-gradient-to-r | ||||||
|       from-primary-500 |       from-primary-500 | ||||||
|       to-primary-400 |       to-primary-400 | ||||||
|  |       dark:from-gray-700/70 dark:to-gray-800/70 | ||||||
|  |       bg-primary-500 | ||||||
|  |       dark:bg-transparent | ||||||
|  |       dark:backdrop-blur-xl | ||||||
|  |       dark:shadow-glass | ||||||
|  |       dark:border | ||||||
|  |       dark:border-white/10 | ||||||
|     " |     " | ||||||
|   > |   > | ||||||
|  |     <BaseDarkHighlight /> | ||||||
|  |  | ||||||
|     <router-link |     <router-link | ||||||
|       to="/admin/dashboard" |       to="/admin/dashboard" | ||||||
|       class=" |       class=" | ||||||
| @ -53,6 +62,7 @@ | |||||||
|         cursor-pointer |         cursor-pointer | ||||||
|         md:hidden md:ml-0 |         md:hidden md:ml-0 | ||||||
|         hover:bg-gray-100 |         hover:bg-gray-100 | ||||||
|  |         dark:bg-gray-800 dark:border-gray-500 dark:border | ||||||
|       " |       " | ||||||
|       @click.prevent="onToggle" |       @click.prevent="onToggle" | ||||||
|     > |     > | ||||||
| @ -64,7 +74,7 @@ | |||||||
|         v-if="hasCreateAbilities" |         v-if="hasCreateAbilities" | ||||||
|         class="relative hidden float-left m-0 md:block" |         class="relative hidden float-left m-0 md:block" | ||||||
|       > |       > | ||||||
|         <BaseDropdown width-class="w-48"> |         <BaseDropdown width-class="w-48" > | ||||||
|           <template #activator> |           <template #activator> | ||||||
|             <div |             <div | ||||||
|               class=" |               class=" | ||||||
| @ -78,19 +88,21 @@ | |||||||
|                 bg-white |                 bg-white | ||||||
|                 rounded |                 rounded | ||||||
|                 md:h-9 md:w-9 |                 md:h-9 md:w-9 | ||||||
|  |                 dark:bg-gray-700 dark:border-gray-500 dark:border | ||||||
|               " |               " | ||||||
|             > |             > | ||||||
|               <BaseIcon name="PlusIcon" class="w-5 h-5 text-gray-600" /> |               <BaseIcon name="PlusIcon" class="w-5 h-5 text-gray-600 dark:text-white" /> | ||||||
|             </div> |             </div> | ||||||
|           </template> |           </template> | ||||||
|  |  | ||||||
|           <router-link to="/admin/invoices/create"> |           <router-link to="/admin/invoices/create"> | ||||||
|             <BaseDropdownItem |             <BaseDropdownItem | ||||||
|               v-if="userStore.hasAbilities(abilities.CREATE_INVOICE)" |               v-if="userStore.hasAbilities(abilities.CREATE_INVOICE)" | ||||||
|  |               v-slot="slotProps" | ||||||
|             > |             > | ||||||
|               <BaseIcon |               <BaseIcon | ||||||
|                 name="DocumentTextIcon" |                 name="DocumentTextIcon" | ||||||
|                 class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |                 :class="slotProps.class" | ||||||
|                 aria-hidden="true" |                 aria-hidden="true" | ||||||
|               /> |               /> | ||||||
|               {{ $t('invoices.new_invoice') }} |               {{ $t('invoices.new_invoice') }} | ||||||
| @ -99,10 +111,11 @@ | |||||||
|           <router-link to="/admin/estimates/create"> |           <router-link to="/admin/estimates/create"> | ||||||
|             <BaseDropdownItem |             <BaseDropdownItem | ||||||
|               v-if="userStore.hasAbilities(abilities.CREATE_ESTIMATE)" |               v-if="userStore.hasAbilities(abilities.CREATE_ESTIMATE)" | ||||||
|  |               v-slot="slotProps" | ||||||
|             > |             > | ||||||
|               <BaseIcon |               <BaseIcon | ||||||
|                 name="DocumentIcon" |                 name="DocumentIcon" | ||||||
|                 class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |                 :class="slotProps.class" | ||||||
|                 aria-hidden="true" |                 aria-hidden="true" | ||||||
|               /> |               /> | ||||||
|               {{ $t('estimates.new_estimate') }} |               {{ $t('estimates.new_estimate') }} | ||||||
| @ -112,10 +125,11 @@ | |||||||
|           <router-link to="/admin/customers/create"> |           <router-link to="/admin/customers/create"> | ||||||
|             <BaseDropdownItem |             <BaseDropdownItem | ||||||
|               v-if="userStore.hasAbilities(abilities.CREATE_CUSTOMER)" |               v-if="userStore.hasAbilities(abilities.CREATE_CUSTOMER)" | ||||||
|  |               v-slot="slotProps" | ||||||
|             > |             > | ||||||
|               <BaseIcon |               <BaseIcon | ||||||
|                 name="UserIcon" |                 name="UserIcon" | ||||||
|                 class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |                 :class="slotProps.class" | ||||||
|                 aria-hidden="true" |                 aria-hidden="true" | ||||||
|               /> |               /> | ||||||
|               {{ $t('customers.new_customer') }} |               {{ $t('customers.new_customer') }} | ||||||
| @ -148,20 +162,20 @@ | |||||||
|           </template> |           </template> | ||||||
|  |  | ||||||
|           <router-link to="/admin/settings/account-settings"> |           <router-link to="/admin/settings/account-settings"> | ||||||
|             <BaseDropdownItem> |             <BaseDropdownItem v-slot="slotProps"> | ||||||
|               <BaseIcon |               <BaseIcon | ||||||
|                 name="CogIcon" |                 name="CogIcon" | ||||||
|                 class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |                 :class="slotProps.class" | ||||||
|                 aria-hidden="true" |                 aria-hidden="true" | ||||||
|               /> |               /> | ||||||
|               {{ $t('navigation.settings') }} |               {{ $t('navigation.settings') }} | ||||||
|             </BaseDropdownItem> |             </BaseDropdownItem> | ||||||
|           </router-link> |           </router-link> | ||||||
|  |  | ||||||
|           <BaseDropdownItem @click="logout"> |           <BaseDropdownItem v-slot="slotProps" @click="logout"> | ||||||
|             <BaseIcon |             <BaseIcon | ||||||
|               name="LogoutIcon" |               name="LogoutIcon" | ||||||
|               class="w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500" |               :class="slotProps.class" | ||||||
|               aria-hidden="true" |               aria-hidden="true" | ||||||
|             /> |             /> | ||||||
|             {{ $t('navigation.logout') }} |             {{ $t('navigation.logout') }} | ||||||
|  | |||||||
| @ -15,7 +15,9 @@ | |||||||
|         leave-from="opacity-100" |         leave-from="opacity-100" | ||||||
|         leave-to="opacity-0" |         leave-to="opacity-0" | ||||||
|       > |       > | ||||||
|         <DialogOverlay class="fixed inset-0 bg-gray-600 bg-opacity-75" /> |         <DialogOverlay | ||||||
|  |           class="fixed inset-0 bg-gray-600 bg-opacity-75 dark:bg-gray-900/90" | ||||||
|  |         /> | ||||||
|       </TransitionChild> |       </TransitionChild> | ||||||
|  |  | ||||||
|       <TransitionChild |       <TransitionChild | ||||||
| @ -27,7 +29,9 @@ | |||||||
|         leave-from="translate-x-0" |         leave-from="translate-x-0" | ||||||
|         leave-to="-translate-x-full" |         leave-to="-translate-x-full" | ||||||
|       > |       > | ||||||
|         <div class="relative flex flex-col flex-1 w-full max-w-xs bg-white"> |         <div | ||||||
|  |           class="relative flex flex-col flex-1 w-full max-w-xs bg-white dark:bg-gray-800" | ||||||
|  |         > | ||||||
|           <TransitionChild |           <TransitionChild | ||||||
|             as="template" |             as="template" | ||||||
|             enter="ease-in-out duration-300" |             enter="ease-in-out duration-300" | ||||||
| @ -40,18 +44,17 @@ | |||||||
|             <div class="absolute top-0 right-0 pt-2 -mr-12"> |             <div class="absolute top-0 right-0 pt-2 -mr-12"> | ||||||
|               <button |               <button | ||||||
|                 class=" |                 class=" | ||||||
|                   flex |                 flex | ||||||
|                   items-center |                 items-center | ||||||
|                   justify-center |                 justify-center | ||||||
|                   w-10 |                 w-10 | ||||||
|                   h-10 |                 h-10 | ||||||
|                   ml-1 |                 ml-1 | ||||||
|                   rounded-full |                 rounded-full | ||||||
|                   focus:outline-none |                 focus:outline-none | ||||||
|                   focus:ring-2 |                 focus:ring-2 | ||||||
|                   focus:ring-inset |                 focus:ring-inset | ||||||
|                   focus:ring-white |                 focus:ring-white" | ||||||
|                 " |  | ||||||
|                 @click="globalStore.setSidebarVisibility(false)" |                 @click="globalStore.setSidebarVisibility(false)" | ||||||
|               > |               > | ||||||
|                 <span class="sr-only">Close sidebar</span> |                 <span class="sr-only">Close sidebar</span> | ||||||
| @ -82,8 +85,8 @@ | |||||||
|                 :to="item.link" |                 :to="item.link" | ||||||
|                 :class="[ |                 :class="[ | ||||||
|                   hasActiveUrl(item.link) |                   hasActiveUrl(item.link) | ||||||
|                     ? 'text-primary-500 border-primary-500 bg-gray-100 ' |                     ? 'text-primary-500 border-primary-500 bg-gray-100 dark:shadow-glass dark:backdrop-blur-xl dark:hover:bg-gray-700  dark:bg-gray-700/50 dark:text-primary-400 dark:font-medium' | ||||||
|                     : 'text-black', |                     : 'text-black dark:text-gray-300', | ||||||
|                   'cursor-pointer px-0 pl-4 py-3 border-transparent flex items-center border-l-4 border-solid text-sm not-italic font-medium', |                   'cursor-pointer px-0 pl-4 py-3 border-transparent flex items-center border-l-4 border-solid text-sm not-italic font-medium', | ||||||
|                 ]" |                 ]" | ||||||
|                 @click="globalStore.setSidebarVisibility(false)" |                 @click="globalStore.setSidebarVisibility(false)" | ||||||
| @ -100,6 +103,10 @@ | |||||||
|                 /> |                 /> | ||||||
|                 {{ $t(item.title) }} |                 {{ $t(item.title) }} | ||||||
|               </router-link> |               </router-link> | ||||||
|  |               <LightDarkSwitch | ||||||
|  |                 :show-label="false" | ||||||
|  |                 class="absolute right-6 top-6 !w-auto" | ||||||
|  |               /> | ||||||
|             </nav> |             </nav> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
| @ -113,17 +120,16 @@ | |||||||
|   <!-- DESKTOP MENU --> |   <!-- DESKTOP MENU --> | ||||||
|   <div |   <div | ||||||
|     class=" |     class=" | ||||||
|       hidden |     hidden | ||||||
|       w-56 |     w-56 | ||||||
|       h-screen |     h-screen | ||||||
|       pb-32 |     bg-white | ||||||
|       overflow-y-auto |     border-r border-gray-200 border-solid | ||||||
|       bg-white |     xl:w-64 | ||||||
|       border-r border-gray-200 border-solid |     md:fixed md:flex md:flex-col md:inset-y-0 | ||||||
|       xl:w-64 |     pt-16 | ||||||
|       md:fixed md:flex md:flex-col md:inset-y-0 |     dark:border-gray-800 | ||||||
|       pt-16 |     dark:bg-gray-800/80" | ||||||
|     " |  | ||||||
|   > |   > | ||||||
|     <div |     <div | ||||||
|       v-for="menu in globalStore.menuGroups" |       v-for="menu in globalStore.menuGroups" | ||||||
| @ -136,8 +142,8 @@ | |||||||
|         :to="item.link" |         :to="item.link" | ||||||
|         :class="[ |         :class="[ | ||||||
|           hasActiveUrl(item.link) |           hasActiveUrl(item.link) | ||||||
|             ? 'text-primary-500 border-primary-500 bg-gray-100 ' |             ? 'text-primary-500 border-primary-500 bg-gray-100 dark:border-primary-400 dark:shadow-glass dark:backdrop-blur-xl dark:hover:bg-gray-700 dark:bg-gray-700/50 dark:text-primary-400 dark:font-medium' | ||||||
|             : 'text-black', |             : 'text-black dark:hover:bg-transparent dark:hover:text-white dark:text-gray-300', | ||||||
|           'cursor-pointer px-0 pl-6 hover:bg-gray-50 py-3 group flex items-center border-l-4 border-solid border-transparent text-sm not-italic font-medium', |           'cursor-pointer px-0 pl-6 hover:bg-gray-50 py-3 group flex items-center border-l-4 border-solid border-transparent text-sm not-italic font-medium', | ||||||
|         ]" |         ]" | ||||||
|       > |       > | ||||||
| @ -145,8 +151,8 @@ | |||||||
|           :name="item.icon" |           :name="item.icon" | ||||||
|           :class="[ |           :class="[ | ||||||
|             hasActiveUrl(item.link) |             hasActiveUrl(item.link) | ||||||
|               ? 'text-primary-500 group-hover:text-primary-500 ' |               ? 'text-primary-500 group-hover:text-primary-500 dark:text-primary-400 dark:group-hover:text-primary-500 ' | ||||||
|               : 'text-gray-400 group-hover:text-black', |               : 'text-gray-400 group-hover:text-black dark:text-gray-400 dark:group-hover:text-white', | ||||||
|             'mr-4 shrink-0 h-5 w-5 ', |             'mr-4 shrink-0 h-5 w-5 ', | ||||||
|           ]" |           ]" | ||||||
|         /> |         /> | ||||||
| @ -154,6 +160,9 @@ | |||||||
|         {{ $t(item.title) }} |         {{ $t(item.title) }} | ||||||
|       </router-link> |       </router-link> | ||||||
|     </div> |     </div> | ||||||
|  |     <LightDarkSwitch | ||||||
|  |       class="absolute bottom-0 py-4 border-t border-gray-200 dark:border-gray-700" | ||||||
|  |     /> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| @ -169,6 +178,7 @@ import { | |||||||
|  |  | ||||||
| import { useRoute } from 'vue-router' | import { useRoute } from 'vue-router' | ||||||
| import { useGlobalStore } from '@/scripts/admin/stores/global' | import { useGlobalStore } from '@/scripts/admin/stores/global' | ||||||
|  | import LightDarkSwitch from '@/scripts/components/LightDarkSwitcher.vue' | ||||||
|  |  | ||||||
| const route = useRoute() | const route = useRoute() | ||||||
| const globalStore = useGlobalStore() | const globalStore = useGlobalStore() | ||||||
|  | |||||||
| @ -34,6 +34,7 @@ export const useGlobalStore = (useWindow = false) => { | |||||||
|       isAppLoaded: false, |       isAppLoaded: false, | ||||||
|       isSidebarOpen: false, |       isSidebarOpen: false, | ||||||
|       areCurrenciesLoading: false, |       areCurrenciesLoading: false, | ||||||
|  |       isDarkModeOn: false, | ||||||
|  |  | ||||||
|       downloadReport: null, |       downloadReport: null, | ||||||
|     }), |     }), | ||||||
| @ -70,8 +71,8 @@ export const useGlobalStore = (useWindow = false) => { | |||||||
|               moduleStore.apiToken = response.data.global_settings.api_token |               moduleStore.apiToken = response.data.global_settings.api_token | ||||||
|               moduleStore.enableModules = response.data.modules |               moduleStore.enableModules = response.data.modules | ||||||
|  |  | ||||||
|                 // company store |               // company store | ||||||
|                 companyStore.companies = response.data.companies |               companyStore.companies = response.data.companies | ||||||
|               companyStore.selectedCompany = response.data.current_company |               companyStore.selectedCompany = response.data.current_company | ||||||
|               companyStore.setSelectedCompany(response.data.current_company) |               companyStore.setSelectedCompany(response.data.current_company) | ||||||
|               companyStore.selectedCompanySettings = |               companyStore.selectedCompanySettings = | ||||||
|  | |||||||
| @ -51,14 +51,14 @@ | |||||||
|             </div> |             </div> | ||||||
|           </template> |           </template> | ||||||
|  |  | ||||||
|           <BaseDropdownItem @click="onDownloadBckup(row.data)"> |           <BaseDropdownItem v-slot="slotProps" @click="onDownloadBckup(row.data)"> | ||||||
|             <BaseIcon name="CloudDownloadIcon" class="mr-3 text-gray-600" /> |             <BaseIcon name="CloudDownloadIcon" :class="slotProps.class" /> | ||||||
|  |  | ||||||
|             {{ $t('general.download') }} |             {{ $t('general.download') }} | ||||||
|           </BaseDropdownItem> |           </BaseDropdownItem> | ||||||
|  |  | ||||||
|           <BaseDropdownItem @click="onRemoveBackup(row.data)"> |           <BaseDropdownItem v-slot="slotProps" @click="onRemoveBackup(row.data)"> | ||||||
|             <BaseIcon name="TrashIcon" class="mr-3 text-gray-600" /> |             <BaseIcon name="TrashIcon" :class="slotProps.class" /> | ||||||
|             {{ $t('general.delete') }} |             {{ $t('general.delete') }} | ||||||
|           </BaseDropdownItem> |           </BaseDropdownItem> | ||||||
|         </BaseDropdown> |         </BaseDropdown> | ||||||
|  | |||||||
| @ -45,27 +45,30 @@ | |||||||
|  |  | ||||||
|           <BaseDropdownItem |           <BaseDropdownItem | ||||||
|             v-if="!row.data.set_as_default" |             v-if="!row.data.set_as_default" | ||||||
|  |             v-slot="slotProps" | ||||||
|             @click="setDefaultDiskData(row.data.id)" |             @click="setDefaultDiskData(row.data.id)" | ||||||
|           > |           > | ||||||
|             <BaseIcon class="mr-3 tetx-gray-600" name="CheckCircleIcon" /> |             <BaseIcon :class="slotProps.class" name="CheckCircleIcon" /> | ||||||
|  |  | ||||||
|             {{ $t('settings.disk.set_default_disk') }} |             {{ $t('settings.disk.set_default_disk') }} | ||||||
|           </BaseDropdownItem> |           </BaseDropdownItem> | ||||||
|  |  | ||||||
|           <BaseDropdownItem |           <BaseDropdownItem | ||||||
|             v-if="row.data.type !== 'SYSTEM'" |             v-if="row.data.type !== 'SYSTEM'" | ||||||
|  |             v-slot="slotProps" | ||||||
|             @click="openEditDiskModal(row.data)" |             @click="openEditDiskModal(row.data)" | ||||||
|           > |           > | ||||||
|             <BaseIcon name="PencilIcon" class="mr-3 text-gray-600" /> |             <BaseIcon name="PencilIcon" :class="slotProps.class" /> | ||||||
|  |  | ||||||
|             {{ $t('general.edit') }} |             {{ $t('general.edit') }} | ||||||
|           </BaseDropdownItem> |           </BaseDropdownItem> | ||||||
|  |  | ||||||
|           <BaseDropdownItem |           <BaseDropdownItem | ||||||
|             v-if="row.data.type !== 'SYSTEM' && !row.data.set_as_default" |             v-if="row.data.type !== 'SYSTEM' && !row.data.set_as_default" | ||||||
|  |             v-slot="slotProps" | ||||||
|             @click="removeDisk(row.data.id)" |             @click="removeDisk(row.data.id)" | ||||||
|           > |           > | ||||||
|             <BaseIcon name="TrashIcon" class="mr-3 text-gray-600" /> |             <BaseIcon name="TrashIcon" :class="slotProps.class" /> | ||||||
|             {{ $t('general.delete') }} |             {{ $t('general.delete') }} | ||||||
|           </BaseDropdownItem> |           </BaseDropdownItem> | ||||||
|         </BaseDropdown> |         </BaseDropdown> | ||||||
|  | |||||||
| @ -1,21 +1,23 @@ | |||||||
| <template> | <template> | ||||||
|   <div ref="companySwitchBar" class="relative rounded"> |   <div ref="companySwitchBar" class="relative rounded dark:text-white"> | ||||||
|     <CompanyModal /> |     <CompanyModal /> | ||||||
|  |  | ||||||
|     <div |     <div | ||||||
|       class=" |       class=" | ||||||
|         flex |       flex | ||||||
|         items-center |       items-center | ||||||
|         justify-center |       justify-center | ||||||
|         px-3 |       px-3 | ||||||
|         h-8 |       h-8 | ||||||
|         md:h-9 |       md:h-9 | ||||||
|         ml-2 |       ml-2 | ||||||
|         text-sm text-white |       text-sm | ||||||
|         bg-white |       text-white | ||||||
|         rounded |       bg-white | ||||||
|         cursor-pointer |       rounded | ||||||
|         bg-opacity-20 |       cursor-pointer | ||||||
|  |       bg-opacity-20 | ||||||
|  |       dark:bg-gray-700 | ||||||
|       " |       " | ||||||
|       @click="isShow = !isShow" |       @click="isShow = !isShow" | ||||||
|     > |     > | ||||||
| @ -38,28 +40,42 @@ | |||||||
|     > |     > | ||||||
|       <div |       <div | ||||||
|         v-if="isShow" |         v-if="isShow" | ||||||
|         class="absolute right-0 mt-2 bg-white rounded-md shadow-lg" |         class=" | ||||||
|  |         absolute | ||||||
|  |         right-0 | ||||||
|  |         mt-2 | ||||||
|  |         bg-white | ||||||
|  |         rounded-md | ||||||
|  |         shadow-lg | ||||||
|  |         dark:border | ||||||
|  |         dark:border-white/10 | ||||||
|  |         dark:text-white | ||||||
|  |         dark:bg-gray-800/[.95] | ||||||
|  |         dark:shadow-glass | ||||||
|  |         dark:backdrop-blur-xl | ||||||
|  |         " | ||||||
|       > |       > | ||||||
|  |         <BaseDarkHighlight class="z-[-1] top-0 left-0" /> | ||||||
|         <div |         <div | ||||||
|           class=" |           class=" | ||||||
|             overflow-y-auto |           overflow-y-auto | ||||||
|             scrollbar-thin scrollbar-thumb-rounded-full |           scrollbar-thin | ||||||
|             w-[250px] |           scrollbar-thumb-rounded-full | ||||||
|             max-h-[350px] |           w-[250px] max-h-[350px] | ||||||
|             scrollbar-thumb-gray-300 scrollbar-track-gray-10 |           scrollbar-thumb-gray-300 | ||||||
|             pb-4 |           scrollbar-track-gray-10 | ||||||
|  |           pb-4 | ||||||
|           " |           " | ||||||
|         > |         > | ||||||
|           <label |           <label | ||||||
|             class=" |             class=" | ||||||
|               px-3 |             px-3 | ||||||
|               py-2 |             py-2 | ||||||
|               text-xs |             text-xs | ||||||
|               font-semibold |             font-semibold | ||||||
|               text-gray-400 |             text-gray-400 | ||||||
|               mb-0.5 |             mb-0.5 | ||||||
|               block |             block uppercase | ||||||
|               uppercase |  | ||||||
|             " |             " | ||||||
|           > |           > | ||||||
|             {{ $t('company_switcher.label') }} |             {{ $t('company_switcher.label') }} | ||||||
| @ -68,13 +84,13 @@ | |||||||
|           <div |           <div | ||||||
|             v-if="companyStore.companies.length < 1" |             v-if="companyStore.companies.length < 1" | ||||||
|             class=" |             class=" | ||||||
|               flex flex-col |             flex flex-col | ||||||
|               items-center |             items-center | ||||||
|               justify-center |             justify-center | ||||||
|               p-2 |             p-2 | ||||||
|               px-3 |             px-3 | ||||||
|               mt-4 |             mt-4 | ||||||
|               text-base text-gray-400 |             text-base text-gray-400 | ||||||
|             " |             " | ||||||
|           > |           > | ||||||
|             <BaseIcon name="ExclamationCircleIcon" class="h-5 text-gray-400" /> |             <BaseIcon name="ExclamationCircleIcon" class="h-5 text-gray-400" /> | ||||||
| @ -86,14 +102,17 @@ | |||||||
|                 v-for="(company, index) in companyStore.companies" |                 v-for="(company, index) in companyStore.companies" | ||||||
|                 :key="index" |                 :key="index" | ||||||
|                 class=" |                 class=" | ||||||
|                   p-2 |                 p-2 | ||||||
|                   px-3 |                 px-3 | ||||||
|                   rounded-md |                 rounded-md | ||||||
|                   cursor-pointer |                 cursor-pointer | ||||||
|                   hover:bg-gray-100 hover:text-primary-500 |                 hover:bg-gray-100 hover:text-primary-500 | ||||||
|  |                 dark:hover:bg-gray-700 | ||||||
|  |                 text-gray-900 | ||||||
|  |                 dark:text-white | ||||||
|                 " |                 " | ||||||
|                 :class="{ |                 :class="{ | ||||||
|                   'bg-gray-100 text-primary-500': |                   'bg-gray-100 text-primary-500 dark:bg-gray-700': | ||||||
|                     companyStore.selectedCompany.id === company.id, |                     companyStore.selectedCompany.id === company.id, | ||||||
|                 }" |                 }" | ||||||
|                 @click="changeCompany(company)" |                 @click="changeCompany(company)" | ||||||
| @ -101,18 +120,19 @@ | |||||||
|                 <div class="flex items-center"> |                 <div class="flex items-center"> | ||||||
|                   <span |                   <span | ||||||
|                     class=" |                     class=" | ||||||
|                       flex |                     flex | ||||||
|                       items-center |                     items-center | ||||||
|                       justify-center |                     justify-center | ||||||
|                       mr-3 |                     mr-3 | ||||||
|                       overflow-hidden |                     overflow-hidden | ||||||
|                       text-base |                     text-sm | ||||||
|                       font-semibold |                     font-semibold | ||||||
|                       bg-gray-200 |                     bg-gray-200 | ||||||
|                       rounded-md |                     rounded-md | ||||||
|                       w-9 |                     w-9 | ||||||
|                       h-9 |                     h-9 | ||||||
|                       text-primary-500 |                     text-primary-500 | ||||||
|  |                     dark:bg-gray-900 | ||||||
|                     " |                     " | ||||||
|                   > |                   > | ||||||
|                     <span v-if="!company.logo"> |                     <span v-if="!company.logo"> | ||||||
| @ -136,15 +156,17 @@ | |||||||
|         <div |         <div | ||||||
|           v-if="userStore.currentUser.is_owner" |           v-if="userStore.currentUser.is_owner" | ||||||
|           class=" |           class=" | ||||||
|             flex |           flex | ||||||
|             items-center |           items-center | ||||||
|             justify-center |           justify-center | ||||||
|             p-4 |           p-4 | ||||||
|             pl-3 |           pl-3 | ||||||
|             border-t-2 border-gray-100 |           border-t-2 | ||||||
|             cursor-pointer |           border-gray-100 | ||||||
|             text-primary-400 |           cursor-pointer | ||||||
|             hover:text-primary-500 |           text-primary-400 | ||||||
|  |           hover:text-primary-500 | ||||||
|  |           dark:border-gray-600 | ||||||
|           " |           " | ||||||
|           @click="addNewCompany" |           @click="addNewCompany" | ||||||
|         > |         > | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| <template> | <template> | ||||||
|   <div ref="searchBar" class="hidden rounded md:block relative"> |   <div ref="searchBar" class="hidden rounded md:block relative dark:text-white"> | ||||||
|     <div> |     <div> | ||||||
|       <BaseInput |       <BaseInput | ||||||
|         v-model="name" |         v-model="name" | ||||||
| @ -41,6 +41,11 @@ | |||||||
|           w-[300px] |           w-[300px] | ||||||
|           h-[200px] |           h-[200px] | ||||||
|           right-0 |           right-0 | ||||||
|  |           dark:border-white/10 | ||||||
|  |           dark:text-white | ||||||
|  |           dark:bg-gray-800/[.95] | ||||||
|  |           dark:shadow-glass | ||||||
|  |           dark:backdrop-blur-xl | ||||||
|         " |         " | ||||||
|       > |       > | ||||||
|         <div |         <div | ||||||
| @ -68,7 +73,7 @@ | |||||||
|             <div |             <div | ||||||
|               v-for="(customer, index) in usersStore.customerList" |               v-for="(customer, index) in usersStore.customerList" | ||||||
|               :key="index" |               :key="index" | ||||||
|               class="p-2 hover:bg-gray-100 cursor-pointer rounded-md" |               class="p-2 hover:bg-gray-100 cursor-pointer rounded-md dark:hover:bg-gray-700/40" | ||||||
|             > |             > | ||||||
|               <router-link |               <router-link | ||||||
|                 :to="{ path: `/admin/customers/${customer.id}/view` }" |                 :to="{ path: `/admin/customers/${customer.id}/view` }" | ||||||
| @ -87,6 +92,7 @@ | |||||||
|                     bg-gray-200 |                     bg-gray-200 | ||||||
|                     rounded-full |                     rounded-full | ||||||
|                     text-primary-500 |                     text-primary-500 | ||||||
|  |                     dark:bg-gray-600 | ||||||
|                   " |                   " | ||||||
|                 > |                 > | ||||||
|                   {{ initGenerator(customer.name) }} |                   {{ initGenerator(customer.name) }} | ||||||
| @ -116,7 +122,7 @@ | |||||||
|             <div |             <div | ||||||
|               v-for="(user, index) in usersStore.userList" |               v-for="(user, index) in usersStore.userList" | ||||||
|               :key="index" |               :key="index" | ||||||
|               class="p-2 hover:bg-gray-100 cursor-pointer rounded-md" |               class="p-2 hover:bg-gray-100 cursor-pointer rounded-md dark:hover:bg-gray-700/40" | ||||||
|             > |             > | ||||||
|               <router-link |               <router-link | ||||||
|                 :to="{ path: `/admin/users/${user.id}/edit` }" |                 :to="{ path: `/admin/users/${user.id}/edit` }" | ||||||
|  | |||||||
							
								
								
									
										101
									
								
								resources/scripts/components/LightDarkSwitcher.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								resources/scripts/components/LightDarkSwitcher.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,101 @@ | |||||||
|  | <!-- This example requires Tailwind CSS v2.0+ --> | ||||||
|  | <script lang="ts" setup> | ||||||
|  | import { Switch, SwitchGroup, SwitchLabel } from '@headlessui/vue' | ||||||
|  | import { useGlobalStore } from '@/scripts/admin/stores/global' | ||||||
|  | import { computed, ref } from 'vue' | ||||||
|  | defineProps({ | ||||||
|  |   showLabel: { | ||||||
|  |     type: Boolean, | ||||||
|  |     default: true, | ||||||
|  |   }, | ||||||
|  |   vertical: { | ||||||
|  |     type: Boolean, | ||||||
|  |     default: false, | ||||||
|  |   }, | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | const globalStore = useGlobalStore() | ||||||
|  |  | ||||||
|  | const enabled = ref( | ||||||
|  |   localStorage.getItem('theme') === 'dark' || | ||||||
|  |     document.documentElement.classList.contains('dark') | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | globalStore.isDarkModeOn = enabled | ||||||
|  |  | ||||||
|  | function onChange(val) { | ||||||
|  |   if (val) { | ||||||
|  |     localStorage.theme = 'dark' | ||||||
|  |     document.documentElement.classList.add('dark') | ||||||
|  |     document.documentElement.style.setProperty('color-scheme', 'dark') | ||||||
|  |     globalStore.isDarkModeOn = true | ||||||
|  |   } else { | ||||||
|  |     localStorage.theme = 'light' | ||||||
|  |     document.documentElement.classList.remove('dark') | ||||||
|  |     document.documentElement.style.setProperty('color-scheme', 'light') | ||||||
|  |     globalStore.isDarkModeOn = false | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <template> | ||||||
|  |   <div class="w-full flex justify-center"> | ||||||
|  |     <SwitchGroup | ||||||
|  |       as="div" | ||||||
|  |       class="flex items-center" | ||||||
|  |       :class="vertical ? 'flex-col justify-center' : 'flex-row'" | ||||||
|  |     > | ||||||
|  |       <Switch | ||||||
|  |         v-model="enabled" | ||||||
|  |         class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 dark:ring-offset-gray-700" | ||||||
|  |         :class="[enabled ? 'bg-primary-600' : 'bg-gray-200']" | ||||||
|  |         @update:modelValue="onChange" | ||||||
|  |       > | ||||||
|  |         <span class="sr-only">Use setting</span> | ||||||
|  |         <span | ||||||
|  |           class="pointer-events-none relative inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200" | ||||||
|  |           :class="[enabled ? 'translate-x-5' : 'translate-x-0']" | ||||||
|  |         > | ||||||
|  |           <span | ||||||
|  |             class="absolute inset-0 h-full w-full flex items-center justify-center transition-opacity" | ||||||
|  |             :class="[ | ||||||
|  |               enabled | ||||||
|  |                 ? 'opacity-0 ease-out duration-100' | ||||||
|  |                 : 'opacity-100 ease-in duration-200', | ||||||
|  |             ]" | ||||||
|  |             aria-hidden="true" | ||||||
|  |           > | ||||||
|  |             <BaseIcon class="h-3 w-3 text-yellow-500" name="SunIcon" /> | ||||||
|  |           </span> | ||||||
|  |           <span | ||||||
|  |             class="absolute inset-0 h-full w-full flex items-center justify-center transition-opacity" | ||||||
|  |             :class="[ | ||||||
|  |               enabled | ||||||
|  |                 ? 'opacity-100 ease-in duration-200' | ||||||
|  |                 : 'opacity-0 ease-out duration-100', | ||||||
|  |             ]" | ||||||
|  |             aria-hidden="true" | ||||||
|  |           > | ||||||
|  |             <BaseIcon class="h-3 w-3 text-primary-500" name="MoonIcon" /> | ||||||
|  |           </span> | ||||||
|  |         </span> | ||||||
|  |       </Switch> | ||||||
|  |       <SwitchLabel | ||||||
|  |         v-if="showLabel" | ||||||
|  |         as="span" | ||||||
|  |         class="cursor-pointer" | ||||||
|  |         :class="vertical ? 'px-1 text-center mt-2' : 'ml-3'" | ||||||
|  |       > | ||||||
|  |         <span | ||||||
|  |           v-if="enabled" | ||||||
|  |           class="text-sm font-medium text-gray-500 dark:text-gray-400" | ||||||
|  |         > | ||||||
|  |           Dark Mode | ||||||
|  |         </span> | ||||||
|  |         <span v-else class="text-sm font-medium text-gray-500"> | ||||||
|  |           Light Mode | ||||||
|  |         </span> | ||||||
|  |       </SwitchLabel> | ||||||
|  |     </SwitchGroup> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
| @ -69,7 +69,8 @@ const props = defineProps({ | |||||||
| }) | }) | ||||||
|  |  | ||||||
| const containerClasses = computed(() => { | const containerClasses = computed(() => { | ||||||
|   const baseClass = `origin-top-right rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-100 focus:outline-none` |   const baseClass = `dark:border dark:border-white/10 dark:text-white dark:bg-gray-800 dark:shadow-glass | ||||||
|  |   origin-top-right rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-100 focus:outline-none` | ||||||
|   return `${baseClass} ${props.containerClass}` |   return `${baseClass} ${props.containerClass}` | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | |||||||
| @ -2,16 +2,20 @@ | |||||||
|   <MenuItem v-slot="{ active }" v-bind="$attrs"> |   <MenuItem v-slot="{ active }" v-bind="$attrs"> | ||||||
|     <a |     <a | ||||||
|       href="#" |       href="#" | ||||||
|  |       class="group flex items-center px-4 py-2 text-sm font-normal" | ||||||
|       :class="[ |       :class="[ | ||||||
|         active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', |         active | ||||||
|         'group flex items-center px-4 py-2 text-sm font-normal', |           ? 'bg-gray-100 text-gray-900 dark:text-white dark:bg-gray-700' | ||||||
|  |           : 'text-gray-700 dark:text-gray-200', | ||||||
|       ]" |       ]" | ||||||
|     > |     > | ||||||
|       <slot :active="active" /> |       <slot :active="active" :class="defaultIconClass" /> | ||||||
|     </a> |     </a> | ||||||
|   </MenuItem> |   </MenuItem> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup> | <script setup> | ||||||
| import { MenuItem } from '@headlessui/vue' | import { MenuItem } from '@headlessui/vue' | ||||||
|  | const defaultIconClass = | ||||||
|  |   'w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500 dark:text-gray-400 dark:group-hover:text-white' | ||||||
| </script> | </script> | ||||||
|  | |||||||
| @ -17,7 +17,7 @@ | |||||||
|     <meta name="csrf-token" content="{{ csrf_token() }}"> |     <meta name="csrf-token" content="{{ csrf_token() }}"> | ||||||
|  |  | ||||||
|     <!-- Module Styles --> |     <!-- Module Styles --> | ||||||
|     @foreach(\Crater\Services\Module\ModuleFacade::allStyles() as $name => $path) |     @foreach (\Crater\Services\Module\ModuleFacade::allStyles() as $name => $path) | ||||||
|         <link rel="stylesheet" href="/modules/styles/{{ $name }}"> |         <link rel="stylesheet" href="/modules/styles/{{ $name }}"> | ||||||
|     @endforeach |     @endforeach | ||||||
|  |  | ||||||
| @ -25,8 +25,8 @@ | |||||||
| </head> | </head> | ||||||
|  |  | ||||||
| <body | <body | ||||||
|     class="h-full overflow-hidden bg-gray-100 font-base |     class="h-full overflow-hidden bg-gray-100 dark:bg-gray-900 dark:text-white font-base | ||||||
|     @if(isset($current_theme)) theme-{{ $current_theme }} @else theme-{{get_app_setting('admin_portal_theme') ?? 'crater'}} @endif "> |     @if (isset($current_theme)) theme-{{ $current_theme }} @else theme-{{ get_app_setting('admin_portal_theme') ?? 'crater' }} @endif "> | ||||||
|  |  | ||||||
|     <!-- Module Scripts --> |     <!-- Module Scripts --> | ||||||
|     @foreach (\Crater\Services\Module\ModuleFacade::allScripts() as $name => $path) |     @foreach (\Crater\Services\Module\ModuleFacade::allScripts() as $name => $path) | ||||||
| @ -38,6 +38,14 @@ | |||||||
|     @endforeach |     @endforeach | ||||||
|  |  | ||||||
|     <script type="module"> |     <script type="module"> | ||||||
|  |         if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) { | ||||||
|  |             document.documentElement.classList.add('dark') | ||||||
|  |             document.documentElement.style.setProperty('color-scheme', 'dark'); | ||||||
|  |         } else { | ||||||
|  |             document.documentElement.classList.remove('dark') | ||||||
|  |             document.documentElement.style.setProperty('color-scheme', 'light') | ||||||
|  |         } | ||||||
|  |  | ||||||
|         @if(isset($customer_logo)) |         @if(isset($customer_logo)) | ||||||
|  |  | ||||||
|         window.customer_logo = "/storage/{{$customer_logo}}" |         window.customer_logo = "/storage/{{$customer_logo}}" | ||||||
| @ -57,12 +65,12 @@ | |||||||
|  |  | ||||||
|         window.login_page_description = "{{$login_page_description}}" |         window.login_page_description = "{{$login_page_description}}" | ||||||
|  |  | ||||||
|         @endif      |         @endif | ||||||
|         @if(isset($copyright_text)) |         @if(isset($copyright_text)) | ||||||
|  |  | ||||||
|         window.copyright_text = "{{$copyright_text}}" |         window.copyright_text = "{{$copyright_text}}" | ||||||
|  |  | ||||||
|         @endif     |         @endif | ||||||
|  |  | ||||||
|         window.Crater.start() |         window.Crater.start() | ||||||
|     </script> |     </script> | ||||||
|  | |||||||
| @ -19,6 +19,7 @@ module.exports = { | |||||||
|     './resources/scripts/**/*.js', |     './resources/scripts/**/*.js', | ||||||
|     './resources/scripts/**/*.vue', |     './resources/scripts/**/*.vue', | ||||||
|   ], |   ], | ||||||
|  |   darkMode: 'class', | ||||||
|   theme: { |   theme: { | ||||||
|     extend: { |     extend: { | ||||||
|       colors: { |       colors: { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	