myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2552] branches/neiss/app: fixed maps index page


From: noreply
Subject: [myexperiment-hackers] [2552] branches/neiss/app: fixed maps index page to use filters
Date: Tue, 1 Feb 2011 11:27:27 -0500 (EST)

Revision
2552
Author
dgc
Date
2011-02-01 11:27:26 -0500 (Tue, 01 Feb 2011)

Log Message

fixed maps index page to use filters

Modified Paths

Diff

Modified: branches/neiss/app/controllers/maps_controller.rb (2551 => 2552)


--- branches/neiss/app/controllers/maps_controller.rb	2011-01-13 14:46:43 UTC (rev 2551)
+++ branches/neiss/app/controllers/maps_controller.rb	2011-02-01 16:27:26 UTC (rev 2552)
@@ -4,6 +4,9 @@
 # See license.txt for details.
 
 class MapsController < ApplicationController
+
+  include ApplicationHelper
+
   before_filter :login_required, :except => [:index, :show, :explore, :statistics, :search]
   
   before_filter :find_map_auth, :except => [:search, :index, :new, :create]
@@ -24,9 +27,22 @@
   
   # GET /maps
   def index
-    @contributions = Contribution.contributions_list(Map, params, current_user)
     respond_to do |format|
-      format.html # index.rhtml
+      format.html do
+        @pivot_options = pivot_options
+
+        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,
+            :lock_filter => { 'CATEGORY' => 'Map' },
+            :filters     => expr)
+      end
     end
   end
   

Modified: branches/neiss/app/views/maps/index.rhtml (2551 => 2552)


--- branches/neiss/app/views/maps/index.rhtml	2011-01-13 14:46:43 UTC (rev 2551)
+++ branches/neiss/app/views/maps/index.rhtml	2011-02-01 16:27:26 UTC (rev 2552)
@@ -3,13 +3,5 @@
 	<li><%= icon "map", new_map_path, nil, nil, "Create New Map" %></li>
 </ul>
 
-<% cache(:controller => 'maps', :action ="" 'all_tags') do -%>
-	<%= render :partial => "maps/all_tags" %>
-<% end -%>
+<%= render :partial => "content/index" -%>
 
-<%= render :partial => "layouts/paginate", :locals => { :collection => @contributions, :sort_by => Contribution.order_options } %>
-
-<%= render :partial => "contributions/list", :locals => { :collection => @contributions, :table => true } %>
-
-<%= render :partial => "layouts/paginate", :locals => { :collection => @contributions } %>
-

reply via email to

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