Archived
Removed all trace of search_redirect, included blanks for forum and label filters
This commit is contained in:
@@ -4,24 +4,22 @@
|
|||||||
<% label = Label.where(name: params[:label]).first %>
|
<% label = Label.where(name: params[:label]).first %>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<%= form_tag({controller: "forumthreads", action: "search_redirect"}, method: :post) do %>
|
<%= form_tag({controller: "forumthreads", action: "index"}, method: :get, enforce_utf8: false) do %>
|
||||||
<%
|
<%
|
||||||
forums = []
|
forums = []
|
||||||
Forum.all.sort_by{ |f| f.forumgroup && f.forumgroup.position || 0 }.each do |f|
|
Forum.select{|f| f.can_read?(current_user)}.sort_by{ |f| f.forumgroup && f.forumgroup.position || 0 }.each do |f|
|
||||||
if current_user != nil && current_user.role_id > f.role_read_id.to_i || current_user == nil && f.role_read_id == nil
|
forums << ["#{f.forumgroup.name} → #{f.name}", f.id] if f.forumgroup
|
||||||
forums << ["#{f.forumgroup.name} → #{f.name}", f.id] if f.forumgroup
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
<% label_list = Label.pluck(:name).insert(0, "Label").insert(1, "No Label") %>
|
<% label_list = Label.pluck(:name).prepend("No Label") %>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Forum</td>
|
<td>Forum</td>
|
||||||
<td><%= select_tag "id", options_for_select(["Search All Threads"] + forums, params[:id]) %></td>
|
<td><%= select_tag "id", options_for_select(forums, params[:id]), include_blank: "Search All Threads" %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Label</td>
|
<td>Label</td>
|
||||||
<td>
|
<td>
|
||||||
<%= select_tag "label", options_for_select(label_list, params[:label]), class: "auto-width" %>
|
<%= select_tag "label", options_for_select(label_list, params[:label]), include_blank: "Label" %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -48,7 +46,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<%= submit_tag "Go", class: "btn blue", style: "width:50px" %>
|
<%= submit_tag "Go", class: "btn blue", style: "width:50px", name: nil %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<% nec_msg = "" %>
|
<% nec_msg = "" %>
|
||||||
<% forum = Forum.find(reply.thread.forum_id) %>
|
<% forum = Forum.find(reply.thread.forum_id) %>
|
||||||
<% if forum.necro_length != nil %>
|
<% if forum.necro_length != nil %>
|
||||||
<% if Threadreply.where(forumthread: reply.thread).count != 0 %>
|
<% if Threadreply.where(forumthread: reply.thread).any? %>
|
||||||
<% prevAgo = Threadreply.where(forumthread: reply.thread).order(:id).last.created_at %>
|
<% prevAgo = Threadreply.where(forumthread: reply.thread).order(:id).last.created_at %>
|
||||||
<% if prevAgo <= forum.necro_length.days.ago.utc %>
|
<% if prevAgo <= forum.necro_length.days.ago.utc %>
|
||||||
<% nec_msg = "You may be necroposting, as the last reply was made at least #{forum.necro_length} days ago. If you still wish to make this reply, press 'Ok'." %>
|
<% nec_msg = "You may be necroposting, as the last reply was made at least #{forum.necro_length} days ago. If you still wish to make this reply, press 'Ok'." %>
|
||||||
|
|||||||
+1
-2
@@ -22,12 +22,12 @@ Redstoner::Application.routes.draw do
|
|||||||
post 'resend_mail'
|
post 'resend_mail'
|
||||||
get 'edit_notifications'
|
get 'edit_notifications'
|
||||||
put 'update_login'
|
put 'update_login'
|
||||||
|
get 'edit_website_settings'
|
||||||
end
|
end
|
||||||
collection do
|
collection do
|
||||||
get 'lost_password'
|
get 'lost_password'
|
||||||
post 'reset_password'
|
post 'reset_password'
|
||||||
post 'suggestions'
|
post 'suggestions'
|
||||||
post 'search_redirect'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -36,7 +36,6 @@ Redstoner::Application.routes.draw do
|
|||||||
resources :threadreplies, path: 'replies'
|
resources :threadreplies, path: 'replies'
|
||||||
collection do
|
collection do
|
||||||
get 'search'
|
get 'search'
|
||||||
post 'search_redirect'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
resources :forums, path: '/forums'
|
resources :forums, path: '/forums'
|
||||||
|
|||||||
Reference in New Issue
Block a user