[Streamlined][872] fixed partial rendering calls that had been missed during RC3 refactoring

0 views
Skip to first unread message

svn-str...@thinkrelevance.com

unread,
Jun 16, 2008, 5:38:56 PM6/16/08
to streamli...@googlegroups.com
Revision
872
Author
matthew
Date
2008-06-16 17:38:56 -0400 (Mon, 16 Jun 2008)

Log Message

fixed partial rendering calls that had been missed during RC3 refactoring

Modified Paths

Diff

Modified: edge/streamlined/CHANGELOG (871 => 872)


--- edge/streamlined/CHANGELOG	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/CHANGELOG	2008-06-16 21:38:56 UTC (rev 872)
@@ -1,3 +1,5 @@
+06/16/08 - fixed partial rendering calls that had been missed during RC3 refactoring [Matthew Bass]
+
 05/07/08 - added quick_show_button option for hiding the show button on the list view [Matthew Bass]
 
 1.0RC03 -- 02/29/08

Modified: edge/streamlined/faux_rails_root/app/views/layouts/streamlined.rhtml (871 => 872)


--- edge/streamlined/faux_rails_root/app/views/layouts/streamlined.rhtml	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/faux_rails_root/app/views/layouts/streamlined.rhtml	2008-06-16 21:38:56 UTC (rev 872)
@@ -23,7 +23,7 @@
 	 <div id="left">
 	   <%= render(:partial => "shared/streamlined/side_menu")%>
 	   <% if advanced_filtering %>
-         <%= render :file => STREAMLINED_TEMPLATE_ROOT + '/shared/_filter' %>	   
+         <%= render_streamlined_file '/shared/_filter.rhtml' %>
        <% end %>
 	 </div>
 	 <div id="center">

Modified: edge/streamlined/lib/streamlined/column/association.rb (871 => 872)


--- edge/streamlined/lib/streamlined/column/association.rb	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/lib/streamlined/column/association.rb	2008-06-16 21:38:56 UTC (rev 872)
@@ -90,9 +90,8 @@
   end
   
   def render_td_show(view, item)
-    view.render(:partial => show_view.partial, 
-                :locals => { :item => item, :relationship => self, 
-                :streamlined_def => show_view })
+    view.render(:file => show_view.partial, :use_full_path => false,
+                :locals => { :item => item, :relationship => self, :streamlined_def => show_view })
   end
   
   def render_td_list(view, item)

Modified: edge/streamlined/lib/streamlined/controller/enumeration_methods.rb (871 => 872)


--- edge/streamlined/lib/streamlined/controller/enumeration_methods.rb	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/lib/streamlined/controller/enumeration_methods.rb	2008-06-16 21:38:56 UTC (rev 872)
@@ -7,7 +7,8 @@
     rel_type = model_ui.scalars[@enumeration_name.to_sym]
     @all_items = rel_type.enumeration.to_2d_array
     @selected_item = instance.send(@enumeration_name)
-    render(:partial => rel_type.edit_view.partial, :locals => {:item => instance, :relationship => rel_type})
+    render(:file => rel_type.edit_view.partial, :use_full_path => false,
+           :locals => {:item => instance, :relationship => rel_type})
   end
 
   # Show's the enumeration's configured +Show+ view, 
@@ -15,7 +16,8 @@
   def show_enumeration
     self.instance = model.find(params[:id])
     rel_type = model_ui.scalars[params[:enumeration].to_sym]
-    render(:partial => rel_type.show_view.partial, :locals => {:item => instance, :relationship => rel_type})
+    render(:file => rel_type.show_view.partial, :use_full_path => false,
+           :locals => {:item => instance, :relationship => rel_type})
   end
 
   # Select an item in the given enumeration. Used by the #enumerable view, as 

Modified: edge/streamlined/lib/streamlined/controller/relationship_methods.rb (871 => 872)


--- edge/streamlined/lib/streamlined/controller/relationship_methods.rb	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/lib/streamlined/controller/relationship_methods.rb	2008-06-16 21:38:56 UTC (rev 872)
@@ -7,7 +7,8 @@
    @rel_name = params[:relationship]
    relationship = context_column(@rel_name)
    set_items_and_all_items(relationship)
-   render(:partial => relationship.edit_view.partial, :locals => {:relationship => relationship})
+   render(:file => relationship.edit_view.partial, :use_full_path => false,
+          :locals => {:relationship => relationship})
  end
 
  # Show's the relationship's configured +Show+ view, 
@@ -19,9 +20,9 @@
  end
 
  def render_show_view_partial(relationship, item)
-   render(:partial => relationship.show_view.partial, :locals => {:item => item, 
-                                            :relationship => relationship, 
-                                            :streamlined_def => relationship.show_view})
+   render(:file => relationship.show_view.partial, :use_full_path => false,
+          :locals => {:item => item, :relationship => relationship,
+                      :streamlined_def => relationship.show_view})
  end
 
  # Add new items to the given relationship collection. Used by the #membership view, as 

Modified: edge/streamlined/lib/streamlined/view/base.rb (871 => 872)


--- edge/streamlined/lib/streamlined/view/base.rb	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/lib/streamlined/view/base.rb	2008-06-16 21:38:56 UTC (rev 872)
@@ -25,7 +25,8 @@
   # Returns the path to the partial that will be used to render this relationship type.
   def partial
     mod = self.class.name.split("::")[-2]
-"../../vendor/plugins/streamlined/templates/relationships/#{mod.underscore}/#{Inflector.underscore(Inflector.demodulize(self.class.name))}"
+    partial_name = Inflector.underscore(Inflector.demodulize(self.class.name))
+    File.join(STREAMLINED_TEMPLATE_ROOT, "relationships/#{mod.underscore}/_#{partial_name}.rhtml")
   end
     
 end

Modified: edge/streamlined/lib/streamlined/view/edit_views.rb (871 => 872)


--- edge/streamlined/lib/streamlined/view/edit_views.rb	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/lib/streamlined/view/edit_views.rb	2008-06-16 21:38:56 UTC (rev 872)
@@ -22,8 +22,8 @@
   
   # Renders an Ajax-enabled table in a JavaScript window.
   class Window < Streamlined::View::Base
-    def partial      
-      "../../vendor/plugins/streamlined/templates/relationships/edit_views/inset_table"
+    def partial
+      File.join(STREAMLINED_TEMPLATE_ROOT, "relationships/edit_views/_inset_table.rhtml")
     end
   end
   
@@ -44,15 +44,11 @@
   
   # Like Membership, but with two distinct groups of checkboxes and an autofilter field
   class FilterSelect < Streamlined::View::Base
-  
     def render_on_update(rel_name, id)
       @rel_name = rel_name
       @current_id = id
       "update_filter_select"
-      # page.replace_html "rel_#{rel_name}_#{id}_unselected", :partial => '../../vendor/plugins/streamlined/templates/relationships/edit_views/filter_select/unselected_items'
-      # page.replace_html "rel_#{rel_name}_#{id}_selected", :partial => '../../vendor/plugins/streamlined/templates/relationships/edit_views/filter_select/selected_items'
     end
-    
   end
   
 end

Modified: edge/streamlined/templates/generic_views/list.rxml (871 => 872)


--- edge/streamlined/templates/generic_views/list.rxml	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/templates/generic_views/list.rxml	2008-06-16 21:38:56 UTC (rev 872)
@@ -8,7 +8,7 @@
       @export_columns.each do |column|
         if column.is_displayable_in_context?(self, item)
           if column.is_a?(Streamlined::Column::Association)
-            contents =  render(:partial => column.show_view.partial, 
+            contents =  render(:file => column.show_view.partial, :use_full_path => false, 
                 :locals => { :item => item, :relationship => column, 
                 :streamlined_def => column.show_view })
             # strip out html tags

Modified: edge/streamlined/templates/generic_views/update_filter_select.rjs (871 => 872)


--- edge/streamlined/templates/generic_views/update_filter_select.rjs	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/templates/generic_views/update_filter_select.rjs	2008-06-16 21:38:56 UTC (rev 872)
@@ -1,2 +1,2 @@
-page.replace_html "rel_#{@rel_name}_#{@current_id}_unselected", :partial => '../../vendor/plugins/streamlined/templates/relationships/edit_views/filter_select/unselected_items'
-page.replace_html "rel_#{@rel_name}_#{@current_id}_selected", :partial => '../../vendor/plugins/streamlined/templates/relationships/edit_views/filter_select/selected_items'
+page.replace_html "rel_#{@rel_name}_#{@current_id}_unselected", :file => File.join(STREAMLINED_TEMPLATE_ROOT, 'relationships/edit_views/filter_select/_unselected_items.rhtml', :use_full_path => false
+page.replace_html "rel_#{@rel_name}_#{@current_id}_selected", :file => File.join(STREAMLINED_TEMPLATE_ROOT, 'relationships/edit_views/filter_select/_selected_items.rhtml', :use_full_path => false

Modified: edge/streamlined/templates/relationships/edit_views/_filter_select.rhtml (871 => 872)


--- edge/streamlined/templates/relationships/edit_views/_filter_select.rhtml	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/templates/relationships/edit_views/_filter_select.rhtml	2008-06-16 21:38:56 UTC (rev 872)
@@ -5,11 +5,11 @@
 	<input type="hidden" name="rel_name" value="<%= @rel_name %>">
 	<input type="hidden" name="klass" value="<%= @klass %>">
 	<div id="rel_<%= @rel_name %>_<%= @root.id %>_unselected" class="streamlined_relationship">
-	<%= render :partial => '../../vendor/plugins/streamlined/templates/relationships/edit_views/filter_select/unselected_items' %>
+	<%= render_streamlined_file '/relationships/edit_views/filter_select/_unselected_items.rhtml' %>
 </div>
 <hr>
 <div id="rel_<%= @rel_name %>_<%= @root.id %>_selected">
-<%= render :partial => '../../vendor/plugins/streamlined/templates/relationships/edit_views/filter_select/selected_items' %>
+<%= render_streamlined_file '/relationships/edit_views/filter_select/_selected_items.rhtml' %>
 </div>
   </form>
 <%= observe_form  "rel_#{@rel_name}_#{@root.id}", 

Modified: edge/streamlined/test/functional/streamlined/controller/enumeration_methods_test.rb (871 => 872)


--- edge/streamlined/test/functional/streamlined/controller/enumeration_methods_test.rb	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/test/functional/streamlined/controller/enumeration_methods_test.rb	2008-06-16 21:38:56 UTC (rev 872)
@@ -52,7 +52,7 @@
     @rel_type = flexmock(:enumeration => options[:enumeration], :edit_view => edit_view, :show_view => show_view)
     
     (model = flexmock).should_receive(:find).with('123').and_return(@item).once
-    (model_ui = flexmock).should_receive(:scalars).and_return(:foo => @rel_type).once
+    (model_ui = flexmock).stubs(:scalars).returns(:foo => @rel_type)
     
     flexmock(self, :model => model)
     flexmock(self, :model_ui => model_ui)
@@ -60,7 +60,7 @@
   end
   
   def should_render_with_partial(partial)
-    render_options = { :partial => partial, :locals => { :item => @item, :relationship => @rel_type }}
+    render_options = { :file => partial, :use_full_path => false, :locals => { :item => @item, :relationship => @rel_type }}
     flexmock(self).should_receive(:render).with(render_options).and_return('render_results').once
   end
   

Modified: edge/streamlined/test/unit/streamlined/controller/relationship_methods_test.rb (871 => 872)


--- edge/streamlined/test/unit/streamlined/controller/relationship_methods_test.rb	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/test/unit/streamlined/controller/relationship_methods_test.rb	2008-06-16 21:38:56 UTC (rev 872)
@@ -31,7 +31,7 @@
     show_view = flexmock('show_view', :partial => :partial)
     relationship = flexmock('relationship', :show_view => show_view)
     flexmock(@inst) do |mock|
-      mock.should_receive(:render).with(:partial => :partial, :locals => {:item => :item, :relationship => relationship, :streamlined_def => show_view}).once
+      mock.should_receive(:render).with(:file => :partial, :use_full_path => false, :locals => {:item => :item, :relationship => relationship, :streamlined_def => show_view}).once
     end
     @inst.render_show_view_partial(relationship, :item)
   end
@@ -43,7 +43,7 @@
       mock.should_receive(:model).and_return(flexmock('model', :find => nil))
       mock.should_receive(:context_column).and_return(rel_type).once
       mock.should_receive(:set_items_and_all_items).with(rel_type).once
-      expected_render_args = { :partial => 'partial', :locals => { :relationship => rel_type }}
+      expected_render_args = { :file => 'partial', :use_full_path => false, :locals => { :relationship => rel_type }}
       mock.should_receive(:render).with(expected_render_args).once
     end
     @inst.edit_relationship

Modified: edge/streamlined/test/unit/streamlined/view/base_test.rb (871 => 872)


--- edge/streamlined/test/unit/streamlined/view/base_test.rb	2008-06-06 01:15:42 UTC (rev 871)
+++ edge/streamlined/test/unit/streamlined/view/base_test.rb	2008-06-16 21:38:56 UTC (rev 872)
@@ -15,6 +15,6 @@
   end
   
   it "partial" do
-    assert_equal "../../vendor/plugins/streamlined/templates/relationships/view/base", @base.partial
+    assert_equal "#{STREAMLINED_TEMPLATE_ROOT}/relationships/view/_base.rhtml", @base.partial
   end
 end
\ No newline at end of file
Reply all
Reply to author
Forward
0 new messages