Skip to content

Commit

Permalink
changed the pagination view
Browse files Browse the repository at this point in the history
  • Loading branch information
brwali committed Nov 1, 2024
1 parent 642a3f7 commit 40e9781
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions app/views/users/list.html.erb
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
<h1>Manage users</h1>

<br/>
<%= form_tag :action => 'show_if_authorized' do %>
View user - enter exact login: <%= text_field_with_auto_complete :user, :username, {:size => 41} %>
<input type='submit' value='Edit'/>
<% end %>

<%= form_tag :action => 'list', :paginate_show => '1', :num_users => @per_page do %>
<%= label_tag :letter, 'Search users: ' %><%= text_field_tag(:letter,params[:letter]) %>
<%= select_tag(:search_by, options_for_select([['Username', 1], ['Name', 2], ['Email', 3]])) %>
<%= submit_tag("Search") %>
<% end %>
<%= form_tag :action => 'list', method: :get, id: 'pagination_form' do %>
<%= label_tag :letter, 'Search users: ' %><%= text_field_tag(:letter, params[:letter]) %>
<%= select_tag(:search_by, options_for_select([['Username', 1], ['Full name', 2], ['Email', 3]])) %>
<%= submit_tag("Search") %>

<%= form_tag :action => 'list', :paginate_show => '1', :num_users => @per_page do %>
<%= label_tag :letter, 'Number of users displayed per page' %><%= text_field_tag(:letter,params[:per_page]) %>
<%= select_tag(:search_by, options_for_select([['25 users', 1], ['50 users', 2], ['100 users', 3], ['All users', 4]])) %>
<%= submit_tag("List") %>
<br/><br/>
<label for="per_page">Users per page:</label>
<%= select_tag(:per_page, options_for_select(
[['25 users', '1'], ['50 users', '2'], ['100 users', '3'], ['All users', '4']],
selected: @per_page
),
onchange: "document.getElementById('pagination_form').submit();"
) %>
<% end %>

<%= render :partial => 'links' %>

<div class="exp">
<table>
<tr><th colspan=5></th><th colspan=3 class="head">E-mail on ...</th></tr>
<tr><th class="head">User Name</th><th class="head">Name</th><th class="head">Email Address</th><th class="head">Role</th><th class="head">Parent</th><th class="head">Review</th><th class="head">Submission</th><th class="head">Meta-review</th><th class="head">Delete</th></tr>
<tr>
<th class="head">User Name</th>
<th class="head">Full Name</th>
<th class="head">Email Address</th>
<th class="head">Role</th>
<th class="head">Parent</th>
<th class="head">Review</th>
<th class="head">Submission</th>
<th class="head">Meta-review</th>
<th class="head">Delete</th>
</tr>
<% @paginated_users.each do |user| %>
<% if (params[:show] != 'true' && !user.username(session[:ip]).include?("_hidden")) || params[:show] == 'true'%>
<tr class="exp">
Expand All @@ -41,10 +47,6 @@
<% end -%>
</table>
</div>
<hr/>

<hr/>
<%#= render :partial => 'shared_scripts/pages' %>

<div style="float: left; display: inline-block;">
<%= will_paginate @paginated_users, :inner_window => 1, :outer_window => 1, :params => {:num_versions => @per_page}%>
Expand All @@ -59,5 +61,4 @@
<%= link_to 'New user',:role => "Student", :action => 'new' %> |
<%= link_to 'Import users', :controller=>'import_file', :action=>'start', :model => 'User', :expected_fields => 'username&nbsp;&nbsp;|&nbsp;&nbsp;full name (first [middle] last)&nbsp;&nbsp;|&nbsp;&nbsp;e-mail address' %> |
<%= link_to 'Export users', :controller=>'export_file',:action=>'start',:model=> 'User',:id=> 1 %>

</p>

0 comments on commit 40e9781

Please sign in to comment.