Streamline form handling

This commit is contained in:
Björn Fromme
2018-11-01 16:54:33 +01:00
parent c105c12f7d
commit ce0e98fb92
2 changed files with 35 additions and 25 deletions
@@ -1,35 +1,45 @@
<template>
<div id="myep-main" v-show="!loading">
<h1>Mein Profil</h1>
<div class="row">
<div class="col-xs-12 col-md-6">
<template v-for="selectionGroup in this.crmData.selectionGroups"
v-if="hasVisibleSelections(selectionGroup)">
<h3>{{ selectionGroup.name}}</h3>
<div class="checkbox" v-for="selection in selectionGroup.selections"
v-if="selection.changeable === true">
<label :class="{ disabled: !selection.changeable}">
<input type="checkbox" class="form-control" v-model="selection.value"
:disabled="!selection.changeable" @change="saveSelections()"/>
<form @submit.prevent="saveSelections()">
<div class="row">
<div class="col-xs-12 col-md-6">
<template v-for="selectionGroup in this.crmData.selectionGroups"
v-if="hasVisibleSelections(selectionGroup)">
<h3>{{ selectionGroup.name}}</h3>
<div class="checkbox" v-for="selection in selectionGroup.selections"
v-if="selection.changeable === true">
<label :class="{ disabled: !selection.changeable}">
<input type="checkbox" class="form-control" v-model="selection.value"
:disabled="!selection.changeable"/>
<span class="cr"><i class="cr-icon glyphicon glyphicon-ok"></i></span>
{{ selection.name }}
</label>
</div>
</template>
</div>
<div class="col-xs-12 col-md-6">
<div class="checkbox" v-for="action in this.crmData.actions"
v-if="action.changeable === true">
<label :class="{ disabled: !action.changeable}">
<input type="checkbox" class="form-control"
v-model="action.value" :disabled="!action.changeable"/>
<span class="cr"><i class="cr-icon glyphicon glyphicon-ok"></i></span>
{{ selection.name }}
{{ action.name }}
</label>
</div>
</template>
</div>
<div class="col-xs-12 col-md-6">
<div class="checkbox" v-for="action in this.crmData.actions"
v-if="action.changeable === true">
<label :class="{ disabled: !action.changeable}">
<input type="checkbox" class="form-control"
v-model="action.value" :disabled="!action.changeable"
@change="saveSelections()"/>
<span class="cr"><i class="cr-icon glyphicon glyphicon-ok"></i></span>
{{ action.name }}
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<button type="submit" class="button" :disabled="loading">
Speichern
</button>
</div>
</div>
</div>
</form>
</div>
</template>
@@ -1,7 +1,7 @@
<template>
<div class="form-wrapper form--border" id="myep-main" v-show="!loading">
<h1>Teamer</h1>
<form @submit="saveTeamerData()">
<form @submit.prevent="saveTeamerData()">
<div class="row">
<div class="col-xs-12 col-md-6">
<h4>Fährst du Ski oder Board?</h4>