mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-24 23:51:18 +01:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
2
.github/workflows/test.yaml
vendored
2
.github/workflows/test.yaml
vendored
@@ -5,10 +5,12 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
- bootstrap5
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
- bootstrap5
|
||||
|
||||
defaults:
|
||||
run:
|
||||
|
||||
@@ -87,13 +87,13 @@ define('search', ['translator', 'storage', 'hooks', 'alerts'], function (transla
|
||||
const filterCategoryEl = quickSearchResults.find('.filter-category');
|
||||
|
||||
function updateCategoryFilterName() {
|
||||
if (ajaxify.data.template.category) {
|
||||
if (ajaxify.data.template.category && ajaxify.data.cid) {
|
||||
translator.translate('[[search:search-in-category, ' + ajaxify.data.name + ']]', function (translated) {
|
||||
const name = $('<div></div>').html(translated).text();
|
||||
filterCategoryEl.find('.name').text(name);
|
||||
});
|
||||
}
|
||||
filterCategoryEl.toggleClass('hidden', !ajaxify.data.template.category);
|
||||
filterCategoryEl.toggleClass('hidden', !(ajaxify.data.template.category && ajaxify.data.cid));
|
||||
}
|
||||
|
||||
function doSearch() {
|
||||
@@ -101,7 +101,7 @@ define('search', ['translator', 'storage', 'hooks', 'alerts'], function (transla
|
||||
options.searchOptions.term = inputEl.val();
|
||||
updateCategoryFilterName();
|
||||
|
||||
if (ajaxify.data.template.category) {
|
||||
if (ajaxify.data.template.category && ajaxify.data.cid) {
|
||||
if (filterCategoryEl.find('input[type="checkbox"]').is(':checked')) {
|
||||
options.searchOptions.categories = [ajaxify.data.cid];
|
||||
options.searchOptions.searchChildren = true;
|
||||
|
||||
@@ -86,15 +86,16 @@ module.exports = function (middleware) {
|
||||
}
|
||||
return next();
|
||||
}
|
||||
if (parseInt(req.uid, 10) > 0 || !meta.config.autoDetectLang) {
|
||||
return next();
|
||||
|
||||
if (meta.config.autoDetectLang && req.uid === 0) {
|
||||
const langs = await listCodes();
|
||||
const lang = req.acceptsLanguages(langs);
|
||||
if (!lang) {
|
||||
return next();
|
||||
}
|
||||
req.query.lang = lang;
|
||||
}
|
||||
const langs = await listCodes();
|
||||
const lang = req.acceptsLanguages(langs);
|
||||
if (!lang) {
|
||||
return next();
|
||||
}
|
||||
req.query.lang = lang;
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
@@ -141,6 +141,7 @@
|
||||
|
||||
.notification-body img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user