diff options
author | MrYummy <elemental428@gmail.com> | 2017-06-18 18:54:04 +0200 |
---|---|---|
committer | MrYummy <elemental428@gmail.com> | 2017-06-18 13:11:36 -0400 |
commit | 6d70fd330904e47112e890fdbe9a94a3efdfbe38 (patch) | |
tree | 031c5b92ee1d26b1b9c69b42372185eae0713a8c | |
parent | b73ba5d739f6c1d3a84c5ea1128cdbe5320d950e (diff) |
made some small aesthetic changes
-rw-r--r-- | app/views/forums/index.html.erb | 2 | ||||
-rw-r--r-- | 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" %> - +<br> <div id="forum_groups"> <% @groups.each do |group| %> <div class="item-group" id="group-<%= group.id %>"> 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 %> <div id="forum_groups"> |