Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</query>

<query name="findAllGroups">
<![CDATA[from Group]]>
<![CDATA[from Group order by name]]>
</query>

<query name="findGroupsOfUser">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ label.registration.success.2=s
label.search.user=Search user
label.search.user.empty=No users found
label.user.groups=Groups
label.user.groups.select.placeHolder=Select a group...
label.user.group.add.error=Error on add group
label.user.group.delete.error=Error on delete group

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,3 +468,4 @@ label.user.groups=Groups
label.connection.lost.genericError=Connection to the server was lost
label.user.group.delete.error=Error on delete group
label.user.group.add.error=Error on add group
label.user.groups.select.placeHolder=Select a group...
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,4 @@ label.user.groups=\u0413\u0440\u0443\u043F\u043F\u044B
label.connection.lost.genericError=\u041F\u043E\u0442\u0435\u0440\u044F\u043D\u043E \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043E\u043C
label.user.group.delete.error=\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0438 \u0438\u0437 \u0433\u0440\u0443\u043F\u043F\u044B
label.user.group.add.error=\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0438 \u0432 \u0433\u0440\u0443\u043F\u043F\u0443
label.user.groups.select.placeHolder=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0433\u0440\u0443\u043F\u043F\u044B...
Original file line number Diff line number Diff line change
Expand Up @@ -494,3 +494,4 @@ label.connection.lost.genericError=\u0417'\u0454\u0434\u043D\u0430\u043D\u043D\u
label.user.group.delete.error=\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043D\u0456 \u0437 \u0433\u0440\u0443\u043F\u0438
label.user.group.add.error=\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0434\u043E\u0434\u0430\u0432\u0430\u043D\u043D\u0456 \u0434\u043E \u0433\u0440\u0443\u043F\u0438
label.registration.success.1=
label.user.groups.select.placeHolder=\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u0433\u0440\u0443\u043F\u0438...
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@
</a>
</td>
<td>
<span class="groups-button" onclick="return window.userSearch.toggleUserGroups(event, ${user.id});">
<a href="#" onclick="return window.userSearch.toggleUserGroups(event, ${user.id});">
<spring:message code="label.user.groups"/>
</span>
</a>
</td>
</tr>
<tr class="grid-row" style="display: none;" id="user-groups-table-${user.id}" >
<td colspan="4">
<select data-placeholder="Choose a groups..." class="user-groups-select" data-user-id="${user.id}" multiple="multiple" style="width: 100%">
<select data-placeholder="<spring:message code="label.user.groups.select.placeHolder" />" class="user-groups-select" data-user-id="${user.id}" multiple="multiple" style="width: 100%">
<c:forEach var="group" items="${groups}">
<option value="${group.id}">${group.name}</option>
</c:forEach>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,6 @@ $labelNotLoggedInError = '<spring:message code="label.not.logged.in.error" htmlE
$pollItemsSize = '<spring:message code="poll.items.size" htmlEscape="true" text=""/>';
$pollItemLength = '<spring:message code="poll.item.length" htmlEscape="true" text=""/>';

$labelConnectionLostGenericError = '<spring:message code="label.connection.lost.genericError" htmlEscape="true"/>';
$labelConnectionLostGenericError = "<spring:message code="label.connection.lost.genericError" htmlEscape="false"/>";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would allow for HTML Injections, wouldn't it? If we change the message at some point in the future there is a risk that we break HTML.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then, maybe we should use "`" symbol for "З'єднання" word?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's hackish. We've got this symbol in other places, how is it working there?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Key label.announcement (Помітити як об'яву) used in topicForm.jsp:

<spring:message code="label.announcement"/>

without escape

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay then, let's leave it. I guess this issue relates to #20

$labelUserGroupAddError = '<spring:message code="label.user.group.add.error" htmlEscape="true"/>';
$labelUserGroupDeleteError = '<spring:message code="label.user.group.delete.error" htmlEscape="true"/>';
Original file line number Diff line number Diff line change
Expand Up @@ -1231,15 +1231,4 @@ pre.prettyprint {

.grid-row {
background-color: #ffffff !important;
}

.groups-button {
color: #0088cc;
cursor: pointer;
}

.groups-button:hover {
color: #005580;
text-decoration: underline;
cursor: pointer;
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,31 @@ userSearch.groupDeleted = function(userID, groupID) {
};

userSearch.toggleUserGroups = function(event, userID) {
$('#user-groups-table-' + userID).toggle(0, function() {
if($(this).is(":visible")) {
userSearch.showUserGroups(userID);
}
});
var userGroupsTable = $('#user-groups-table-' + userID);
if (!userGroupsTable.is(":visible")) {
userSearch.showUserGroups(userID, function() {
var chosenContainer = userGroupsTable.find('.chosen-container');
chosenContainer.css({width: '100%'});
chosenContainer.find('.search-field input').css({width: '100%'});
userGroupsTable.toggle(); // show only after fetch
});
} else {
userGroupsTable.toggle();
}
event.preventDefault();
event.stopPropagation();
return false;
};

userSearch.showUserGroups = function(userID) {
userSearch.showUserGroups = function(userID, callback) {
$.get($root + "/user/" + userID + "/groups", function (result) {
var multiSelect = $("#user-groups-table-" + userID + " .user-groups-select");
multiSelect.val(result.result);

// trigger changed event if chosen already applied
if (multiSelect.next('.chosen-container').length) {
multiSelect.trigger("chosen:updated");
callback();
return;
}

Expand All @@ -99,6 +109,8 @@ userSearch.showUserGroups = function(userID) {
userSearch.groupDeleted(userID, params.deselected);
}
});

callback();
}).fail(userSearch.connectionErrorCallback);
};