diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/search/go.html.erb | 25 | ||||
-rw-r--r-- | app/views/tournaments/index.html.erb | 4 |
2 files changed, 25 insertions, 4 deletions
diff --git a/app/views/search/go.html.erb b/app/views/search/go.html.erb index 12a76c8..6d5826f 100644 --- a/app/views/search/go.html.erb +++ b/app/views/search/go.html.erb @@ -1,6 +1,23 @@ -<h3> Showing results for: <span><%= @query %></span></h3> +<%# Show search results if a query was not nill %> +<% if !@query.empty? %> + <h3> Showing results for: <span><%= @query %></span></h3> + <% if @tournaments.empty? and @players.empty? %> + <p> No results found for "<%= @query %>" </p> + <% else %> + <% if @tournaments.length > 0 %> + <h4> Tournaments </h4> + <% end %> + <% @tournaments.each do |t| %> + <%= render "common/show_tournament", :target => t %> + <% end %> -<% if @tounaments.empty? and @players.empty %> - <p> No results found for "<%= @query %>" </p> -<% else %>
\ No newline at end of file + <% if @players.length > 0 %> + <h4> Players </h4> + <% end %> + <% @players.each do |p| %> + <%= render "common/show_player", :target => p %> + <% end %> + + <% end %> +<% end %>
\ No newline at end of file diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 129f3de..06e1b25 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -2,16 +2,20 @@ <div id="tournament-list"> <% if @tournaments.length > 0 %> + <%# Each tournament has a div for its listing %> <% @tournaments.each do |t| %> <%= render "common/show_tournament", :target => t %> <% end %> + <% else %> + <p class="no-entries"> No tournaments going on right now... <% if current_user.can?(:create_tournament) %> Why not start your own? <% end %> </p> + <% end %> </div> |