Added tag relationship management to frontend

This commit is contained in:
Marcin Kurczewski
2014-10-15 20:07:45 +02:00
parent 5815f156a8
commit a8cb78382c
4 changed files with 38 additions and 5 deletions

View File

@ -28,6 +28,8 @@ App.Presenters.TagPresenter = function(
topNavigationPresenter.changeTitle('Tags');
privileges.canChangeName = auth.hasPrivilege(auth.privileges.changeTagName);
privileges.canChangeImplications = auth.hasPrivilege(auth.privileges.changeTagImplications);
privileges.canChangeSuggestions = auth.hasPrivilege(auth.privileges.changeTagSuggestions);
privileges.canBan = auth.hasPrivilege(auth.privileges.banTags);
promise.wait(
@ -86,6 +88,14 @@ App.Presenters.TagPresenter = function(
formData.banned = $form.find('[name=ban]').is(':checked') ? 1 : 0;
}
if (privileges.canChangeImplications) {
formData.implications = $form.find('[name=implications]').val();
}
if (privileges.canChangeSuggestions) {
formData.suggestions = $form.find('[name=suggestions]').val();
}
promise.wait(api.put('/tags/' + tag.name, formData))
.then(function(response) {
tag = response.json;