refactored search

This commit is contained in:
albert
2013-01-10 17:45:52 -05:00
parent 13271e9bf5
commit 8749c43b3e
85 changed files with 946 additions and 304 deletions

View File

@@ -10,7 +10,7 @@
<% if @user.id == CurrentUser.id %>
<li><%= link_to "Settings", edit_user_path(CurrentUser.user) %></li>
<li><%= link_to "Profile", user_path(CurrentUser.user) %></li>
<li><%= link_to "Messages #{CurrentUser.dmail_count}", dmails_path(:search => {:owner_id_eq => CurrentUser.id, :to_id_eq => CurrentUser.id}) %></li>
<li><%= link_to "Messages #{CurrentUser.dmail_count}", dmails_path(:search => {:owner_id => CurrentUser.id, :to_id => CurrentUser.id}) %></li>
<% else %>
<li><%= link_to "Send message", new_dmail_path(:dmail => {:to_id => @user.id}) %></li>
<% end %>

View File

@@ -2,11 +2,9 @@
<div id="a-index">
<h1>Users</h1>
<% simple_form_for(@search) do |f| %>
<%= f.input :name_contains, :label => "Name" %>
<%= f.sort_link "Name", :name %>
<%= f.sort_link "Date", :created_at_desc %>
<%= f.button :submit %>
<% form_tag(users_path, :method => :get, :class => "simple_form") do %>
<%= search_field "name_matches", :label => "Name" %>
<%= submit_tag "Search" %>
<% end %>
<table width="100%" class="striped">
@@ -46,7 +44,7 @@
<td></td>
<td></td>
<% end %>
<td><%= link_to user.note_versions.count, note_versions_path(:search => {:updater_id_eq => user.id}) %></td>
<td><%= link_to user.note_versions.count, note_versions_path(:search => {:updater_id => user.id}) %></td>
<td><%= user.level_string %></td>
<td><span title="<%= user.created_at %>"><%= time_ago_in_words user.created_at %> ago</span></td>
</tr>

View File

@@ -1,8 +1,14 @@
<div id="c-users">
<div id="a-search">
<%= simple_form_for(@search) do |f| %>
<%= f.input :name_matches, :required => false, :label => "Name" %>
<%= f.button :submit, "Search" %>
<%= form_tag(users_path, :method => :get, :class => "simple_form") do %>
<%= search_field "name_matches", :label => "Name" %>
<div class="input">
<label for="search_level">Min Level</label>
<%= select("search", "min_level", User.level_hash.to_a) %>
</div>
<%= submit_tag "Search" %>
<% end %>
</div>
</div>