diff --git a/TODO b/TODO index 96f514ab..8731cc31 100644 --- a/TODO +++ b/TODO @@ -8,7 +8,6 @@ first major release. - users: add user-configurable "about me" (should support Markdown) - tags: refresh tags.json when editing post - tags: add tag merging -- tags: add tag categories - tags: add tag descriptions - tags: add tag edit snapshots (backed-only) - misc: endless pager should include information about page number diff --git a/data/config.ini b/data/config.ini index 7cf9426b..d2e22d26 100644 --- a/data/config.ini +++ b/data/config.ini @@ -60,6 +60,7 @@ changePostFlags = regularUser, powerUser, moderator, administrator listTags = regularUser, powerUser, moderator, administrator massTag = powerUser, moderator, administrator changeTagName = moderator, administrator +changeTagCategory = moderator, administrator changeTagImplications = moderator, administrator changeTagSuggestions = moderator, administrator banTags = moderator, administrator @@ -81,6 +82,12 @@ usersPerPage = 20 [posts] postsPerPage = 40 +[tags] +categories[] = meta +categories[] = artist +categories[] = character +categories[] = copyright + [misc] thumbnailCropStyle = outside customFaviconUrl = /favicon.png diff --git a/gruntfile.js b/gruntfile.js index 27142db4..5d37306e 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -123,6 +123,7 @@ module.exports = function(grunt) { serviceName: config.basic.serviceName, templates: readTemplates(grunt), timestamp: grunt.template.today('isoDateTime'), + tagCategories: config.tags.categories, } }, dist: { diff --git a/public_html/css/tag-list.css b/public_html/css/tag-list.css index df6f495a..3ea64989 100644 --- a/public_html/css/tag-list.css +++ b/public_html/css/tag-list.css @@ -66,3 +66,20 @@ display: none; } } + +.tag-category-character, +.tag-category-character a { + color: #0a0; +} +.tag-category-copyright, +.tag-category-copyright a { + color: #a0a; +} +.tag-category-artist, +.tag-category-artist a { + color: #a00; +} +.tag-category-meta, +.tag-category-meta a { + color: #aaa; +} diff --git a/public_html/index.html b/public_html/index.html index 827a43fc..d736ba81 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -1,10 +1,16 @@ -
+ diff --git a/public_html/js/Auth.js b/public_html/js/Auth.js index 9d6e46c4..986be93b 100644 --- a/public_html/js/Auth.js +++ b/public_html/js/Auth.js @@ -45,6 +45,7 @@ App.Auth = function(_, jQuery, util, api, appState, promise) { listTags: 'listTags', massTag: 'massTag', changeTagName: 'changeTagName', + changeTagCategory: 'changeTagCategory', changeTagImplications: 'changeTagImplications', changeTagSuggestions: 'changeTagSuggestions', banTags: 'banTags', diff --git a/public_html/js/Presenters/TagPresenter.js b/public_html/js/Presenters/TagPresenter.js index 054ee2c9..c5983015 100644 --- a/public_html/js/Presenters/TagPresenter.js +++ b/public_html/js/Presenters/TagPresenter.js @@ -30,6 +30,7 @@ App.Presenters.TagPresenter = function( topNavigationPresenter.changeTitle('Tags'); privileges.canChangeName = auth.hasPrivilege(auth.privileges.changeTagName); + privileges.canChangeCategory = auth.hasPrivilege(auth.privileges.changeTagCategory); privileges.canChangeImplications = auth.hasPrivilege(auth.privileges.changeTagImplications); privileges.canChangeSuggestions = auth.hasPrivilege(auth.privileges.changeTagSuggestions); privileges.canBan = auth.hasPrivilege(auth.privileges.banTags); @@ -72,7 +73,12 @@ App.Presenters.TagPresenter = function( } function render() { - $el.html(templates.tag({privileges: privileges, tag: tag, tagName: tagName})); + $el.html(templates.tag({ + privileges: privileges, + tag: tag, + tagName: tagName, + tagCategories: JSON.parse(jQuery('head').attr('data-tag-categories')), + })); $el.find('.post-list').hide(); $el.find('form').submit(editFormSubmitted); implicationsTagInput = App.Controls.TagInput($el.find('[name=implications]')); @@ -88,6 +94,10 @@ App.Presenters.TagPresenter = function( formData.name = $form.find('[name=name]').val(); } + if (privileges.canChangeCategory) { + formData.category = $form.find('[name=category]:checked').val(); + } + if (privileges.canBan) { formData.banned = $form.find('[name=ban]').is(':checked') ? 1 : 0; } diff --git a/public_html/templates/post.tpl b/public_html/templates/post.tpl index 53ed871e..c9f964bb 100644 --- a/public_html/templates/post.tpl +++ b/public_html/templates/post.tpl @@ -73,7 +73,7 @@