From 35a06a8419d578d0dd4522ac67c74ce27c34d62f Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 16 Jun 2020 11:34:44 -0400 Subject: [PATCH] feat: #8412 breadcrumbs for ip-blacklist/post queue/flags --- public/language/en-GB/flags.json | 1 - src/controllers/globalmods.js | 2 ++ src/controllers/mods.js | 7 +++++++ src/views/admin/manage/ip-blacklist.tpl | 4 +++- src/views/admin/manage/post-queue.tpl | 2 ++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/public/language/en-GB/flags.json b/public/language/en-GB/flags.json index b3561f9e38..fb8708fc16 100644 --- a/public/language/en-GB/flags.json +++ b/public/language/en-GB/flags.json @@ -45,7 +45,6 @@ "no-notes": "No shared notes.", "history": "Account & Flag History", - "back": "Back to Flags List", "no-history": "No flag history.", "state-all": "All states", diff --git a/src/controllers/globalmods.js b/src/controllers/globalmods.js index d2f0ae6656..71a1be2cc8 100644 --- a/src/controllers/globalmods.js +++ b/src/controllers/globalmods.js @@ -4,6 +4,7 @@ const user = require('../user'); const meta = require('../meta'); const analytics = require('../analytics'); const usersController = require('./admin/users'); +const helpers = require('./helpers'); const globalModsController = module.exports; @@ -21,6 +22,7 @@ globalModsController.ipBlacklist = async function (req, res, next) { title: '[[pages:ip-blacklist]]', rules: rules, analytics: analyticsData, + breadcrumbs: helpers.buildBreadcrumbs([{ text: '[[pages:ip-blacklist]]' }]), }); }; diff --git a/src/controllers/mods.js b/src/controllers/mods.js index b5b83d0f20..9c35a87800 100644 --- a/src/controllers/mods.js +++ b/src/controllers/mods.js @@ -12,6 +12,7 @@ const plugins = require('../plugins'); const pagination = require('../pagination'); const privileges = require('../privileges'); const utils = require('../utils'); +const helpers = require('./helpers'); const modsController = module.exports; modsController.flags = {}; @@ -94,6 +95,7 @@ modsController.flags.list = async function (req, res, next) { filters: filters, title: '[[pages:flags]]', pagination: pagination.create(flagsData.page, flagsData.pageCount, req.query), + breadcrumbs: helpers.buildBreadcrumbs([{ text: '[[pages:flags]]' }]), }); }; @@ -141,6 +143,10 @@ modsController.flags.detail = async function (req, res, next) { categories: results.categories, filters: req.session.flags_filters || [], privileges: results.privileges, + breadcrumbs: helpers.buildBreadcrumbs([ + { text: '[[pages:flags]]', url: '/flags' }, + { text: '[[pages:flag-details, ' + req.params.flagId + ']]' }, + ]), })); }; @@ -193,6 +199,7 @@ modsController.postQueue = async function (req, res, next) { title: '[[pages:post-queue]]', posts: postData, pagination: pagination.create(page, pageCount), + breadcrumbs: helpers.buildBreadcrumbs([{ text: '[[pages:post-queue]]' }]), }); }; diff --git a/src/views/admin/manage/ip-blacklist.tpl b/src/views/admin/manage/ip-blacklist.tpl index 62d0446ec4..da3fea162b 100644 --- a/src/views/admin/manage/ip-blacklist.tpl +++ b/src/views/admin/manage/ip-blacklist.tpl @@ -1,3 +1,5 @@ + +

@@ -40,7 +42,7 @@

- +
diff --git a/src/views/admin/manage/post-queue.tpl b/src/views/admin/manage/post-queue.tpl index 52e02fb9ee..decf23b657 100644 --- a/src/views/admin/manage/post-queue.tpl +++ b/src/views/admin/manage/post-queue.tpl @@ -1,3 +1,5 @@ + +