From cba4c47e7cca06434742fc5fd282c40973c546d1 Mon Sep 17 00:00:00 2001 From: tkimia Date: Wed, 23 Apr 2014 20:26:37 -0400 Subject: started with advanced search --- app/views/common/_show_user.html.erb | 4 ++-- app/views/search/go.html.erb | 16 ++++++++++++++-- app/views/tournaments/new.html.erb | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) (limited to 'app/views') diff --git a/app/views/common/_show_user.html.erb b/app/views/common/_show_user.html.erb index 70f1ca4..dd136a0 100644 --- a/app/views/common/_show_user.html.erb +++ b/app/views/common/_show_user.html.erb @@ -1,8 +1,8 @@
-
<%= image_tag ('http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(target.email) + '?s=100&d=mm') %>
+
<%= image_tag ('http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(target.email) + '?s=100&d=mm') %>
-
+
<%# "header" %> <%= link_to(target) do %>

<%= target.user_name %>

<% end %> diff --git a/app/views/search/go.html.erb b/app/views/search/go.html.erb index d2bf8f3..ea2dabf 100644 --- a/app/views/search/go.html.erb +++ b/app/views/search/go.html.erb @@ -4,12 +4,24 @@
Advanced Search [hide]
-

This is where the advancedsearch will go.

+ <%= form_tag("/search", method: "get") do %> +
+ <%= label_tag :query, 'Find:' %> + <%= text_field_tag(:query, params[:query]) %> +
+
+ <%= label_tag :game_type, 'Game Type:' %> + <%= select_tag(:game_type, options_from_collection_for_select(@games, 'id', 'name'), :prompt => 'All Games') %> +
+
+ <%= submit_tag("Search", :name=>nil) %> +
+ <% end %>
<%# Show search results if a query was not nill %> -<% if !@query.empty? %> +<% if !@query.nil? and !@query.empty? %> <% if @tournaments.empty? and @players.empty? %>

No results found for "<%= @query %>"

diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb index 8c74068..c2b9904 100644 --- a/app/views/tournaments/new.html.erb +++ b/app/views/tournaments/new.html.erb @@ -4,7 +4,7 @@ <%= select_tag('game', options_from_collection_for_select(@games, 'id', 'name', @tournament.game.nil? || @tournament.game.id), :prompt => "Select a Game Type") %> - <%= submit_tag("Select", :class => "btn btn-success btn-xs") %> + <%= submit_tag("Select", :class => "btn") %> <% end %>
-- cgit v1.2.3-2-g168b