refactored search
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<% if @artist && !@artist.new_record? %>
|
||||
<li>|</li>
|
||||
<li><%= link_to "Edit", edit_artist_path(@artist) %></li>
|
||||
<li><%= link_to "History", artist_versions_path(:search => {:artist_id_eq => @artist.id}) %></li>
|
||||
<li><%= link_to "History", artist_versions_path(:search => {:artist_id => @artist.id}) %></li>
|
||||
<li><%= link_to "Show", artist_path(@artist) %></li>
|
||||
<% end %>
|
||||
</menu>
|
||||
|
||||
@@ -3,12 +3,9 @@
|
||||
<h1>Search Artists</h1>
|
||||
|
||||
<div id="search-form">
|
||||
<%= simple_form_for(@search) do |f| %>
|
||||
<%= f.input :name_contains, :label => "Name", :required => false %>
|
||||
<%= f.input :other_names_match, :label => "Other Names", :required => false %>
|
||||
<%= f.input :group_name_contains, :label => "Group Name", :required => false %>
|
||||
<%= f.input :url_match, :label => "URL", :required => false %>
|
||||
<%= f.button :submit, "Search" %>
|
||||
<%= form_tag(artists_path, :method => :get, :class => "simple_form") do %>
|
||||
<%= search_field "name" %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<div id="a-search">
|
||||
<h1>Search Comments</h1>
|
||||
|
||||
<%= simple_form_for(@search) do |f| %>
|
||||
<%= form_tag(comments_path, :method => :get) do |f| %>
|
||||
<%= hidden_field_tag "group_by", "comment" %>
|
||||
<%= f.input :body_matches, :label => "Body", :required => false %>
|
||||
<%= f.input :for_user_name, :label => "User", :required => false %>
|
||||
<%= f.input :post_tag_match, :label => "Tags", :required => false %>
|
||||
|
||||
<%= f.button :submit, "Search" %>
|
||||
<%= search_field :body_matches, :label => "Body" %>
|
||||
<%= search_field :creator_name, :label => "User" %>
|
||||
<%= search_field :post_tags_match, :label => "Tags" %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% content_for(:secondary_links) do %>
|
||||
<menu>
|
||||
<li><%= link_to "Received", dmails_path(:search => {:owner_id_eq => CurrentUser.id, :to_id_eq => CurrentUser.id}, :folder => "received") %></li>
|
||||
<li><%= link_to "Sent", dmails_path(:search => {:owner_id_eq => CurrentUser.id, :from_id_eq => CurrentUser.id}, :folder => "sent") %></li>
|
||||
<li><%= link_to "Received", dmails_path(:search => {:owner_id => CurrentUser.id, :to_id => CurrentUser.id}, :folder => "received") %></li>
|
||||
<li><%= link_to "Sent", dmails_path(:search => {:owner_id => CurrentUser.id, :from_id => CurrentUser.id}, :folder => "sent") %></li>
|
||||
<li><%= link_to "New", new_dmail_path %></li>
|
||||
<li><%= link_to "Search", search_dmails_path %></li>
|
||||
</menu>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<div id="c-dmails">
|
||||
<div id="a-search">
|
||||
<h1>Search Messages</h1>
|
||||
<%= simple_form_for @search do |f| %>
|
||||
<%= form_tag(dmails_path, :method => :get, :class => "simple_form") do %>
|
||||
<%= hidden_field_tag :folder, params[:folder] %>
|
||||
<%= f.input :title_contains, :required => false, :label => "Title" %>
|
||||
<%= f.input :body_contains, :required => false, :label => "Body" %>
|
||||
<%= f.input :to_name_matches, :required => false, :label => "To" %>
|
||||
<%= f.input :from_name_matches, :required => false, :label => "From" %>
|
||||
<%= f.button :submit, "Search" %>
|
||||
|
||||
<%= search_field :message_matches, :label => "Message" %>
|
||||
<%= search_field :to_name, :label => "To" %>
|
||||
<%= search_field :from_name, :label => "From" %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<div id="c-forum-topics">
|
||||
<div id="a-search">
|
||||
<h1>Search Forum</h1>
|
||||
<%= simple_form_for @search do |f| %>
|
||||
<%= f.input :topic_title_matches, :label => "Title", :required => false %>
|
||||
<%= f.input :body_matches, :label => "Body", :required => false %>
|
||||
<%= f.button :submit, "Search" %>
|
||||
<%= form_tag(forum_topics_path, :method => :get, :class => "simple_form") do %>
|
||||
<%= search_field :topic_title_matches, :label => "Title" %>
|
||||
<%= search_field :body_matches, :label => "Body" %>
|
||||
<%= search_field :creator_name, :label => "Author" %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<% @dashboard.artists.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= mod_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, artist_versions_path(:search => {:updater_id_eq => activity.user.id}) %></td>
|
||||
<td><%= link_to activity.count, artist_versions_path(:search => {:updater_id => activity.user.id}) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<% @dashboard.notes.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= mod_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, note_versions_path(:search => {:updater_id_eq => activity.user.id}) %></td>
|
||||
<td><%= link_to activity.count, note_versions_path(:search => {:updater_id => activity.user.id}) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<% @dashboard.tags.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= mod_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, post_versions_path(:search => {:updater_id_eq => activity.user.id}) %></td>
|
||||
<td><%= link_to activity.count, post_versions_path(:search => {:updater_id => activity.user.id}) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<% @dashboard.wiki_pages.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= mod_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, wiki_page_versions_path(:search => {:updater_id_eq => activity.user.id}) %></td>
|
||||
<td><%= link_to activity.count, wiki_page_versions_path(:search => {:updater_id => activity.user.id}) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<%= form_tag(moderator_ip_addrs_path, :method => :get, :class => "simple_form") do %>
|
||||
<div class="input">
|
||||
<label for="user_ids">Search IPs</label>
|
||||
<%= text_field_tag "search[ip_addr_eq]", params[:ip_addrs] %>
|
||||
<%= text_field_tag "search[ip_addr]", params[:ip_addrs] %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag "Search" %>
|
||||
@@ -10,7 +10,7 @@
|
||||
<%= form_tag(moderator_ip_addrs_path, :method => :get, :class => "simple_form") do %>
|
||||
<div class="input">
|
||||
<label for="user_ids">Search User IDs</label>
|
||||
<%= text_field_tag "search[user_id_eq]", params[:user_ids] %>
|
||||
<%= text_field_tag "search[user_id]", params[:user_ids] %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag "Search" %>
|
||||
|
||||
@@ -2,18 +2,10 @@
|
||||
<div id="a-search">
|
||||
<h1>Search IP Addresses</h1>
|
||||
|
||||
<%= form_tag(moderator_ip_addrs_path) do %>
|
||||
<div class="input">
|
||||
<label>User</label>
|
||||
<%= text_field :search, :user_name %>
|
||||
</div>
|
||||
|
||||
<div class="input">
|
||||
<label>IP Addr</label>
|
||||
<%= text_field :search, :ip_addr %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag %>
|
||||
<%= form_tag(moderator_ip_addrs_path, :class => "simple_form") do %>
|
||||
<%= search_field "user_name", :label => "User" %>
|
||||
<%= search_field "ip_addr", :label => "IP Addr" %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><%= link_to note_version.post_id, post_path(note_version.post_id) %></td>
|
||||
<td><%= link_to "#{note_version.note_id}", note_versions_path(:search => {:note_id_eq => note_version.note_id}) %></td>
|
||||
<td><%= link_to "#{note_version.note_id}", note_versions_path(:search => {:note_id => note_version.note_id}) %></td>
|
||||
<td><%= h(note_version.body) %> <% unless note_version.is_active? %>(deleted)<% end %></td>
|
||||
<td>
|
||||
<% if CurrentUser.is_janitor? %>
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
<div id="a-search">
|
||||
<h1>Search Notes</h1>
|
||||
|
||||
<%= simple_form_for @search do |f| %>
|
||||
<%= form_tag(notes_path, :method => :get, :class => "simple_form") do %>
|
||||
<%= hidden_field_tag :group_by, "note" %>
|
||||
<%= f.input :body_matches, :label => "Body", :required => false %>
|
||||
<%= f.input :post_tag_match, :label => "Tags", :required => false %>
|
||||
<%= f.button :submit, "Search" %>
|
||||
<%= search_field :body_matches, :label => "Body" %>
|
||||
<%= search_field :post_tags_match, :label => "Tags" %>
|
||||
<%= search_field :creator_name, :label => "Author" %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<li><%= link_to "Delete", pool_path(@pool), :method => :delete, :confirm => "Are you sure you want to delete this pool?", :remote => true %></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<li><%= link_to "History", pool_versions_path(:search => {:pool_id_eq => @pool.id}) %></li>
|
||||
<li><%= link_to "History", pool_versions_path(:search => {:pool_id => @pool.id}) %></li>
|
||||
<li><%= link_to "Order", edit_pool_order_path(@pool) %></li>
|
||||
<% end %>
|
||||
</menu>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<div id="c-pools">
|
||||
<div id="a-search">
|
||||
<%= simple_form_for @search, :method => :get do |f| %>
|
||||
<%= f.input :name_contains, :label => "Name", :required => false %>
|
||||
<%= f.input :description_contains, :label => "Description", :required => false %>
|
||||
<%= f.button :submit, "Search" %>
|
||||
<%= form_tag pools_path, :method => :get, :class => "simple_form" do %>
|
||||
<%= search_field "name_matches", :label => "Name" %>
|
||||
<%= search_field "description_matches", :label => "Description" %>
|
||||
<%= search_field "creator_name", :label => "Creator" %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<h1>Search Changes</h1>
|
||||
|
||||
<div id="search">
|
||||
<%= simple_form_for(@search) do |f| %>
|
||||
<%= f.input :updater_name_matches, :label => "User", :required => false %>
|
||||
<%= f.input :post_id_eq, :label => "Post", :required => false %>
|
||||
<%= f.button :submit, :value => "Search" %>
|
||||
<%= form_tag(post_versions_path, :method => :get, :class => "simple_form") do %>
|
||||
<%= search_field "updater_name", :label => "User" %>
|
||||
<%= search_field "post_id", :label => "Post" %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
<section>
|
||||
<h1>History</h1>
|
||||
<ul>
|
||||
<li><%= link_to "Tags", post_versions_path(:search => {:post_id_eq => @post.id}) %></li>
|
||||
<li><%= link_to "Notes", note_versions_path(:search => {:post_id_eq => @post.id}) %></li>
|
||||
<li><%= link_to "Tags", post_versions_path(:search => {:post_id => @post.id}) %></li>
|
||||
<li><%= link_to "Notes", note_versions_path(:search => {:post_id => @post.id}) %></li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<menu>
|
||||
<li><%= link_to "Listing", tags_path %></li>
|
||||
<li><%= link_to "Search", search_tags_path %></li>
|
||||
<li><%= link_to "Help", wiki_pages_path(:search => {:title_equals => "help:tags"}) %></li>
|
||||
<li><%= link_to "Help", wiki_pages_path(:search => {:title => "help:tags"}) %></li>
|
||||
<% if @tag %>
|
||||
<li>|</li>
|
||||
<li><%= link_to "Edit", edit_tag_path(@tag) %></li>
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
<div id="c-tags">
|
||||
<div id="a-search">
|
||||
<%= simple_form_for(@search) do |f| %>
|
||||
<%= f.input :name_matches, :required => false, :label => "Name" %>
|
||||
<%= f.input :category_equals, :required => false, :label => "Category", :collection => Danbooru.config.canonical_tag_category_mapping.to_a %>
|
||||
<%= f.input :meta_sort, :collection => [["Name", "name.asc"], ["Count", "post_count.desc"], ["Date", "created_at.desc"]], :label => "Sort", :required => false %>
|
||||
<%= form_tag(tags_path, :method => :get, :class => "simple_form") do %>
|
||||
<%= search_field "name_matches", :label => "Name" %>
|
||||
|
||||
<div class="input">
|
||||
<label for="search_category">Category</label>
|
||||
<%= select "search", "category", Tag.canonical_tag_category_mapping.to_a %>
|
||||
</div>
|
||||
|
||||
<div class="input">
|
||||
<label for="search_sort">Sort</label>
|
||||
<%= select "search", "sort", %w(name count date) %>
|
||||
</div>
|
||||
|
||||
<%= f.button :submit, "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
You can <%= link_to "upload another file", new_upload_path %> or <%= link_to "view your current uploads", uploads_path(:search => {:uploader_id_eq => CurrentUser.id}) %>.
|
||||
You can <%= link_to "upload another file", new_upload_path %> or <%= link_to "view your current uploads", uploads_path(:search => {:uploader_id => CurrentUser.id}) %>.
|
||||
<% if CurrentUser.user.is_moderator? && @upload.is_pending? %>
|
||||
<%= link_to "Force update", upload_path(@upload, :format => "js"), :remote => true, :method => :put %>.
|
||||
<% end %>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<menu>
|
||||
<% if @user_feedback %>
|
||||
<li><%= link_to "New", new_user_feedback_path(:user_feedback => {:user_id => @user_feedback.user_id}) %></li>
|
||||
<% elsif params[:search] && params[:search][:user_id_eq] %>
|
||||
<li><%= link_to "New", new_user_feedback_path(:user_feedback => {:user_id => params[:search][:user_id_eq]}) %></li>
|
||||
<% elsif params[:search] && params[:search][:user_id] %>
|
||||
<li><%= link_to "New", new_user_feedback_path(:user_feedback => {:user_id => params[:search][:user_id]}) %></li>
|
||||
<% else %>
|
||||
<li><%= link_to "New", new_user_feedback_path %></li>
|
||||
<% end %>
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<menu>
|
||||
<li><%= link_to "Listing", wiki_pages_path %></li>
|
||||
<li><%= link_to "New", new_wiki_page_path %></li>
|
||||
<li><%= link_to "Help", wiki_pages_path(:search => {:title_equals => "help:wiki"}) %></li>
|
||||
<li><%= link_to "Help", wiki_pages_path(:search => {:title => "help:wiki"}) %></li>
|
||||
<% if @wiki_page %>
|
||||
<li>|</li>
|
||||
<li><%= link_to "Posts (#{Post.fast_count(@wiki_page.title)})", posts_path(:tags => @wiki_page.title) %></li>
|
||||
<li><%= link_to "History", wiki_page_versions_path(:search => {:wiki_page_id_eq => @wiki_page.id}) %></li>
|
||||
<li><%= link_to "History", wiki_page_versions_path(:search => {:wiki_page_id => @wiki_page.id}) %></li>
|
||||
<% if CurrentUser.is_member? %>
|
||||
<% unless @wiki_page.new_record? %>
|
||||
<li><%= link_to "Edit", edit_wiki_page_path(@wiki_page) %></li>
|
||||
|
||||
Reference in New Issue
Block a user