mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-02 02:21:14 +01:00
dont escape group.name, use displayName in tpls instead
This commit is contained in:
@@ -18,7 +18,7 @@ define('admin/manage/group', [
|
||||
searchDelay;
|
||||
|
||||
|
||||
var groupName = decodeURIComponent(ajaxify.data.group.nameEncoded);
|
||||
var groupName = ajaxify.data.group.name;
|
||||
|
||||
changeGroupUserTitle.keyup(function() {
|
||||
groupLabelPreview.text(changeGroupUserTitle.val());
|
||||
|
||||
@@ -13,7 +13,7 @@ define('forum/groups/details', ['iconSelect', 'components', 'forum/infinitescrol
|
||||
var detailsPage = components.get('groups/container'),
|
||||
settingsFormEl = detailsPage.find('form');
|
||||
|
||||
groupName = decodeURIComponent(ajaxify.data.group.nameEncoded);
|
||||
groupName = ajaxify.data.group.name;
|
||||
|
||||
if (ajaxify.data.group.isOwner) {
|
||||
Details.prepareSettings();
|
||||
|
||||
@@ -116,14 +116,14 @@
|
||||
// Groups helpers
|
||||
helpers.membershipBtn = function(groupObj) {
|
||||
if (groupObj.isMember) {
|
||||
return '<button class="btn btn-danger" data-action="leave" data-group="' + groupObj.name + '"><i class="fa fa-times"></i> Leave Group</button>';
|
||||
return '<button class="btn btn-danger" data-action="leave" data-group="' + groupObj.displayName + '"><i class="fa fa-times"></i> Leave Group</button>';
|
||||
} else {
|
||||
if (groupObj.isPending) {
|
||||
return '<button class="btn btn-warning disabled"><i class="fa fa-clock-o"></i> Invitation Pending</button>';
|
||||
} else if (groupObj.isInvited) {
|
||||
return '<button class="btn btn-link" data-action="rejectInvite" data-group="' + groupObj.name + '">Reject</button><button class="btn btn-success" data-action="acceptInvite" data-group="' + groupObj.name + '"><i class="fa fa-plus"></i> Accept Invitation</button>';
|
||||
return '<button class="btn btn-link" data-action="rejectInvite" data-group="' + groupObj.displayName + '">Reject</button><button class="btn btn-success" data-action="acceptInvite" data-group="' + groupObj.name + '"><i class="fa fa-plus"></i> Accept Invitation</button>';
|
||||
} else {
|
||||
return '<button class="btn btn-success" data-action="join" data-group="' + groupObj.name + '"><i class="fa fa-plus"></i> Join Group</button>';
|
||||
return '<button class="btn btn-success" data-action="join" data-group="' + groupObj.displayName + '"><i class="fa fa-plus"></i> Join Group</button>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -226,9 +226,9 @@ var async = require('async'),
|
||||
Groups.escapeGroupData = function(group) {
|
||||
if (group) {
|
||||
group.nameEncoded = encodeURIComponent(group.name);
|
||||
group.name = validator.escape(group.name);
|
||||
group.displayName = validator.escape(group.name);
|
||||
group.description = validator.escape(group.description);
|
||||
group.userTitle = validator.escape(group.userTitle) || group.name;
|
||||
group.userTitle = validator.escape(group.userTitle) || group.displayName;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="row">
|
||||
<form role="form" class="group" data-groupname="{group.name}">
|
||||
<form role="form" class="group" data-groupname="{group.displayName}">
|
||||
<div class="col-md-9">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><i class="fa fa-folder"></i> Group Settings</div>
|
||||
@@ -9,7 +9,7 @@
|
||||
<fieldset>
|
||||
<div class="col-xs-12">
|
||||
<label for="change-group-name">Name</label>
|
||||
<input type="text" class="form-control" id="change-group-name" placeholder="Group Name" value="{group.name}" <!-- IF group.system -->readonly<!-- ENDIF group.system -->/>
|
||||
<input type="text" class="form-control" id="change-group-name" placeholder="Group Name" value="{group.displayName}" <!-- IF group.system -->readonly<!-- ENDIF group.system -->/>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
@@ -123,4 +123,3 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" template-variable="groupName" value="{group.name}" />
|
||||
@@ -12,9 +12,9 @@
|
||||
<th>Group Description</th>
|
||||
</tr>
|
||||
<!-- BEGIN groups -->
|
||||
<tr data-groupname="{groups.name}">
|
||||
<tr data-groupname="{groups.displayName}">
|
||||
<td>
|
||||
{groups.name}
|
||||
{groups.displayName}
|
||||
<!-- IF groups.system -->
|
||||
<span class="badge">System Group</span>
|
||||
<!-- ENDIF groups.system -->
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!-- BEGIN groups -->
|
||||
<li data-name="{groups.name}">
|
||||
<li data-name="{groups.displayName}">
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
Privileges <span class="caret"></span>
|
||||
@@ -11,6 +11,6 @@
|
||||
<li role="presentation"><a href="#" data-priv="groups:topics:reply" class="<!-- IF groups.privileges.groups:topics:reply -->active<!-- ENDIF groups.privileges.groups:topics:reply -->">Reply to Topics</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{groups.name}
|
||||
{groups.displayName}
|
||||
</li>
|
||||
<!-- END groups -->
|
||||
@@ -1,2 +1,2 @@
|
||||
<input type="hidden" template-variable="group_name" value="{group.name}" />
|
||||
<input type="hidden" template-variable="group_name" value="{group.displayName}" />
|
||||
<input type="hidden" template-variable="is_owner" value="{group.isOwner}" />
|
||||
Reference in New Issue
Block a user