From 6d70fd330904e47112e890fdbe9a94a3efdfbe38 Mon Sep 17 00:00:00 2001 From: MrYummy Date: Sun, 18 Jun 2017 18:54:04 +0200 Subject: made some small aesthetic changes --- app/views/forums/index.html.erb | 2 +- app/views/forumthreads/index.html.erb | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 5d9449d..532484b 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -1,7 +1,7 @@ <% title "Forums" %> <%= link_to "All threads", forumthreads_path, class: "btn blue right" %> - +
<% @groups.each do |group| %>
diff --git a/app/views/forumthreads/index.html.erb b/app/views/forumthreads/index.html.erb index 3a0493b..18b9ef4 100644 --- a/app/views/forumthreads/index.html.erb +++ b/app/views/forumthreads/index.html.erb @@ -1,5 +1,5 @@ <%= link_to "Forums", forums_path %> → -<% params_list = params.to_hash %> +<% params_list = params.except(:controller, :action) %> <% if params_list.any? %> <%= link_to "All Threads", forumthreads_path %> → Search Results <% else %> @@ -9,7 +9,7 @@ <% if params[:forum] text = "forum '#{Forum.find(params[:forum]).name}'" - if params_list.any? + if params_list.except(:forum).any? text = "Search results in #{text} (#{@threads.length})" else text = text.capitalize @@ -26,20 +26,20 @@ <%= form_tag(forumthreads_path, method: :get) do %> <%= text_field_tag "query", params[:query], placeholder: "Search...", class: "searchfield field" %> <%= submit_tag "Go", class: "searchfield btn" %> - <% params.slice(:title, :content, :reply, :label, :author).each do |key, value| %> - <%= hidden_field_tag key, params[key] %> + <%= link_to "Advanced Search", search_forumthreads_path(params_list), class: "btn right blue" %> + <% if params_list.any? %> + <% if params[:forum] %> + <%= link_to "Show All Threads", forumthreads_path(params_list.except("forum")), class: "btn right blue" %> + <% elsif params_list.except(:controller, :action).any? %> + <%= link_to "Show All Threads", forumthreads_path, class: "btn right blue" %> + <% end %> <% end %> -<% end %> -<%= link_to "Advanced Search", search_forumthreads_path(params_list), class: "btn right blue" %> -<% if params_list.any? %> <% if params[:forum] %> - <%= link_to "Show All Threads", forumthreads_path(params_list.except("forum")), class: "btn right blue" %> - <% elsif params_list.except(:controller, :action).any? %> - <%= link_to "Show All Threads", forumthreads_path, class: "btn right blue" %> + <%= link_to "Go to Forum", forum_path(params[:forum]), class: "btn right blue" %> + <% end %> + <% params.slice(:forum, :title, :content, :reply, :label, :author).each do |key, value| %> + <%= hidden_field_tag key, params[key] %> <% end %> -<% end %> -<% if params[:forum] %> - <%= link_to "Go to Forum", forum_path(params[:forum]), class: "btn right blue" %> <% end %>
-- cgit v1.2.3