<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -10,3 +10,5 @@ require 'rake/rdoctask'
 require 'tasks/rails'
 
 task :cruise =&gt; ['doc:app', 'test']
+# Helper task for the pre-checkin smoke check
+task :smoke =&gt; ['test', 'talia_core:test', 'widgeon:test']</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -6,12 +6,12 @@
 
 &lt;!-- link back --&gt;
 &lt;% for supertype in w.supertypes %&gt;
-  &lt;!-- &lt;h3 class=&quot;super&quot;&gt;&lt;%= type_link(&quot;&lt;&lt; #{@widget.class_label(supertype)}&quot;, supertype) %&gt;&lt;/h3&gt; --&gt;
+  &lt;!-- &lt;h3 class=&quot;super&quot;&gt;&lt;%= type_link(&quot;&lt;&lt; #{w.class_label(supertype)}&quot;, supertype) %&gt;&lt;/h3&gt; --&gt;
 &lt;% end %&gt;
 
 &lt;!-- pagina in cui sono --&gt;
 &lt;% if(w.source_class) %&gt;
-  &lt;!-- &lt;h3 class=&quot;exact&quot;&gt; &lt;%= @widget.class_label(@widget.source_class) %&gt;&lt;/h3&gt; --&gt;
+  &lt;!-- &lt;h3 class=&quot;exact&quot;&gt; &lt;%= w.class_label(w.source_class) %&gt;&lt;/h3&gt; --&gt;
 &lt;% end %&gt;
 
 &lt;!-- livelli sotto --&gt;
@@ -26,7 +26,7 @@
         &lt;div id=&quot;pod-list-wrap-ext&quot;&gt;
 
           &lt;div id=&quot;pod-list-wrap&quot;&gt;
-                  &lt;%= navigation_list %&gt;
+                  &lt;%= w.navigation_list %&gt;
             &lt;/div&gt;
         &lt;/div&gt;
     &lt;/div&gt;</diff>
      <filename>app/views/widgets/navigation_bar/_navigation_bar_widget.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,6 @@
 # Down link to navigate to a lower level
 %&gt;
 
-&lt;li class=&quot;ipod_navigation_down_link&quot; id=&quot;&lt;%= id_for(type) %&gt;&quot;&gt; 
-    &lt;%= type_link_down(type, level) %&gt; 
+&lt;li class=&quot;ipod_navigation_down_link&quot; id=&quot;&lt;%= w.id_for(type) %&gt;&quot;&gt; 
+    &lt;%= w.type_link_down(type, level) %&gt; 
 &lt;/li&gt;
\ No newline at end of file</diff>
      <filename>app/views/widgets/navigation_bar/_navigation_down_link.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -5,11 +5,11 @@
 %&gt;
 
 &lt;ul id=&quot;ipod_nav_level_&lt;%= current_level %&gt;&quot;&gt;
-  &lt;%= navigation_up_links %&gt;
+  &lt;%= w.navigation_up_links %&gt;
   
   &lt;li class=&quot;ipod_navigation_where_i_am&quot; id=&quot;current_nav_item&quot;&gt;
-    &lt;b&gt;&lt;%= navigation_title %&gt;&lt;/b&gt;
+    &lt;b&gt;&lt;%= w.navigation_title %&gt;&lt;/b&gt;
   &lt;/li&gt;
   
-  &lt;%= navigation_down_links(current_level) %&gt;
+  &lt;%= w.navigation_down_links(current_level) %&gt;
 &lt;/ul&gt;</diff>
      <filename>app/views/widgets/navigation_bar/_navigation_list.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,6 @@
 # &quot;Up&quot; link (to navigate back to a previous level
 %&gt;
 
-&lt;li class=&quot;ipod_navigation_back_link&quot; id=&quot;&lt;%= id_for(type) %&gt;&quot;&gt;
-      &lt;%= type_link_up(type) %&gt;
+&lt;li class=&quot;ipod_navigation_back_link&quot; id=&quot;&lt;%= w.id_for(type) %&gt;&quot;&gt;
+      &lt;%= w.type_link_up(type) %&gt;
 &lt;/li&gt;</diff>
      <filename>app/views/widgets/navigation_bar/_navigation_up_link.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ class NavigationBarWidget &lt; Widgeon::Widget
     assit_kind_of(Array, @allowed_namespaces, &quot;Must configure the allowed namespaces.&quot;)
     
     @show_home = false # normally don't show the home/back link
-    
+   
     # We'll get the @navigation_type when the navigation is in callback
     if(@navigation_type &amp;&amp; @navigation_type != 'root')
       @source_class = N::SourceClass.make_uri(@navigation_type, &quot;#&quot;)
@@ -39,6 +39,91 @@ class NavigationBarWidget &lt; Widgeon::Widget
     end
   end
   
+  # Creates the &quot;up&quot; links in the navigation list
+  def navigation_up_links
+    result = &quot;&quot;
+    if(show_home)
+      result &lt;&lt; widget_partial(&quot;navigation_up_link&quot;, :locals =&gt; { :type =&gt; &quot;Back&quot; })
+    end
+    for supertype in supertypes 
+      result &lt;&lt; widget_partial(&quot;navigation_up_link&quot;, :locals =&gt; { :type =&gt; supertype })
+    end
+    result
+  end
+  
+  # Creates the &quot;down links in the navigation list
+  def navigation_down_links(level)
+    result = &quot;&quot;
+    for subtype in subtypes
+      result &lt;&lt; widget_partial(&quot;navigation_down_link&quot;, :locals =&gt; { :type =&gt; subtype, :level =&gt; level })
+    end
+    result
+  end
+  
+  # Creates a link to the given source, moving the ipod list &quot;down&quot;
+  def type_link_down(type, level)
+    text = class_label(type)
+    widget_remote_link(text,  
+      { :javascript =&gt; :ipod_down,
+        :navigation_type =&gt; type.to_name_s(&quot;#&quot;), 
+        :navigation_id =&gt; type_id(type), 
+        :level =&gt; level,
+        :fallback =&gt; static_url_for(type)
+      }, 
+      { :class =&gt; &quot;ipodStyle&quot; } )
+  end
+  
+  # Creates a link to the given type, used as an &quot;up&quot; backlink for the ipod navigation
+  def type_link_up(type)
+    text = type.is_a?(String) ? type : class_label(type)
+    widget_remote_link(text,
+    {
+      :javascript =&gt; :ipod_up,
+      :navigation_type =&gt; type.is_a?(String) ? &quot;root&quot; : type.to_name_s('#'),
+      :fallback =&gt; static_url_for(type)
+    },
+    { :class =&gt; &quot;ipodStyle&quot; } )
+  end
+  
+  # Title element for the navigation
+  def navigation_title
+    source_class ? class_label(source_class) : &quot;Source Types&quot;
+  end
+  
+  # Creates an css id for the given type
+  def id_for(type)
+    type.is_a?(String) ? type.downcase : type_id(type)
+  end
+  
+  # Create a paginator for the current type
+  def type_paginator
+    @pager = SourcePaginator.new(TaliaCore::TypeRecord.count(:conditions =&gt; [&quot;uri = ?&quot;, @type.to_s] ), 5, :type =&gt; @type)
+  end
+  
+  # Renders the navigation list of level 1
+  def navigation_list
+    widget_partial(&quot;navigation_list&quot;, 
+      :locals =&gt; { :current_level =&gt; &quot;1&quot; })
+  end
+  
+  private
+  
+  
+  # Creates a static url for the given type
+  def static_url_for(type)
+    return request.params if(type.is_a?(String))
+    static_url_params = request.parameters
+    if(type)
+      static_url_params[:id] = type_id(type)
+    end
+    url_for(static_url_params)
+  end
+  
+  # Get a type id/string
+  def type_id(type)
+    type.to_name_s('_')
+  end
+  
   # This is the callback that updates the scrolling navigation, going down to 
   # the next level
   remote_call :ipod_down do |page|</diff>
      <filename>app/views/widgets/navigation_bar/navigation_bar_widget.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>app/views/widgets/navigation_bar/navigation_bar_helper.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>07e3b5c923677a8fc1e4492356dd038c40971444</id>
    </parent>
  </parents>
  <author>
    <name>daniel</name>
    <email>ghub@limitedcreativity.org</email>
  </author>
  <url>http://github.com/net7/talia/commit/ea05e095e41289ea4a9eca292049dfa0b076031f</url>
  <id>ea05e095e41289ea4a9eca292049dfa0b076031f</id>
  <committed-date>2008-04-10T09:09:20-07:00</committed-date>
  <authored-date>2008-04-10T09:09:20-07:00</authored-date>
  <message>New &quot;Helper&quot; mechanism for widgets.

git-svn-id: http://svn.talia.discovery-project.eu/talia/trunk/talia_app@567 2960d7dc-a92c-0410-a2fe-c68badc242c0</message>
  <tree>cf22abc6468b4c28f7a7488bd0de8fa546ce61d0</tree>
  <committer>
    <name>daniel</name>
    <email>ghub@limitedcreativity.org</email>
  </committer>
</commit>
