mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-27 18:18:23 +02:00
feat: #7358
This commit is contained in:
@@ -88,6 +88,7 @@ function modifyGroup(group, fields) {
|
||||
escapeGroupData(group);
|
||||
group.userTitleEnabled = ([null, undefined].includes(group.userTitleEnabled)) ? 1 : group.userTitleEnabled;
|
||||
group.labelColor = validator.escape(String(group.labelColor || '#000000'));
|
||||
group.textColor = validator.escape(String(group.textColor || '#ffffff'));
|
||||
group.icon = validator.escape(String(group.icon || ''));
|
||||
group.createtimeISO = utils.toISOString(group.createtime);
|
||||
group.private = ([null, undefined].includes(group.private)) ? 1 : group.private;
|
||||
|
||||
@@ -33,6 +33,7 @@ module.exports = function (Groups) {
|
||||
description: values.description || '',
|
||||
icon: values.icon || '',
|
||||
labelColor: values.labelColor || '#000000',
|
||||
textColor: values.textColor || '#ffffff',
|
||||
};
|
||||
|
||||
if (values.hasOwnProperty('userTitle')) {
|
||||
|
||||
@@ -53,6 +53,7 @@ module.exports = function (Posts) {
|
||||
name: group.name,
|
||||
slug: group.slug,
|
||||
labelColor: group.labelColor,
|
||||
textColor: group.textColor,
|
||||
icon: group.icon,
|
||||
userTitle: group.userTitle,
|
||||
};
|
||||
|
||||
@@ -12,22 +12,34 @@
|
||||
<input type="text" class="form-control" id="change-group-desc" placeholder="A short description about your group" value="{group.description}" maxlength="255" /><br />
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label for="change-group-user-title">[[admin/manage/groups:edit.user-title]]</label>
|
||||
<input type="text" class="form-control" id="change-group-user-title" placeholder="The title of users if they are a member of this group" value="{group.userTitle}" maxlength="{maximumGroupTitleLength}" /><br />
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label for="change-group-icon">[[admin/manage/groups:edit.icon]]</label><br/>
|
||||
<i id="group-icon" class="fa fa-2x <!-- IF group.icon -->{group.icon}<!-- ELSE -->fa-shield<!-- ENDIF group.icon -->" value="{group.icon}"></i><br />
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label for="change-group-label-color">[[admin/manage/groups:edit.label-color]]</label>
|
||||
<span id="group-label-preview" class="label label-default" style="background:<!-- IF group.labelColor -->{group.labelColor}<!-- ELSE -->#000000<!-- ENDIF group.labelColor -->;">{group.userTitle}</span>
|
||||
<input id="change-group-label-color" placeholder="#0059b2" data-name="bgColor" value="{group.labelColor}" class="form-control" /><br />
|
||||
</fieldset>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<fieldset>
|
||||
<label for="change-group-user-title">[[admin/manage/groups:edit.user-title]]</label>
|
||||
<span id="group-label-preview" class="label label-default" style="color:<!-- IF group.textColor -->{group.textColor}<!-- ELSE -->#ffffff<!-- ENDIF group.textColor -->; background:<!-- IF group.labelColor -->{group.labelColor}<!-- ELSE -->#000000<!-- ENDIF group.labelColor -->;"><i id="group-icon-preview" class="fa fa-fw {group.icon} <!-- IF !group.icon -->hidden<!-- ENDIF -->"></i> {group.userTitle}</span>
|
||||
<input type="text" class="form-control" id="change-group-user-title" placeholder="The title of users if they are a member of this group" value="{group.userTitle}" maxlength="{maximumGroupTitleLength}" /><br />
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<fieldset>
|
||||
<label id="group-icon-label" for="change-group-icon">[[admin/manage/groups:edit.icon]]</label><br/>
|
||||
<i id="group-icon" class="fa fa-2x <!-- IF group.icon -->{group.icon}<!-- ENDIF group.icon -->" value="{group.icon}"></i><br />
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<fieldset>
|
||||
<label for="change-group-label-color">[[admin/manage/groups:edit.label-color]]</label>
|
||||
|
||||
<input id="change-group-label-color" placeholder="#0059b2" data-name="bgColor" value="{group.labelColor}" class="form-control" /><br />
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<fieldset>
|
||||
<label for="change-group-text-color">[[admin/manage/groups:edit.text-color]]</label>
|
||||
<input id="change-group-text-color" placeholder="#ffffff" data-name="textColor" value="{group.textColor}" class="form-control" /><br />
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
|
||||
Reference in New Issue
Block a user