Changeset 1131

Show
Ignore:
Timestamp:
2008-08-14 20:56:39 (5 months ago)
Author:
gaspard
Message:

Fixed bug in recursion method when template name contains '-'.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/models/node.rb

    r1125 r1131  
    133133                     :wgroup_id, :pgroup_id, :basepath, :custom_base, :klass, :zip, :score, :comments_count, :l_status, :l_comment, 
    134134                     :custom_a, :custom_b, :title, :text 
    135   safe_attribute     :m_text, :m_title, :m_author           
     135  safe_attribute     :m_text, :m_title, :m_author    
    136136  zafu_context       :author => "Contact", :parent => "Node",  
    137137                     :project => "Project", :section => "Section",  
  • trunk/lib/parser/lib/rules/zena.rb

    r1127 r1131  
    211211      inc = descendant('include') 
    212212      if inc && inc.params[:part] == @name 
    213         @context["#{@name}_method".to_sym] = method_name = template_url[1..-1].gsub('/','_') 
     213        @context["#{@name}_method".to_sym] = method_name = template_url[1..-1].gsub(/[\/-]/,'_') 
    214214        pre << "<% def #{method_name}(depth, node, list); return '' if depth > #{inc.params[:depth] ? [inc.params[:depth].to_i,30].min : 5}; _erbout = '' -%>" 
    215215        post << "<% _erbout; end -%><%= #{method_name}(0,#{node},#{list || "[#{node}]"}) %>" 
     
    14291429         
    14301430        @params[:alt_class] ||= @html_tag_params.delete(:alt_class) 
    1431          
     1431        raise # TODO: add alt_reverse='true' to start counting from bottom (if order last on top...) 
    14321432        if @params[:alt_class] || @params[:join] 
    14331433          join = @params[:join] || '' 
  • trunk/test/helpers/zena_parser/ajax.yml

    r1127 r1131  
    177177    </ul> 
    178178  'each/in/en/each/dom/id/list1.erb': "/list2_..@node.zip._..var1.zip./" 
     179 
     180start_id: 
     181  src: "<r:form><input type='hidden' name='s' set_value='[start.id]'/></r:form>" 
     182  res: "." 
  • trunk/test/helpers/zena_parser/errors.yml

    r1117 r1131  
    6363  src: "<r:show eval='puts \"bad\"'/>" 
    6464  tem: "<span class='parser_error'>[show] var \"puts\" not set in eval</span>" 
     65 
     66not_finished_block: 
     67  src: "<r:if kind_of='Document'><r:link format='data'><r:img mode='tiny'/> <r:show attr='name'/>.<r:show attr='c_ext'/></r:link><r:else do='link'/></r:if>"