Forbidden words comment field.
This commit is contained in:
@ -101,6 +101,16 @@
|
||||
/>
|
||||
<p class="form-group-description">{{forbiddenWordsReasonDesc}}</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="peertube-livechat-forbidden-words-comments-{{fieldNumber}}">{{forbiddenWordsComments}}</label>
|
||||
{{! warning: don't add extra line break in textarea! }}
|
||||
<textarea
|
||||
name="forbidden_words_comments_{{fieldNumber}}"
|
||||
id="peertube-livechat-forbidden-words-comments-{{fieldNumber}}"
|
||||
class="form-control"
|
||||
>{{comments}}</textarea>
|
||||
<p class="form-group-description">{{forbiddenWordsCommentsDesc}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/forbiddenWordsArray}}
|
||||
|
@ -91,6 +91,12 @@ async function fillLabels (
|
||||
view.forbiddenWordsApplyToModeratorsDesc = await peertubeHelpers.translate(
|
||||
LOC_LIVECHAT_CONFIGURATION_CHANNEL_FORBIDDEN_WORDS_APPLYTOMODERATORS_DESC
|
||||
)
|
||||
view.forbiddenWordsComments = await peertubeHelpers.translate(
|
||||
LOC_LIVECHAT_CONFIGURATION_CHANNEL_FORBIDDEN_WORDS_COMMENTS_LABEL
|
||||
)
|
||||
view.forbiddenWordsCommentsDesc = await peertubeHelpers.translate(
|
||||
LOC_LIVECHAT_CONFIGURATION_CHANNEL_FORBIDDEN_WORDS_COMMENTS_DESC
|
||||
)
|
||||
view.quoteLabel = await peertubeHelpers.translate(LOC_LIVECHAT_CONFIGURATION_CHANNEL_QUOTE_LABEL)
|
||||
view.quoteDesc = await peertubeHelpers.translate(LOC_LIVECHAT_CONFIGURATION_CHANNEL_QUOTE_DESC)
|
||||
view.quoteDesc2 = await peertubeHelpers.translate(LOC_LIVECHAT_CONFIGURATION_CHANNEL_QUOTE_DESC2)
|
||||
|
@ -43,7 +43,8 @@ async function getConfigurationChannelViewData (
|
||||
joinedEntries: fw.entries.join('\n'),
|
||||
regexp: !!fw.regexp,
|
||||
applyToModerators: fw.applyToModerators,
|
||||
reason: fw.reason
|
||||
reason: fw.reason,
|
||||
comments: fw.comments
|
||||
})
|
||||
}
|
||||
// Ensuring we have at least N blocks:
|
||||
@ -57,7 +58,8 @@ async function getConfigurationChannelViewData (
|
||||
joinedEntries: '',
|
||||
regexp: false,
|
||||
applyToModerators: false,
|
||||
reason: ''
|
||||
reason: '',
|
||||
comments: ''
|
||||
})
|
||||
continue
|
||||
}
|
||||
@ -231,6 +233,7 @@ async function vivifyConfigurationChannel (
|
||||
const regexp = data.get('forbidden_words_regexp_' + i.toString())
|
||||
const applyToModerators = data.get('forbidden_words_applytomoderators_' + i.toString())
|
||||
const reason = data.get('forbidden_words_reason_' + i.toString())?.toString()
|
||||
const comments = data.get('forbidden_words_comments_' + i.toString())?.toString()
|
||||
const fw: ChannelConfigurationOptions['bot']['forbiddenWords'][0] = {
|
||||
entries,
|
||||
applyToModerators: !!applyToModerators,
|
||||
@ -239,6 +242,9 @@ async function vivifyConfigurationChannel (
|
||||
if (reason) {
|
||||
fw.reason = reason
|
||||
}
|
||||
if (comments) {
|
||||
fw.comments = comments
|
||||
}
|
||||
channelConfigurationOptions.bot.forbiddenWords.push(fw)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user