myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2546] trunk/app/controllers: fixed overall conte


From: noreply
Subject: [myexperiment-hackers] [2546] trunk/app/controllers: fixed overall content view
Date: Tue, 30 Nov 2010 05:24:00 -0500 (EST)

Revision
2546
Author
dgc
Date
2010-11-30 05:23:58 -0500 (Tue, 30 Nov 2010)

Log Message

fixed overall content view

Modified Paths

Diff

Modified: trunk/app/controllers/application.rb (2545 => 2546)


--- trunk/app/controllers/application.rb	2010-11-29 16:03:02 UTC (rev 2545)
+++ trunk/app/controllers/application.rb	2010-11-30 10:23:58 UTC (rev 2546)
@@ -651,7 +651,7 @@
       if parts.include?(:filter)
         bits = []
         pivot_options[:filters].each do |filter|
-          if opts[:lock_filter][filter[:query_option]].nil?
+          if opts[:lock_filter] && opts[:lock_filter][filter[:query_option]].nil?
             if find_filter(expr, filter[:query_option])
               bits << filter[:query_option] + "(\"" + find_filter(expr, filter[:query_option])[:expr][:terms].map do |t| t.gsub(/"/, '\"') end.join("\" OR \"") + "\")"
             end

Modified: trunk/app/controllers/content_controller.rb (2545 => 2546)


--- trunk/app/controllers/content_controller.rb	2010-11-29 16:03:02 UTC (rev 2545)
+++ trunk/app/controllers/content_controller.rb	2010-11-30 10:23:58 UTC (rev 2546)
@@ -11,7 +11,18 @@
     respond_to do |format|
       format.html do
         @pivot_options = pivot_options
-        @pivot = contributions_list(Contribution, params, current_user)
+
+        begin
+          expr = parse_filter_expression(params["filter"]) if params["filter"]
+        rescue Exception => ex
+          puts "ex = #{ex.inspect}"
+          flash.now[:error] = "Problem with query _expression_: #{ex}"
+          expr = nil
+        end
+
+        @pivot = contributions_list(Contribution, params, current_user,
+            :filters => expr)
+
         # index.rhtml
       end
 #     format.rss do

reply via email to

[Prev in Thread] Current Thread [Next in Thread]