diff --git a/TODO b/TODO index 88a66191..6e39e211 100644 --- a/TODO +++ b/TODO @@ -29,10 +29,6 @@ everything related to tags: - category (from config.ini) - description - relations - - handle tag relations editing in frontend - - privileges - - template - - ajax - handle relations in autocomplete refactors: diff --git a/public_html/css/tags.css b/public_html/css/tags.css index f7fdd5a0..a2b65b00 100644 --- a/public_html/css/tags.css +++ b/public_html/css/tags.css @@ -20,6 +20,13 @@ #tag-view form { text-align: left; - max-width: 20em; + max-width: 30em; margin: 0 auto; } +#tag-view p { + margin: 0 0 0.5em 0; + line-height: normal; +} +#tag-view small { + font-size: 12px; +} diff --git a/public_html/js/Presenters/TagPresenter.js b/public_html/js/Presenters/TagPresenter.js index e13ebe78..993a7121 100644 --- a/public_html/js/Presenters/TagPresenter.js +++ b/public_html/js/Presenters/TagPresenter.js @@ -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; diff --git a/public_html/templates/tag.tpl b/public_html/templates/tag.tpl index f0c7c0b6..35c18032 100644 --- a/public_html/templates/tag.tpl +++ b/public_html/templates/tag.tpl @@ -26,6 +26,26 @@ <% } %> + <% if (privileges.canChangeImplications) { %> +
+ +
+ +

Added automatically when tagging with <%= tagName %>.

+
+
+ <% } %> + + <% if (privileges.canChangeSuggestions) { %> +
+ +
+ +

Suggested when tagging with <%= tagName %>.

+
+
+ <% } %> +