mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Added tag banning
This commit is contained in:
@ -45,6 +45,7 @@ App.Auth = function(_, jQuery, util, api, appState, promise) {
|
||||
listTags: 'listTags',
|
||||
massTag: 'massTag',
|
||||
changeTagName: 'changeTagName',
|
||||
banTags: 'banTags',
|
||||
|
||||
viewHistory: 'viewHistory',
|
||||
};
|
||||
|
@ -28,6 +28,7 @@ App.Presenters.TagPresenter = function(
|
||||
topNavigationPresenter.changeTitle('Tags');
|
||||
|
||||
privileges.canChangeName = auth.hasPrivilege(auth.privileges.changeTagName);
|
||||
privileges.canBan = auth.hasPrivilege(auth.privileges.banTags);
|
||||
|
||||
promise.wait(
|
||||
util.promiseTemplate('tag'),
|
||||
@ -81,6 +82,10 @@ App.Presenters.TagPresenter = function(
|
||||
formData.name = $form.find('[name=name]').val();
|
||||
}
|
||||
|
||||
if (privileges.canBan) {
|
||||
formData.banned = $form.find('[name=ban]').is(':checked') ? 1 : 0;
|
||||
}
|
||||
|
||||
promise.wait(api.put('/tags/' + tag.name, formData))
|
||||
.then(function(response) {
|
||||
tag = response.json;
|
||||
|
Reference in New Issue
Block a user