From 7dec1958a4e291b37bb4f365cf207a2e4314e57f Mon Sep 17 00:00:00 2001 From: Erik Hatcher Date: Sun, 4 Feb 2007 09:42:05 +0000 Subject: [PATCH] Add SIMILE Exhibit view of the currently filtered set, as proof-of-concept. Adjusted CSS, improved UI dramatically, even including a logo in the header. git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@503379 13f79535-47bb-0310-9956-ffa450edef68 --- .../app/controllers/simile_controller.rb | 11 ++- .../ruby/flare/app/views/browse/index.rhtml | 85 ++++++++++-------- .../ruby/flare/app/views/layouts/browse.rhtml | 9 +- .../ruby/flare/app/views/simile/exhibit.rhtml | 10 +-- client/ruby/flare/public/images/flare.jpg | Bin 0 -> 31282 bytes client/ruby/flare/public/images/x-close.gif | Bin 0 -> 88 bytes .../ruby/flare/public/stylesheets/flare.css | 5 ++ 7 files changed, 67 insertions(+), 53 deletions(-) create mode 100644 client/ruby/flare/public/images/flare.jpg create mode 100644 client/ruby/flare/public/images/x-close.gif diff --git a/client/ruby/flare/app/controllers/simile_controller.rb b/client/ruby/flare/app/controllers/simile_controller.rb index 4283a9fe651..2f34ab5a8f3 100755 --- a/client/ruby/flare/app/controllers/simile_controller.rb +++ b/client/ruby/flare/app/controllers/simile_controller.rb @@ -13,20 +13,23 @@ class SimileController < ApplicationController def exhibit + # TODO this code was copied from BrowseController#index, and is here only as a quick and dirty prototype. + # TODO figuring out where these calls cleanly belong is the key. + @info = SOLR.send(Solr::Request::IndexInfo.new) # TODO move this call to only have it called when the index may have changed @facet_fields = @info.field_names.find_all {|v| v =~ /_facet$/} - # TODO Add paging and sorting req = Solr::Request::Standard.new :query => query, :filter_queries => filters, :facets => {:fields => @facet_fields, :limit => 20 , :mincount => 1, :sort => :count, :debug_query=>true} @data = SOLR.send(req) + + # Exhibit seems to require a label attribute to be happy @data.each {|d| d['label'] = d['title_text']} respond_to do |format| - puts "format = #{format.inspect}" - format.html # renders index.rhtml - format.json { render :json => {'items' => @data}.to_json } + format.html # renders exhibit.rhtml + format.json { render :json => {'items' => @data}.to_json } # Exhibit seems to require data to be in a 'items' Hash end end end diff --git a/client/ruby/flare/app/views/browse/index.rhtml b/client/ruby/flare/app/views/browse/index.rhtml index 4535d5e1d91..0b0f104b608 100644 --- a/client/ruby/flare/app/views/browse/index.rhtml +++ b/client/ruby/flare/app/views/browse/index.rhtml @@ -1,50 +1,57 @@ -<% form_tag(:action=>'add_query') do %> - Query: <%= text_field_with_auto_complete :search, :query %> -<% end %> -<%=link_to 'clear constraints', :action => 'clear'%> -
-Queries: - -
-
-Filters: - -
+