Remove v-if from tabs in member form
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2022-05-17 00:04:00 +02:00
parent ee219bd29d
commit b8a1ea9c8e
3 changed files with 43 additions and 28 deletions

View File

@ -103,7 +103,7 @@ class MemberController extends Controller
'regions' => Region::where('is_null', false)->pluck('name', 'id'), 'regions' => Region::where('is_null', false)->pluck('name', 'id'),
'nationalities' => Nationality::pluck('name', 'id'), 'nationalities' => Nationality::pluck('name', 'id'),
'confessions' => Confession::where('is_null', false)->pluck('name', 'id'), 'confessions' => Confession::where('is_null', false)->pluck('name', 'id'),
'subscriptions' => Subscription::pluck('name', 'id'), 'subscriptions' => Subscription::select('name', 'id')->get(),
'data' => new MemberResource($member), 'data' => new MemberResource($member),
'mode' => 'edit', 'mode' => 'edit',
'conflict' => '1' === $request->query('conflict', '0'), 'conflict' => '1' === $request->query('conflict', '0'),

View File

@ -8,8 +8,11 @@
<select :disabled="disabled" :value="value" @change="trigger"> <select :disabled="disabled" :value="value" @change="trigger">
<option v-if="placeholder" v-html="placeholder" :value="null"></option> <option v-if="placeholder" v-html="placeholder" :value="null"></option>
<option v-for="option in parsedOptions" :key="option.id" <option
v-html="option.name" :value="option.id" v-for="option in parsedOptions"
:key="option.id"
v-html="option.name"
:value="option.id"
></option> ></option>
</select> </select>
<div class="info-wrap"> <div class="info-wrap">
@ -34,63 +37,69 @@ export default {
props: { props: {
disabled: { disabled: {
type: Boolean, type: Boolean,
default: function() { return false; } default: function () {
return false;
},
}, },
id: {}, id: {},
inset: { inset: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
size: { size: {
default: function() { return 'base'; } default: function () {
return 'base';
},
}, },
emptyLabel: { emptyLabel: {
default: false, default: false,
type: Boolean type: Boolean,
}, },
value: { value: {
default: undefined default: undefined,
}, },
label: { label: {
default: null default: null,
}, },
required: { required: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
placeholder: { placeholder: {
default: '--kein--', default: '--kein--',
type: String type: String,
}, },
def: { def: {
required: false, required: false,
type: Number, type: Number,
default: -1 default: -1,
}, },
hint: {}, hint: {},
options: { options: {
default: function() { return []; } default: function () {
} return [];
},
},
}, },
computed: { computed: {
parsedOptions() { parsedOptions() {
return Array.isArray(this.options) return Array.isArray(this.options)
? this.options ? this.options
: map(this.options, (value, key) => { : map(this.options, (value, key) => {
return {'name': value, id: key}; return {name: value, id: key};
}); });
} },
}, },
methods: { methods: {
trigger(v) { trigger(v) {
this.$emit('input', isNaN(parseInt(v.target.value)) this.$emit(
? (v.target.value ? v.target.value : null) 'input',
: parseInt(v.target.value) isNaN(parseInt(v.target.value)) ? (v.target.value ? v.target.value : null) : parseInt(v.target.value)
); );
}, },
clear() { clear() {
this.$emit('input', null); this.$emit('input', null);
} },
}, },
mounted() { mounted() {
if (this.def !== -1 && typeof this.value === 'undefined') { if (this.def !== -1 && typeof this.value === 'undefined') {
@ -101,12 +110,18 @@ export default {
if (this.placeholder && typeof this.value === 'undefined') { if (this.placeholder && typeof this.value === 'undefined') {
this.$emit('input', null); this.$emit('input', null);
} }
} },
}; };
</script> </script>
<style scope> <style scope>
.inset-bg { .inset-bg {
background: linear-gradient(to bottom, hsl(247.5, 66.7%, 97.6%) 0%, hsl(247.5, 66.7%, 97.6%) 41%, hsl(0deg 0% 100%) 41%, hsl(180deg 0% 100%) 100%); background: linear-gradient(
to bottom,
hsl(247.5, 66.7%, 97.6%) 0%,
hsl(247.5, 66.7%, 97.6%) 41%,
hsl(0deg 0% 100%) 41%,
hsl(180deg 0% 100%) 100%
);
} }
</style> </style>

View File

@ -45,7 +45,7 @@
<!-- ***************************** Hauptbereich ****************************** --> <!-- ***************************** Hauptbereich ****************************** -->
<div class="grow"> <div class="grow">
<div class="grid grid-cols-2 gap-3 p-4" v-if="menuTitle == 'Stammdaten'"> <div class="grid grid-cols-2 gap-3 p-4" v-show="menuTitle == 'Stammdaten'">
<f-select id="gender_id" :options="genders" v-model="inner.gender_id" label="Geschlecht"></f-select> <f-select id="gender_id" :options="genders" v-model="inner.gender_id" label="Geschlecht"></f-select>
<f-text id="firstname" v-model="inner.firstname" label="Vorname" required></f-text> <f-text id="firstname" v-model="inner.firstname" label="Vorname" required></f-text>
<f-text id="lastname" v-model="inner.lastname" label="Nachname" required></f-text> <f-text id="lastname" v-model="inner.lastname" label="Nachname" required></f-text>
@ -95,7 +95,7 @@
></f-select> ></f-select>
</div> </div>
</div> </div>
<div class="grid grid-cols-2 gap-3 p-4" v-if="menuTitle == 'Kontakt'"> <div class="grid grid-cols-2 gap-3 p-4" v-show="menuTitle == 'Kontakt'">
<f-text id="main_phone" v-model="inner.main_phone" label="Telefon (Eltern)"></f-text> <f-text id="main_phone" v-model="inner.main_phone" label="Telefon (Eltern)"></f-text>
<f-text id="mobile_phone" v-model="inner.mobile_phone" label="Handy (Eltern)"></f-text> <f-text id="mobile_phone" v-model="inner.mobile_phone" label="Handy (Eltern)"></f-text>
<f-text id="work_phone" v-model="inner.work_phone" label="Tel geschäftlich (Eltern)"></f-text> <f-text id="work_phone" v-model="inner.work_phone" label="Tel geschäftlich (Eltern)"></f-text>
@ -104,7 +104,7 @@
<f-text id="email_parents" v-model="inner.email_parents" label="E-Mail eltern"></f-text> <f-text id="email_parents" v-model="inner.email_parents" label="E-Mail eltern"></f-text>
<f-text id="fax" v-model="inner.fax" label="Fax"></f-text> <f-text id="fax" v-model="inner.fax" label="Fax"></f-text>
</div> </div>
<div class="grid grid-cols-2 gap-3 p-4" v-if="menuTitle == 'System'"> <div class="grid grid-cols-2 gap-3 p-4" v-show="menuTitle == 'System'">
<f-select <f-select
:options="billKinds" :options="billKinds"
id="bill_kind_id" id="bill_kind_id"
@ -112,7 +112,7 @@
label="Rechnung versenden über" label="Rechnung versenden über"
></f-select> ></f-select>
</div> </div>
<div class="grid grid-cols-2 gap-3 p-4" v-if="menuTitle == 'Prävention'"> <div class="grid grid-cols-2 gap-3 p-4" v-show="menuTitle == 'Prävention'">
<div class="grid grid-cols-[max-content_1fr] col-span-2 gap-3"> <div class="grid grid-cols-[max-content_1fr] col-span-2 gap-3">
<f-switch id="has_efz" v-model="hasEfz" label="Führungszeugnis eingesehen"></f-switch> <f-switch id="has_efz" v-model="hasEfz" label="Führungszeugnis eingesehen"></f-switch>
<div> <div>
@ -184,7 +184,7 @@
></f-switch> ></f-switch>
</div> </div>
</div> </div>
<div class="grid grid-cols-4 gap-3 p-4" v-if="menuTitle == 'Verwaltung'"> <div class="grid grid-cols-4 gap-3 p-4" v-show="menuTitle == 'Verwaltung'">
<f-switch id="has_nami" v-model="inner.has_nami" label="In Nami eintragen"></f-switch> <f-switch id="has_nami" v-model="inner.has_nami" label="In Nami eintragen"></f-switch>
<f-switch id="send_newspaper" v-model="inner.send_newspaper" label="Mittendrin versenden"></f-switch> <f-switch id="send_newspaper" v-model="inner.send_newspaper" label="Mittendrin versenden"></f-switch>
<f-text <f-text