feat: #7932, redirect to group details after creation

add private/hidden on group creation modal
v1.18.x
Barış Soner Uşaklı 5 years ago
parent 9c051386d5
commit 2444ed5c88

@ -31,9 +31,11 @@ define('admin/manage/groups', ['translator', 'benchpress'], function (translator
var submitObj = {
name: createGroupName.val(),
description: $('#create-group-desc').val(),
private: $('#create-group-private').is(':checked') ? 1 : 0,
hidden: $('#create-group-hidden').is(':checked') ? 1 : 0,
};
socket.emit('admin.groups.create', submitObj, function (err) {
socket.emit('admin.groups.create', submitObj, function (err, groupData) {
if (err) {
if (err.hasOwnProperty('message') && utils.hasLanguageKey(err.message)) {
err = '[[admin/manage/groups:alerts.create-failure]]';
@ -43,7 +45,7 @@ define('admin/manage/groups', ['translator', 'benchpress'], function (translator
createModalError.addClass('hide');
createGroupName.val('');
createModal.on('hidden.bs.modal', function () {
ajaxify.refresh();
ajaxify.go('admin/manage/groups/' + groupData.slug);
});
createModal.modal('hide');
}

@ -14,6 +14,8 @@ Groups.create = async function (socket, data) {
return await groups.create({
name: data.name,
description: data.description,
private: data.private,
hidden: data.hidden,
ownerUid: socket.uid,
});
};

@ -77,6 +77,19 @@
<label for="create-group-desc">[[admin/manage/groups:description]]</label>
<input type="text" class="form-control" id="create-group-desc" placeholder="[[admin/manage/groups:description-placeholder]]" />
</div>
<div class="form-group">
<label>
<input id="create-group-private" name="private" type="checkbox" checked>
<strong>[[admin/manage/groups:private]]</strong>
</label>
</div>
<div class="form-group">
<label>
<input id="create-group-hidden" name="hidden" type="checkbox">
<strong>[[admin/manage/groups:hidden]]</strong>
</label>
</div>
</form>
</div>
<div class="modal-footer">

Loading…
Cancel
Save