Skip to content

Commit

Permalink
add org status
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Oct 18, 2023
1 parent 56ae7fd commit 49e90a6
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Requests/RegistrationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function rules(): array
'ngo.name' => ['required', 'string'],
'ngo.description' => ['required', 'string', 'max:1000'],
'ngo.logo' => ['required', 'image'],
'ngo.statute' => ['required', 'file', 'mimes:pdf','max:15240'],
'ngo.statute' => ['required', 'file', 'mimes:pdf', 'max:15240'],
'ngo.street_address' => ['required', 'string'],
'ngo.cif' => ['required', 'string', 'unique:organizations,cif', new ValidCIF],
'ngo.contact_email' => ['required', 'email'],
Expand Down
5 changes: 4 additions & 1 deletion lang/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,10 @@

"project.labels.external_links_title": "Titlu link extern",
"project.labels.external_links_url": "URL link extern",
"project.labels.change_gallery_label": "Schimbă galeria de imagini"
"project.labels.change_gallery_label": "Schimbă galeria de imagini",

"organization_status_disabled" : "Organizația este dezactivată, vezi detalii în secțiunea de tichete",
"organization_status_pending" : "Organizația este în așteptare"



Expand Down
61 changes: 61 additions & 0 deletions resources/js/Components/OrganizationStatus.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<template>
<Teleport to="#notification-teleport-target">
<transition
enter-active-class="transition duration-300 ease-out transform"
enter-from-class="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"
enter-to-class="translate-y-0 opacity-100 sm:translate-x-0"
leave-active-class="transition duration-100 ease-in"
leave-from-class="opacity-100"
leave-to-class="opacity-0"
>
<div
v-if="isVisible"
class="w-full max-w-sm p-4 overflow-hidden bg-white rounded-lg shadow-lg pointer-events-auto ring-1 ring-black ring-opacity-5"
>
<div class="flex items-center gap-3">
<Component
:is="ExclamationCircleIcon"
class="w-6 h-6 shrink-0 text-red-500"
aria-hidden="true"
/>

<div class="flex-1 w-0">
<p class="text-sm font-medium text-gray-900" v-text="message" />
</div>

<button
type="button"
@click="hide"
class="inline-flex text-gray-400 bg-white rounded-md shrink-0 hover:text-gray-500"
>
<span class="sr-only">Close</span>
<XIcon class="w-5 h-5" aria-hidden="true" />
</button>
</div>
</div>
</transition>
</Teleport>
</template>

<script setup>
import {ref, computed, onMounted} from 'vue';
import { usePage } from '@inertiajs/vue3';
import { ExclamationCircleIcon, CheckCircleIcon, XIcon } from '@heroicons/vue/solid';
import {trans} from "laravel-vue-i18n";
const status = computed(() => usePage().props.organization_status || null);
const isVisible = ref(false);
let message = '';
const show = () => (isVisible.value = true);
const hide = () => (isVisible.value = false);
onMounted(()=>{
if (!status || status.value === 'active') {
hide();
} else {
message = trans('organization_status_'+status.value);
show();
}
});
</script>
2 changes: 2 additions & 0 deletions resources/js/Layouts/DashboardLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Navbar />

<Notification />
<OrganizationStatus />

<div class="flex items-start flex-1 gap-y-10">
<div class="p-4 mt-1 overflow-y-auto bg-white border-r border-gray-200 lg:w-72 shrink-0">
Expand Down Expand Up @@ -82,6 +83,7 @@
UserGroupIcon,
UserRemoveIcon,
} from '@heroicons/vue/outline';
import OrganizationStatus from "@/Components/OrganizationStatus.vue";
const props = defineProps({
gridClass: {
Expand Down

0 comments on commit 49e90a6

Please sign in to comment.