Changed access rank <select> to radio boxes
This commit is contained in:
parent
4751270228
commit
aa46b4a14b
2 changed files with 17 additions and 15 deletions
|
@ -106,7 +106,7 @@ App.Presenters.UserAccountSettingsPresenter = function(
|
||||||
formData.passwordConfirmation = $el.find('[name=passwordConfirmation]').val();
|
formData.passwordConfirmation = $el.find('[name=passwordConfirmation]').val();
|
||||||
}
|
}
|
||||||
if (privileges.canChangeAccessRank) {
|
if (privileges.canChangeAccessRank) {
|
||||||
formData.accessRank = $el.find('[name=access-rank]').val();
|
formData.accessRank = $el.find('[name=access-rank]:checked').val();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!validateAccountSettingsFormData(formData)) {
|
if (!validateAccountSettingsFormData(formData)) {
|
||||||
|
|
|
@ -71,20 +71,22 @@
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label class="form-label" for="account-settings-access-rank">Access rank:</label>
|
<label class="form-label" for="account-settings-access-rank">Access rank:</label>
|
||||||
<div class="form-input">
|
<div class="form-input">
|
||||||
<select name="access-rank" id="account-settings-access-rank">
|
<%
|
||||||
<%
|
var accessRanks = {
|
||||||
var accessRanks = {
|
anonymous: 'Anonymous',
|
||||||
anonymous: 'Anonymous',
|
regularUser: 'Regular user',
|
||||||
regularUser: 'Regular user',
|
powerUser: 'Power user',
|
||||||
powerUser: 'Power user',
|
moderator: 'Moderator',
|
||||||
moderator: 'Moderator',
|
administrator: 'Administrator'
|
||||||
administrator: 'Administrator'
|
};
|
||||||
};
|
%>
|
||||||
%>
|
<% _.each(accessRanks, function(v, k) { %>
|
||||||
<% _.each(accessRanks, function(v, k) { %>
|
<input name="access-rank" type="radio" value="<%= k %>" id="access-rank-<%= k %>" <% print(user.accessRank == k ? 'checked="checked"' : '') %>>
|
||||||
<option <% print(user.accessRank == k ? 'selected="selected"' : '') %> value="<%= k %>"><%= v %></option>
|
<label for="access-rank-<%= k %>">
|
||||||
<% }) %>
|
<% print(user.accessRank == k ? v + ' (current)' : v) %>
|
||||||
</select>
|
</label>
|
||||||
|
<br/>
|
||||||
|
<% }) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
Loading…
Reference in a new issue