Merge commit 'b459592a4ece4400ae6c4d1ae0378557b6f39fdb' into v1.14.x

This commit is contained in:
Misty (Bot)
2020-06-16 20:29:58 +00:00
11 changed files with 39 additions and 13 deletions

View File

@@ -90,9 +90,9 @@
"nodebb-plugin-spam-be-gone": "0.7.1",
"nodebb-rewards-essentials": "0.1.3",
"nodebb-theme-lavender": "5.0.11",
"nodebb-theme-persona": "10.1.52",
"nodebb-theme-persona": "10.1.53",
"nodebb-theme-slick": "1.2.29",
"nodebb-theme-vanilla": "11.1.27",
"nodebb-theme-vanilla": "11.1.28",
"nodebb-widget-essentials": "4.1.0",
"nodemailer": "^6.4.6",
"passport": "^0.4.1",

View File

@@ -32,7 +32,7 @@
"view-profile": "Преглед на профила",
"start-new-chat": "Започване на нов разговор",
"go-to-target": "Преглед на целта на доклада",
"assign-to-me": "Assign To Me",
"assign-to-me": "Назначаване на мен",
"delete-post": "Изтриване на публикацията",
"purge-post": "Изчистване на публикацията",
"restore-post": "Възстановяване на публикацията",

View File

@@ -134,13 +134,13 @@
"stale.reply_anyway": "Отговаряне в тази тема въпреки това",
"link_back": "Отговор: [%1](%2)",
"diffs.title": "История на редакциите",
"diffs.description": "Тази публикация има <strong>%1</strong> варианта. Щракнете върху някоя от версиите по-долу, за да видите съдържанието ѝ в съответния момент.",
"diffs.no-revisions-description": "Тази публикация има <strong>%1</strong> варианта.",
"diffs.description": "Тази публикация има <strong>%1</strong> версии. Щракнете върху някоя от версиите по-долу, за да видите съдържанието ѝ в съответния момент.",
"diffs.no-revisions-description": "Тази публикация има <strong>%1</strong> версии.",
"diffs.current-revision": "текуща версия",
"diffs.original-revision": "оригинална версия",
"diffs.restore": "Restore this revision",
"diffs.restore-description": "A new revision will be appended to this post's edit history.",
"diffs.post-restored": "Post successfully restored to earlier revision",
"diffs.restore": "Възстановяване на тази версия",
"diffs.restore-description": "Към историята на редакциите на тази публикация ще бъде добавена нова версия.",
"diffs.post-restored": "Публикацията е възстановена успешно до по-ранна версия",
"timeago_later": "%1 по-късно",
"timeago_earlier": "%1 по-рано"
}

View File

@@ -45,7 +45,6 @@
"no-notes": "No shared notes.",
"history": "Account &amp; Flag History",
"back": "Back to Flags List",
"no-history": "No flag history.",
"state-all": "All states",

View File

@@ -4751,6 +4751,7 @@ paths:
title:
type: string
- $ref: components/schemas/Pagination.yaml#/Pagination
- $ref: components/schemas/Breadcrumbs.yaml#/Breadcrumbs
- $ref: components/schemas/CommonProps.yaml#/CommonProps
"/api/flags/{flagId}":
get:
@@ -4963,6 +4964,7 @@ paths:
additionalProperties:
description: "A list of global and admin privileges, and whether the calling user has (or has inherited) them"
type: boolean
- $ref: components/schemas/Breadcrumbs.yaml#/Breadcrumbs
- $ref: components/schemas/CommonProps.yaml#/CommonProps
/api/post-queue:
get:
@@ -5114,6 +5116,7 @@ paths:
type: string
- $ref: components/schemas/CategoryObject.yaml#/CategoryObject
- $ref: components/schemas/Pagination.yaml#/Pagination
- $ref: components/schemas/Breadcrumbs.yaml#/Breadcrumbs
- $ref: components/schemas/CommonProps.yaml#/CommonProps
/api/ip-blacklist:
get:

View File

@@ -498,7 +498,11 @@ app.cacheBuster = null;
return resultEl.addClass('hidden').find('.quick-search-results-container').html('');
}
data.posts.forEach(function (p) {
p.snippet = utils.escapeHTML($('<div>' + p.content + '</div>').text().slice(0, 80) + '...');
var text = $('<div>' + p.content + '</div>').text();
var start = Math.max(0, text.toLowerCase().indexOf(inputEl.val().toLowerCase()) - 40);
p.snippet = utils.escapeHTML((start > 0 ? '...' : '') +
text.slice(start, start + 80) +
(text.length - start > 80 ? '...' : ''));
});
app.parseAndTranslate('partials/quick-search-results', data, function (html) {
if (html.length) {

View File

@@ -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]]' }]),
});
};

View File

@@ -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]]' }]),
});
};

View File

@@ -6,6 +6,7 @@ var db = require('../database');
var categories = require('../categories');
var utils = require('../utils');
var translator = require('../translator');
const plugins = require('../plugins');
const intFields = [
'tid', 'cid', 'uid', 'mainPid', 'postcount',
@@ -21,8 +22,14 @@ module.exports = function (Topics) {
}
const keys = tids.map(tid => 'topic:' + tid);
const topics = await (fields.length ? db.getObjectsFields(keys, fields) : db.getObjects(keys));
topics.forEach(topic => modifyTopic(topic, fields));
return topics;
const result = await plugins.fireHook('filter:topic.getFields', {
tids: tids,
topics: topics,
fields: fields,
keys: keys,
});
result.topics.forEach(topic => modifyTopic(topic, fields));
return result.topics;
};
Topics.getTopicField = async function (tid, field) {

View File

@@ -1,3 +1,5 @@
<!-- IMPORT partials/breadcrumbs.tpl -->
<div class="row ip-blacklist">
<div class="col-lg-12">
<p class="lead">
@@ -40,7 +42,7 @@
</div>
<div class="panel-footer"><small>[[admin/manage/ip-blacklist:analytics.blacklist-hourly]]</small></div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<div><canvas id="blacklist:daily" height="250"></canvas></div>

View File

@@ -1,3 +1,5 @@
<!-- IMPORT partials/breadcrumbs.tpl -->
<div class="row">
<div class="col-xs-12">
<div class="post-queue panel panel-primary preventSlideout">