mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-17 14:00:29 +01:00
fix: #8175
This commit is contained in:
@@ -91,10 +91,8 @@ define('admin/manage/tags', [
|
|||||||
}
|
}
|
||||||
|
|
||||||
var firstTag = $(tagsToModify[0]);
|
var firstTag = $(tagsToModify[0]);
|
||||||
var title = tagsToModify.length > 1 ? '[[admin/manage/tags:alerts.editing-multiple]]' : '[[admin/manage/tags:alerts.editing-x, ' + firstTag.find('.tag-item').attr('data-tag') + ']]';
|
|
||||||
|
|
||||||
var modal = bootbox.dialog({
|
var modal = bootbox.dialog({
|
||||||
title: title,
|
title: '[[admin/manage/tags:alerts.editing]]',
|
||||||
message: firstTag.find('.tag-modal').html(),
|
message: firstTag.find('.tag-modal').html(),
|
||||||
buttons: {
|
buttons: {
|
||||||
success: {
|
success: {
|
||||||
@@ -140,11 +138,8 @@ define('admin/manage/tags', [
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var firstTag = $(tagsToModify[0]);
|
|
||||||
var title = tagsToModify.length > 1 ? '[[admin/manage/tags:alerts.editing-multiple]]' : '[[admin/manage/tags:alerts.editing-x, ' + firstTag.find('.tag-item').attr('data-tag') + ']]';
|
|
||||||
|
|
||||||
var modal = bootbox.dialog({
|
var modal = bootbox.dialog({
|
||||||
title: title,
|
title: '[[admin/manage/tags:alerts.editing]]',
|
||||||
message: $('.rename-modal').html(),
|
message: $('.rename-modal').html(),
|
||||||
buttons: {
|
buttons: {
|
||||||
success: {
|
success: {
|
||||||
|
|||||||
@@ -46,8 +46,6 @@ module.exports = function (Topics) {
|
|||||||
if (!tag) {
|
if (!tag) {
|
||||||
throw new Error('[[error:invalid-tag]]');
|
throw new Error('[[error:invalid-tag]]');
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = utils.cleanUpTag(tag, meta.config.maximumTagLength);
|
|
||||||
if (tag.length < (meta.config.minimumTagLength || 3)) {
|
if (tag.length < (meta.config.minimumTagLength || 3)) {
|
||||||
throw new Error('[[error:tag-too-short]]');
|
throw new Error('[[error:tag-too-short]]');
|
||||||
}
|
}
|
||||||
@@ -77,6 +75,7 @@ module.exports = function (Topics) {
|
|||||||
if (!newTagName || tag === newTagName) {
|
if (!newTagName || tag === newTagName) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
newTagName = utils.cleanUpTag(newTagName, meta.config.maximumTagLength);
|
||||||
await Topics.createEmptyTag(newTagName);
|
await Topics.createEmptyTag(newTagName);
|
||||||
await batch.processSortedSet('tag:' + tag + ':topics', async function (tids) {
|
await batch.processSortedSet('tag:' + tag + ':topics', async function (tids) {
|
||||||
const scores = await db.sortedSetScores('tag:' + tag + ':topics', tids);
|
const scores = await db.sortedSetScores('tag:' + tag + ':topics', tids);
|
||||||
|
|||||||
@@ -8,13 +8,13 @@
|
|||||||
|
|
||||||
<div class="tag-list">
|
<div class="tag-list">
|
||||||
<!-- BEGIN tags -->
|
<!-- BEGIN tags -->
|
||||||
<div class="tag-row" data-tag="{tags.value}">
|
<div class="tag-row" data-tag="{tags.valueEscaped}">
|
||||||
<div data-value="{tags.value}">
|
<div>
|
||||||
<span class="mdl-chip mdl-chip--contact tag-item" data-tag="{tags.value}" style="
|
<span class="mdl-chip mdl-chip--contact tag-item" data-tag="{tags.valueEscaped}" style="
|
||||||
<!-- IF tags.color -->color: {tags.color};<!-- ENDIF tags.color -->
|
<!-- IF tags.color -->color: {tags.color};<!-- ENDIF tags.color -->
|
||||||
<!-- IF tags.bgColor -->background-color: {tags.bgColor};<!-- ENDIF tags.bgColor -->">
|
<!-- IF tags.bgColor -->background-color: {tags.bgColor};<!-- ENDIF tags.bgColor -->">
|
||||||
<span class="mdl-chip__contact mdl-color--light-blue mdl-color-text--white tag-topic-count">{tags.score}</span>
|
<span class="mdl-chip__contact mdl-color--light-blue mdl-color-text--white tag-topic-count">{tags.score}</span>
|
||||||
<span class="mdl-chip__text">{tags.value}</span>
|
<span class="mdl-chip__text">{tags.valueEscaped}</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="tag-modal hidden">
|
<div class="tag-modal hidden">
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
<div class="rename-modal hidden">
|
<div class="rename-modal hidden">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="value">[[admin/manage/tags:name]]</label>
|
<label for="value">[[admin/manage/tags:name]]</label>
|
||||||
<input id="value" data-name="value" value="{tags.value}" class="form-control" />
|
<input id="value" data-name="value" value="" class="form-control" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user