Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Distlist/Info.vue
Show All 28 Lines | <div class="container"> | ||||
<form @submit.prevent="submit" class="card-body"> | <form @submit.prevent="submit" class="card-body"> | ||||
<div v-if="list_id !== 'new'" class="row plaintext mb-3"> | <div v-if="list_id !== 'new'" class="row plaintext mb-3"> | ||||
<label for="status" class="col-sm-4 col-form-label">{{ $t('form.status') }}</label> | <label for="status" class="col-sm-4 col-form-label">{{ $t('form.status') }}</label> | ||||
<div class="col-sm-8"> | <div class="col-sm-8"> | ||||
<span :class="$root.distlistStatusClass(list) + ' form-control-plaintext'" id="status">{{ $root.distlistStatusText(list) }}</span> | <span :class="$root.distlistStatusClass(list) + ' form-control-plaintext'" id="status">{{ $root.distlistStatusText(list) }}</span> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="row mb-3"> | <div class="row mb-3"> | ||||
<label for="name" class="col-sm-4 col-form-label">{{ $t('distlist.name') }}</label> | |||||
<div class="col-sm-8"> | |||||
<input type="text" class="form-control" id="name" required v-model="list.name"> | |||||
</div> | |||||
</div> | |||||
<div class="row mb-3"> | |||||
<label for="email" class="col-sm-4 col-form-label">{{ $t('form.email') }}</label> | <label for="email" class="col-sm-4 col-form-label">{{ $t('form.email') }}</label> | ||||
<div class="col-sm-8"> | <div class="col-sm-8"> | ||||
<input type="text" class="form-control" id="email" :disabled="list_id !== 'new'" required v-model="list.email"> | <input type="text" class="form-control" id="email" :disabled="list_id !== 'new'" required v-model="list.email"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="row mb-3"> | <div class="row mb-3"> | ||||
<label for="members-input" class="col-sm-4 col-form-label">{{ $t('distlist.recipients') }}</label> | <label for="members-input" class="col-sm-4 col-form-label">{{ $t('distlist.recipients') }}</label> | ||||
<div class="col-sm-8"> | <div class="col-sm-8"> | ||||
<list-input id="members" :list="list.members"></list-input> | <list-input id="members" :list="list.members"></list-input> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<button class="btn btn-primary" type="submit"><svg-icon icon="check"></svg-icon> {{ $t('btn.submit') }}</button> | <button class="btn btn-primary" type="submit"><svg-icon icon="check"></svg-icon> {{ $t('btn.submit') }}</button> | ||||
</form> | </form> | ||||
</div> | </div> | ||||
<div class="tab-pane" id="settings" role="tabpanel" aria-labelledby="tab-settings"> | <div class="tab-pane" id="settings" role="tabpanel" aria-labelledby="tab-settings"> | ||||
<form @submit.prevent="submitSettings" class="card-body"> | <form @submit.prevent="submitSettings" class="card-body"> | ||||
<div class="row checkbox mb-3"> | <div class="row mb-3"> | ||||
<label for="sender-policy-input" class="col-sm-4 col-form-label">{{ $t('distlist.sender-policy') }}</label> | <label for="sender-policy-input" class="col-sm-4 col-form-label">{{ $t('distlist.sender-policy') }}</label> | ||||
<div class="col-sm-8 pt-2"> | <div class="col-sm-8 pt-2"> | ||||
<list-input id="sender-policy" :list="list.config.sender_policy"></list-input> | <list-input id="sender-policy" :list="list.config.sender_policy" class="mb-1"></list-input> | ||||
<small id="sender-policy-hint" class="text-muted"> | <small id="sender-policy-hint" class="text-muted"> | ||||
{{ $t('distlist.sender-policy-text') }} | {{ $t('distlist.sender-policy-text') }} | ||||
</small> | </small> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<button class="btn btn-primary" type="submit"><svg-icon icon="check"></svg-icon> {{ $t('btn.submit') }}</button> | <button class="btn btn-primary" type="submit"><svg-icon icon="check"></svg-icon> {{ $t('btn.submit') }}</button> | ||||
</form> | </form> | ||||
</div> | </div> | ||||
Show All 30 Lines | export default { | ||||
.then(response => { | .then(response => { | ||||
this.$root.stopLoading() | this.$root.stopLoading() | ||||
this.list = response.data | this.list = response.data | ||||
this.status = response.data.statusInfo | this.status = response.data.statusInfo | ||||
}) | }) | ||||
.catch(this.$root.errorHandler) | .catch(this.$root.errorHandler) | ||||
} | } | ||||
}, | }, | ||||
mounted() { | |||||
$('#name').focus() | |||||
}, | |||||
methods: { | methods: { | ||||
deleteList() { | deleteList() { | ||||
axios.delete('/api/v4/groups/' + this.list_id) | axios.delete('/api/v4/groups/' + this.list_id) | ||||
.then(response => { | .then(response => { | ||||
if (response.data.status == 'success') { | if (response.data.status == 'success') { | ||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
this.$router.push({ name: 'distlists' }) | this.$router.push({ name: 'distlists' }) | ||||
} | } | ||||
Show All 34 Lines |