Show More
Commit Description:
added spec for user problem access control
Commit Description:
added spec for user problem access control
References:
File last commit:
Show/Diff file:
Action:
app/views/user_admin/list.rhtml
| 89 lines
| 3.0 KiB
| text/html+ruby
| RhtmlLexer
|
|
r25 | <h1>Listing users</h1> | ||
|
r0 | |||
|
r106 | <div class="submitbox"> | ||
|
r267 | <b>Quick add</b> | ||
<% form_tag :action => 'create' do %> | ||||
<table border="0"> | ||||
<tr> | ||||
<td><label for="user_login">Login</label></td> | ||||
<td><label for="user_full_name">Full name</label></td> | ||||
<td><label for="user_password">Password</label></td> | ||||
<td><label for="user_password_confirmation">Confirm</label></td> | ||||
<td><label for="user_email">Email</label></td> | ||||
</tr> | ||||
<tr> | ||||
<td><%= text_field 'user', 'login', :size => 10 %></td> | ||||
<td><%= text_field 'user', 'full_name', :size => 30 %></td> | ||||
<td><%= password_field 'user', 'password', :size => 10 %></td> | ||||
<td><%= password_field 'user', 'password_confirmation', :size => 10 %></td> | ||||
<td><%= text_field 'user', 'email', :size => 15 %></td> | ||||
<td><%= submit_tag "Create" %></td> | ||||
</tr> | ||||
</table> | ||||
<% end %> | ||||
<br/> | ||||
<b>Import from site management</b> | ||||
<% form_tag({:action => 'import'}, :multipart => true) do %> | ||||
File: <%= file_field_tag 'file' %> <%= submit_tag 'Import' %> | ||||
<% end %> | ||||
<br/> | ||||
<b>What else: </b> | ||||
<%= link_to '[New user]', :action => 'new' %> | ||||
<%= link_to '[New list of users]', :action => 'new_list' %> | ||||
<%= link_to '[View administrators]', :action => 'admin' %> | ||||
<%= link_to '[Random passwords]', :action => 'random_all_passwords' %> | ||||
<%= link_to '[View active users]', :action => 'active' %> | ||||
|
r280 | <% if Configuration.multicontests? %> | ||
<%= link_to '[Manage bulk users in contests]', :action => 'contest_management' %> | ||||
<% end %> | ||||
|
r0 | </div> | ||
|
r190 | |||
|
r280 | <table class="info"> | ||
<tr class="info-head"> | ||||
<% for column in User.content_columns %> | ||||
<% if !@hidden_columns.index(column.name) %> | ||||
<th><%= column.human_name %></th> | ||||
<% end %> | ||||
|
r162 | <% end %> | ||
|
r280 | <th></th> | ||
<th></th> | ||||
<th></th> | ||||
<% if Configuration.multicontests? %> | ||||
<th>Contests</th> | ||||
<th>Other enabled contests</th> | ||||
<% end %> | ||||
|
r0 | </tr> | ||
<% for user in @users %> | ||||
|
r280 | <tr class="info-<%= cycle("odd","even") %>"> | ||
<% for column in User.content_columns %> | ||||
<% if !@hidden_columns.index(column.name) %> | ||||
<td><%=h user.send(column.name) %></td> | ||||
<% end %> | ||||
|
r162 | <% end %> | ||
|
r0 | <td><%= link_to 'Show', :action => 'show', :id => user %></td> | ||
<td><%= link_to 'Edit', :action => 'edit', :id => user %></td> | ||||
<td><%= link_to 'Destroy', { :action => 'destroy', :id => user }, :confirm => 'Are you sure?', :method => :post %></td> | ||||
|
r280 | <% if Configuration.multicontests? %> | ||
<td> | ||||
<% user.contests.each do |contest| %> | ||||
<%= contest.name %> [<%= link_to 'x', :action => 'remove_from_contest', :id => user.id, :contest_id => contest.id %>] | ||||
<% end %> | ||||
</td> | ||||
<td> | ||||
<% @contests.each do |contest| %> | ||||
<% if not user.contests.all.find {|c| c.id==contest.id } %> | ||||
<%= contest.name %> [<%= link_to '+', :action => 'add_to_contest', :id => user.id, :contest_id => contest.id %>] | ||||
<% end %> | ||||
<% end %> | ||||
</td> | ||||
<% end %> | ||||
|
r0 | </tr> | ||
<% end %> | ||||
</table> | ||||
<br /> | ||||
<%= link_to 'New user', :action => 'new' %> | ||||
|
r4 | <%= link_to 'New list of users', :action => 'new_list' %> | ||