app/views/wiki/search.rhtml in instiki-0.9.2 vs app/views/wiki/search.rhtml in instiki-0.10.0

- old
+ new

@@ -1,15 +1,38 @@ -<% @title = @results.length > 0 ? "#{@results.length} pages contains \"#{@params["query"]}\"" : "No pages contains \"#{@query}\"" %><%= sub_template "top" %> - -<% if @results.length > 0 %> - <ul> - <% for page in @results %> - <li><a href="../show/<%= page.name %>"><%= page.plain_name %></a></li> - <% end %> - </ul> -<% else %> - <p>Perhaps you should try expanding your query. Remember that Instiki searches for entire phrases, so if you search for "all that jazz" it will not match pages that contain these words in separation&mdash;only as a sentence fragment.</p> - - <p>If you're a high-tech computer wizard, you might even want try constructing a regular expression. That's actually what Instiki uses, so go right ahead and flex your "[a-z]*Leet?RegExpSkill(s|z)"</p> -<% end %> - -<%= sub_template "bottom" %> +<% @title = "Search results for \"#{@params["query"]}\"" %> + +<% unless @title_results.empty? %> +<h2><%= @title_results.length %> page(s) containing search string in the page name:</h2> + <ul> + <% for page in @title_results %> + <li> + <%= link_to page.plain_name, :web => @web.address, :action => 'show', :id => page.name %> + </li> + <% end %> + </ul> +<% end %> + + +<% unless @results.empty? %> + <h2> <%= @results.length %> page(s) containing search string in the page text:</h2> + <ul> + <% for page in @results %> + <li> + <%= link_to page.plain_name, :web => @web.address, :action => 'show', :id => page.name %> + </li> + <% end %> + </ul> +<% end %> + +<% if (@results + @title_results).empty? %> + <h2>No pages contains "<%= @params["query"] %>" </h2> + <p> + Perhaps you should try expanding your query. Remember that Instiki searches for entire + phrases, so if you search for "all that jazz" it will not match pages that contain these + words in separation&mdash;only as a sentence fragment. + </p> + <p> + If you're a high-tech computer wizard, you might even want try constructing a Ruby regular + expression. That's actually what Instiki uses, so go right ahead and flex your + "[a-z]*Leet?RegExpSkill(s|z)" + </p> +<% end %>