v1.18.x
Barış Soner Uşaklı 5 years ago
parent 41c20761e1
commit bc93b5676c

@ -91,10 +91,8 @@ define('admin/manage/tags', [
}
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({
title: title,
title: '[[admin/manage/tags:alerts.editing]]',
message: firstTag.find('.tag-modal').html(),
buttons: {
success: {
@ -140,11 +138,8 @@ define('admin/manage/tags', [
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({
title: title,
title: '[[admin/manage/tags:alerts.editing]]',
message: $('.rename-modal').html(),
buttons: {
success: {

@ -46,8 +46,6 @@ module.exports = function (Topics) {
if (!tag) {
throw new Error('[[error:invalid-tag]]');
}
tag = utils.cleanUpTag(tag, meta.config.maximumTagLength);
if (tag.length < (meta.config.minimumTagLength || 3)) {
throw new Error('[[error:tag-too-short]]');
}
@ -77,6 +75,7 @@ module.exports = function (Topics) {
if (!newTagName || tag === newTagName) {
return;
}
newTagName = utils.cleanUpTag(newTagName, meta.config.maximumTagLength);
await Topics.createEmptyTag(newTagName);
await batch.processSortedSet('tag:' + tag + ':topics', async function (tids) {
const scores = await db.sortedSetScores('tag:' + tag + ':topics', tids);

@ -8,13 +8,13 @@
<div class="tag-list">
<!-- BEGIN tags -->
<div class="tag-row" data-tag="{tags.value}">
<div data-value="{tags.value}">
<span class="mdl-chip mdl-chip--contact tag-item" data-tag="{tags.value}" style="
<div class="tag-row" data-tag="{tags.valueEscaped}">
<div>
<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.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__text">{tags.value}</span>
<span class="mdl-chip__text">{tags.valueEscaped}</span>
</span>
</div>
<div class="tag-modal hidden">
@ -79,7 +79,7 @@
<div class="rename-modal hidden">
<div class="form-group">
<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>

Loading…
Cancel
Save