Permalink
Browse files

Small UX/messaging additions

  • Loading branch information...
rwdaigle committed Oct 8, 2012
1 parent fbb9fd5 commit c8e30fba3fc4517ad88aef2a0e2c0c4c0a03b4ba
Showing with 25 additions and 16 deletions.
  1. +17 −14 app/views/gists/search.html.haml
  2. +8 −2 app/views/gists/status.html.haml
@@ -3,21 +3,24 @@
= label_tag(:q, "Search your gists:")
= text_field_tag(:q, params[:q])
= submit_tag("Go")
- = "(last updated: #{current_user.last_gh_fetch ? current_user.last_gh_fetch.to_formatted_s(:short) : "not yet"})"
+ = "(last indexed: #{current_user.last_gh_fetch ? current_user.last_gh_fetch.to_formatted_s(:short) : "not yet"})"
-%ul
- - for result in @results
- / %p= result.inspect
- - if result.highlight
- %li
- %p= link_to((result.highlight.description ? result.highlight['description'].first.html_safe : result.description), result.url)
- - if(result.highlight[:'files.content'])
- - result.highlight[:'files.content'].each do |highlight|
- %p
- %code= highlight
- - else
- %li
- %p= link_to(result.description, result.url)
+- if @results.size > 0
+ %ul
+ - for result in @results
+ / %p= result.inspect
+ - if result.highlight
+ %li
+ %p= link_to((result.highlight.description ? result.highlight['description'].first.html_safe : result.description), result.url)
+ - if(result.highlight[:'files.content'])
+ - result.highlight[:'files.content'].each do |highlight|
+ %p
+ %code= highlight
+ - else
+ %li
+ %p= link_to(result.description, result.url)
+- else
+ %p= "No results found for \"#{params[:q]}\""
:javascript
$(function() {
@@ -1,6 +1,12 @@
-%h4 Indexing status
+%h3 Indexing status
%p
= "Indexing #{current_user.gists_count} gists and #{current_user.files_count} files..."
+ - if current_user.fetched?
+ %b done
+%p
+ = link_to "Go to gist search", search_gists_path
+ - if !current_user.fetched?
+ %em (results may not be complete until indexing completes)
- if !current_user.fetched?
:javascript
@@ -14,5 +20,5 @@
$(function() {
setTimeout(function() {
location = "#{search_gists_path}";
- }, 1500);
+ }, 750);
})

0 comments on commit c8e30fb

Please sign in to comment.