<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;% if @article %&gt;
-  &lt;%= render :partial =&gt; 'blogs/articles/article', :object =&gt; @article, :locals =&gt; {:mode =&gt; :single} %&gt;
-  &lt;%= render :partial =&gt; 'comments/list', :locals =&gt; {:commentable =&gt; @article, :comments =&gt; @article.approved_comments} %&gt;
+  &lt;%= render :partial =&gt; 'blogs/articles/article', :object =&gt; @article, :locals =&gt; { :mode =&gt; :single } %&gt;
+  &lt;%= render :partial =&gt; 'comments/list', :locals =&gt; { :commentable =&gt; @article, :comments =&gt; @article.approved_comments } %&gt;
   &lt;% if @article.accept_comments? %&gt;
-    &lt;%= render :partial =&gt; 'comments/form', :locals =&gt; {:commentable =&gt; @article} %&gt;
+    &lt;%= render :partial =&gt; 'comments/form', :locals =&gt; { :commentable =&gt; @article } %&gt;
   &lt;% end %&gt;
 &lt;% end %&gt;</diff>
      <filename>engines/adva_blog/app/views/blogs/articles/show.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -66,7 +66,6 @@ class BaseController &lt; ApplicationController
     end
 
     def return_from(action, options = {})
-      p params[:return_to]
       URI.unescape(params[:return_to] || begin
         url = Registry.get(:redirect, action)
         url = Registry.get(:redirect, url) if url.is_a?(Symbol)</diff>
      <filename>engines/adva_cms/app/controllers/base_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -39,7 +39,7 @@ module Admin::BaseHelper
 
   def link_to_profile(site = nil, options = {})
     name = options[:name].nil? ? t(:'adva.links.profile') : options[:name]
-    site = nil if site.new_record?
+    site = nil if site.try(:new_record?)
     link_to(name, admin_user_path(site, current_user))
   end
 </diff>
      <filename>engines/adva_cms/app/helpers/admin/base_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,9 @@
 .visible_for {
 	display: none;
 }
+.anonymous {
+	display: auto;
+}
 
 /* LISTS */
 </diff>
      <filename>engines/adva_cms/public/stylesheets/adva_cms/common.css</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@ module IntegrationTests
       click_link 'Sections'
       click_link 'New'
       fill_in 'title', :with =&gt; 'the page'
-      choose 'section_type_page'
+      select 'Page'
       click_button 'commit'
       request.url.should =~ %r(/admin/sites/\d+/sections/\d+/articles)
     end</diff>
      <filename>engines/adva_cms/test/integration/admin/custom_templates_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper')
 
 class AdminBaseHelperTest &lt; ActionView::TestCase
   include Admin::BaseHelper
+  include Admin::UsersHelper
 
   attr_accessor :request
 
@@ -10,12 +11,10 @@ class AdminBaseHelperTest &lt; ActionView::TestCase
     @site = Site.first
     @section = @site.sections.first
     @article = @section.articles.first
-    stub(self).current_user.returns User.new
+    stub(self).current_user.returns User.first
 
-    stub(self).admin_sites_path.returns 'admin_sites_path'
-    stub(self).admin_site_user_path.returns 'admin_site_user_path'
-    stub(self).admin_users_path.returns 'admin_users_path'
-    stub(self).admin_user_path.returns 'admin_user_path'
+    @admin_site_user_path = %r(/admin/sites/[\d]+/users/[\d]+)
+    @admin_user_path      = %r(/admin/users/[\d]+)
 
     @controller = TestController.new
     @request = ActionController::TestRequest.new
@@ -36,9 +35,9 @@ class AdminBaseHelperTest &lt; ActionView::TestCase
     form_for(:article, @article, :builder =&gt; TestFormBuilder, &amp;block)
     output_buffer
   end
-
+  
   include ::BaseHelper
-
+  
   test &quot;#save_or_cancel_links uses only button if no cancel url is given&quot; do
     stub(self).protect_against_forgery? { false } # let's make it easier
     html = build_form { |f| save_or_cancel_links(f) }
@@ -48,7 +47,7 @@ class AdminBaseHelperTest &lt; ActionView::TestCase
       buttons.should_not have_tag('a', 'Cancel')
     end
   end
-
+  
   test &quot;#save_or_cancel_links uses all parts if cancel url is given&quot; do
     stub(self).protect_against_forgery? { false } # let's make it easier
     html = build_form { |f| save_or_cancel_links(f, :cancel_url =&gt; 'cancel url') }
@@ -58,93 +57,90 @@ class AdminBaseHelperTest &lt; ActionView::TestCase
       buttons.should have_tag('a[href=?]', 'cancel url', 'Cancel')
     end
   end
-
+  
   test &quot;#save_or_cancel_links uses custom save text&quot; do
     stub(self).protect_against_forgery? { false } # let's make it easier
     html = build_form { |f| save_or_cancel_links(f, :save_text =&gt; 'save text') }
     html.should have_tag('input[type=?][value=?]', 'submit', 'save text')
   end
-
+  
   test &quot;#save_or_cancel_links uses custom or text&quot; do
     stub(self).protect_against_forgery? { false } # let's make it easier
     html = build_form { |f| save_or_cancel_links(f, :cancel_url =&gt; 'cancel url', :or_text =&gt; 'or text') }
     html.should =~ /or text/
   end
-
+  
   test &quot;#save_or_cancel_links uses custom cancel text&quot; do
     stub(self).protect_against_forgery? { false } # let's make it easier
     html = build_form { |f| save_or_cancel_links(f, :cancel_url =&gt; 'cancel url', :cancel_text =&gt; 'cancel text') }
     html.should have_tag('a[href=?]', 'cancel url', 'cancel text')
   end
-
+  
   test &quot;#save_or_cancel_links uses custom save attributes&quot; do
     stub(self).protect_against_forgery? { false } # let's make it easier
     html = build_form { |f| save_or_cancel_links(f, :save =&gt; { :class =&gt; 'save class' }) }
     html.should have_tag('input[type=?][class=?]', 'submit', 'save class')
   end
-
+  
   test &quot;#save_or_cancel_links uses custom cancel attributes&quot; do
     stub(self).protect_against_forgery? { false } # let's make it easier
     html = build_form { |f| save_or_cancel_links(f, :cancel_url =&gt; 'cancel url', :cancel =&gt; { :class =&gt; 'cancel class' }) }
     html.should have_tag('a[href=?][class=?]', 'cancel url', 'cancel class')
   end
 
-  # admin_site_select_tag
-  test &quot;#admin_site_select_tag with current user being a superuser
-        it shows the site overview option in the site select menu&quot; do
-    stub(current_user).has_role?(:superuser).returns true
-    admin_site_select_tag.should have_tag('select#site_select option[value=?]', 'admin_sites_path')
-  end
-
-  test &quot;#admin_site_select_tag with current user being a superuser
-        it shows the user manager option in the site select menu&quot; do
-    stub(current_user).has_role?(:superuser).returns true
-    admin_site_select_tag.should have_tag('select#site_select option[value=?]', 'admin_users_path')
-  end
-
-  test &quot;#admin_site_select_tag with current user not being a superuser
-      it shows the site overview option in the site select menu&quot; do
-    admin_site_select_tag.should_not have_tag('select#site_select option[value=?]', 'admin_sites_path')
-  end
-
-  test &quot;#admin_site_select_tag with current user not being a superuser
-      it shows the user manager option in the site select menu&quot; do
-    admin_site_select_tag.should_not have_tag('select#site_select option[value=?]', 'admin_users_path')
-  end
+  # not in use ...
+
+  # # admin_site_select_tag
+  # test &quot;#admin_site_select_tag with current user being a superuser
+  #       it shows the site overview option in the site select menu&quot; do
+  #   stub(current_user).has_role?(:superuser).returns true
+  #   admin_site_select_tag.should have_tag('select#site_select option[value=?]', 'admin_sites_path')
+  # end
+  # 
+  # test &quot;#admin_site_select_tag with current user being a superuser
+  #       it shows the user manager option in the site select menu&quot; do
+  #   stub(current_user).has_role?(:superuser).returns true
+  #   admin_site_select_tag.should have_tag('select#site_select option[value=?]', 'admin_users_path')
+  # end
+  # 
+  # test &quot;#admin_site_select_tag with current user not being a superuser
+  #     it shows the site overview option in the site select menu&quot; do
+  #   admin_site_select_tag.should_not have_tag('select#site_select option[value=?]', 'admin_sites_path')
+  # end
+  # 
+  # test &quot;#admin_site_select_tag with current user not being a superuser
+  #     it shows the user manager option in the site select menu&quot; do
+  #   admin_site_select_tag.should_not have_tag('select#site_select option[value=?]', 'admin_users_path')
+  # end
 
   # link_to_profile
-  test &quot;#link_to_profile returns admin/sites/1/users/1 as a profile link if site is set&quot; do
-    link_to_profile(@site).should == &quot;&lt;a href=\&quot;admin_site_user_path\&quot;&gt;Profile&lt;/a&gt;&quot;
+  test &quot;#link_to_profile links to admin/sites/1/users/1 if site is given&quot; do
+    link_to_profile(@site).should =~ @admin_site_user_path
   end
 
-  test &quot;#link_to_profile returns admin/users/1 as a profile link if no site is set&quot; do
-    link_to_profile.should == &quot;&lt;a href=\&quot;admin_user_path\&quot;&gt;Profile&lt;/a&gt;&quot;
+  test &quot;#link_to_profile links to  admin/users/1 if no site is given&quot; do
+    link_to_profile.should =~ @admin_user_path
   end
-
-  test &quot;#link_to_profile returns admin/users/1 as a profile link if site is a new record&quot; do
-    link_to_profile(Site.new).should == &quot;&lt;a href=\&quot;admin_user_path\&quot;&gt;Profile&lt;/a&gt;&quot;
-  end
-
-  test &quot;#link_to_profile returns custom link name for profile if specified&quot; do
-    link_to_profile(Site.new, :name =&gt; 'Dummy').should == &quot;&lt;a href=\&quot;admin_user_path\&quot;&gt;Dummy&lt;/a&gt;&quot;
+  
+  test &quot;#link_to_profile links to  admin/users/1 if site is a new record&quot; do
+    link_to_profile(Site.new).should =~ @admin_user_path
   end
-
-  test &quot;#link_to_profile returns admin/users/1 as a profile link if site is set but user is a superuser&quot; do
-    stub(current_user).has_role?(:superuser).returns true
-    link_to_profile(@site).should == &quot;&lt;a href=\&quot;admin_user_path\&quot;&gt;Profile&lt;/a&gt;&quot;
+  
+  test &quot;#link_to_profile links to custom link name for profile if specified&quot; do
+    link_to_profile(Site.new, :name =&gt; 'Dummy').should =~ /&gt;Dummy&lt;/
   end
 end
 
 class CachedPagesHelperTest &lt; ActionView::TestCase
   include Admin::BaseHelper
-  
+
   def setup
     super
     @page = CachedPage.first
-    
+
     @time_now = Time.local 2008, 1, 2, 12
     @yesterday = Time.local 2008, 1, 1, 12
-    
+
     stub(Time).now.returns @time_now # wtf ... time_now_in_words ignores the timezone
     stub(Time.zone).now.returns @time_now
     stub(Time.zone.now).yesterday.returns @yesterday
@@ -160,7 +156,7 @@ class CachedPagesHelperTest &lt; ActionView::TestCase
     @page.updated_at = @time_now - 6.hours
     page_cached_at(@page).should =~ /Today, /
   end
-  
+
   test &quot;#page_cached_at returns a formatted date if the cached page was updated before today&quot; do
     @page.updated_at = @yesterday
     page_cached_at(@page).should == 'Jan 01, 2008'</diff>
      <filename>engines/adva_cms/test/unit/helpers/admin/base_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
+&lt;%# @comment ||= commentable.comments.build %&gt;
 &lt;% if @comment %&gt;
-  &lt;div id=&quot;comment_form_wrapper&quot;&gt;
+	&lt;% authorized_tag(:div, :create, @comment, :id =&gt; 'comment_form_wrapper') do %&gt;
     &lt;div id=&quot;registered_author&quot; style=&quot;display: none;&quot;&gt;
       &lt;p&gt;&lt;%= t(:'adva.info.greeting_logged_in') %&gt;&lt;/p&gt;
     &lt;/div&gt;
@@ -37,5 +38,5 @@
         &lt;%= link_to_remote_comment_preview %&gt;
       &lt;/p&gt;
     &lt;% end %&gt;
-  &lt;/div&gt;
+	&lt;% end %&gt;
 &lt;% end %&gt;</diff>
      <filename>engines/adva_comments/app/views/comments/_form.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,3 @@
-&lt;% content_for :sidebar do %&gt;
-  &lt;%= render :partial =&gt; 'admin/theme_files/files' %&gt;
-&lt;% end %&gt;
-
 &lt;h2&gt;&lt;%= t(:'adva.theme_files.titles.upload') %&gt;&lt;/h2&gt;
 
 &lt;% form_tag upload_admin_theme_files_path(@site, @theme.id), { :method =&gt; :post, :multipart =&gt; true } do %&gt;
@@ -15,3 +11,5 @@
     &lt;%= link_to t(:'adva.common.cancel'), admin_theme_path(@site, @theme.id) %&gt;
   &lt;% end %&gt;
 &lt;% end %&gt;
+
+&lt;% render :partial =&gt; 'sidebar' %&gt;
\ No newline at end of file</diff>
      <filename>engines/adva_themes/app/views/admin/theme_files/import.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -6,11 +6,11 @@ module RolesHelper
 
   def role_to_css_class(role)
     return unless role
-    if role.instance_of? Rbac::Role::Author
-      [role.context.author_type.underscore, role.context.author_id].join('-') + ' ' + role_to_default_css_class(role)
-    else
-      role_to_default_css_class(role)
+    roles = ''
+    if role.instance_of?(Rbac::Role::Author) &amp;&amp; role.context.author_type
+      roles &lt;&lt; [role.context.author_type.underscore, role.context.author_id].join('-') + ' ' 
     end
+    roles &lt;&lt; role_to_default_css_class(role)
   end
 
   # Includes a javascript tag that will load a javascript snippet
@@ -30,22 +30,14 @@ module RolesHelper
       }
       var aid = Cookie.get('aid');
       if(aid) {
-        $(document).ready(function() {
-          authorize_elements(['anonymous-' + aid]);
-        });
-        // $.ajax({
-        //   url: '/anonymouses/' + aid + '.js',
-        //   type: 'get',
-        //   async: false,
-        //   dataType: 'script'
-        // });
+        $(document).ready(function() { authorize_elements(['anonymous-' + aid]); });
       }
     js
   end
 
   def authorized_tag(name, action, object, options = {}, &amp;block)
     add_authorizing_css_classes! options, action, object
-    content_tag name, options, &amp;block
+    content_tag(name, options, &amp;block)
   end
 
   def authorized_link_to(text, url, action, object, options = {})</diff>
      <filename>engines/adva_user/app/helpers/roles_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -63,8 +63,7 @@ module With
       def define_test_method(target, context, options = {})
         method_name = generate_test_method_name(context)
         target.send :define_method, method_name, &amp;lambda {
-          @_with_contexts = (context.parents &lt;&lt; context).map(&amp;:name)
-          [:before, :action, :assertion, :after].each do |stage|
+          call_stage = lambda do |stage|
             @_with_current_stage = stage
             context.collect(stage).map do |call| 
               if @_expected_exception and stage == :action
@@ -74,9 +73,15 @@ module With
               end
             end
           end
+          begin
+            @_with_contexts = (context.parents &lt;&lt; context).map(&amp;:name)
+            [:before, :action, :assertion].each { |stage| call_stage.call(stage) } 
+          ensure
+            call_stage.call(:after)
+          end
         }
       end
-
+      
       def generate_test_method_name(context)
         contexts = context.parents &lt;&lt; context
         assertions = context.calls(:assertion)</diff>
      <filename>test/with/lib/with/context.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8c99adf380a819410d1b3ee8815d6c397fb81638</id>
    </parent>
  </parents>
  <author>
    <name>Sven Fuchs</name>
    <email>svenfuchs@artweb-design.de</email>
  </author>
  <url>http://github.com/svenfuchs/adva_cms/commit/eee97cc8ae5d1862432b4689981e3808f23aecf4</url>
  <id>eee97cc8ae5d1862432b4689981e3808f23aecf4</id>
  <committed-date>2009-04-24T06:36:36-07:00</committed-date>
  <authored-date>2009-04-24T06:35:44-07:00</authored-date>
  <message>further bugfixes after interface refactoring</message>
  <tree>98208cef9085c3bfac1556adfd45a97fee353519</tree>
  <committer>
    <name>Sven Fuchs</name>
    <email>svenfuchs@artweb-design.de</email>
  </committer>
</commit>
