Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Distlist/Info.vue
Show All 32 Lines | <div class="container"> | ||||
</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> | ||||
<div v-if="list_id === 'new' || list.id" id="distlist-skus" class="row mb-3"> | |||||
<label class="col-sm-4 col-form-label">{{ $t('form.subscriptions') }}</label> | |||||
<subscription-select class="col-sm-8 pt-sm-1" ref="skus" :object="list" type="group" :readonly="true"></subscription-select> | |||||
</div> | |||||
<btn class="btn-primary" type="submit" icon="check">{{ $t('btn.submit') }}</btn> | <btn class="btn-primary" type="submit" icon="check">{{ $t('btn.submit') }}</btn> | ||||
</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 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"> | ||||
Show All 11 Lines | <div class="container"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import ListInput from '../Widgets/ListInput' | import ListInput from '../Widgets/ListInput' | ||||
import StatusComponent from '../Widgets/Status' | import StatusComponent from '../Widgets/Status' | ||||
import SubscriptionSelect from '../Widgets/SubscriptionSelect' | |||||
export default { | export default { | ||||
components: { | components: { | ||||
ListInput, | ListInput, | ||||
StatusComponent | StatusComponent, | ||||
SubscriptionSelect | |||||
}, | }, | ||||
data() { | data() { | ||||
return { | return { | ||||
list_id: null, | list_id: null, | ||||
list: { members: [], config: {} }, | list: { members: [], config: {} }, | ||||
status: {} | status: {} | ||||
} | } | ||||
}, | }, | ||||
Show All 25 Lines | export default { | ||||
statusUpdate(list) { | statusUpdate(list) { | ||||
this.list = Object.assign({}, this.list, list) | this.list = Object.assign({}, this.list, list) | ||||
}, | }, | ||||
submit() { | submit() { | ||||
this.$root.clearFormValidation($('#list-info form')) | this.$root.clearFormValidation($('#list-info form')) | ||||
let method = 'post' | let method = 'post' | ||||
let location = '/api/v4/groups' | let location = '/api/v4/groups' | ||||
let post = this.$root.pick(this.list, ['name', 'email', 'members']) | |||||
if (this.list_id !== 'new') { | if (this.list_id !== 'new') { | ||||
method = 'put' | method = 'put' | ||||
location += '/' + this.list_id | location += '/' + this.list_id | ||||
} | } | ||||
axios[method](location, this.list) | // post.skus = this.$refs.skus.getSkus() | ||||
axios[method](location, post) | |||||
.then(response => { | .then(response => { | ||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
this.$router.push({ name: 'distlists' }) | this.$router.push({ name: 'distlists' }) | ||||
}) | }) | ||||
}, | }, | ||||
submitSettings() { | submitSettings() { | ||||
this.$root.clearFormValidation($('#settings form')) | this.$root.clearFormValidation($('#settings form')) | ||||
let post = this.list.config | |||||
const post = this.$root.pick(this.list.config, [ 'sender_policy' ]) | |||||
axios.post('/api/v4/groups/' + this.list_id + '/config', post) | axios.post('/api/v4/groups/' + this.list_id + '/config', post) | ||||
.then(response => { | .then(response => { | ||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
}) | }) | ||||
} | } | ||||
} | } | ||||
} | } | ||||
</script> | </script> |