Changeset 1107

Show
Ignore:
Timestamp:
2008-07-18 09:56:07 (6 months ago)
Author:
gaspard
Message:

Changed date showing on version list to show creation date.
Fixed a bug where 'id' was removed in [summary] and [text].

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/views/versions/_tr.rhtml

    r1057 r1107  
    66  <td class="sign"><%= tr.user.initials %></td> 
    77  <td class="comment"><%= tr.comment %></td> 
    8   <td class="date"><%= tr.status == Zena::Status[:pub] ? tformat_date(tr.updated_at, 'datetime') : tformat_date(tr.created_at, 'datetime') %></td> 
     8  <td class="date"><%= tformat_date(tr.created_at, 'datetime') %></td> 
    99  <td class="actions"><%= version_actions(tr) %></td> 
    1010</tr> 
  • trunk/lib/parser/lib/rules/zena.rb

    r1106 r1107  
    677677      text = @params[:text] ? @params[:text].inspect : "#{node_attribute('v_text')}" 
    678678      limit  = @params[:limit] ? ", :limit=>#{@params[:limit].to_i}" : "" 
    679       @html_tag_params[:id] =  "v_text#{erb_node_id}" 
     679       
     680      @html_tag ||= 'div' 
     681      if @html_tag_params[:id] 
     682        # add a sub-div 
     683        pre  = "<div id='v_text#{erb_node_id}'>" 
     684        post = "</div>" 
     685      else 
     686        pre = post = '' 
     687        @html_tag_params[:id] = "v_text#{erb_node_id}" 
     688      end 
     689       
    680690      if c = @html_tag_params[:class] || @params[:class] 
    681691        @html_tag_params[:class] = "#{c} zazen" 
     
    684694      end 
    685695      unless @params[:empty] == 'true' 
    686         out "<% if #{node}.kind_of?(TextDocument); l = #{node}.content_lang -%>" 
     696        out "#{pre}<% if #{node}.kind_of?(TextDocument); l = #{node}.content_lang -%>" 
    687697        out "<%= zazen(\"<code\#{l ? \" lang='\#{l}'\" : ''} class=\\'full\\'>\#{#{text}}</code>\") %>" 
    688698        out "<% else -%>" 
    689699        out "<%= zazen(#{text}#{limit}, :node=>#{node}) %>" 
    690         out "<% end -%>
    691       else 
    692         out '' 
     700        out "<% end -%>#{post}
     701      else 
     702        out "#{pre}#{post}" 
    693703      end 
    694704    end 
     
    705715      limit  = @params[:limit] ? ", :limit=>#{@params[:limit].to_i}" : "" 
    706716      @html_tag ||= 'div' 
    707       @html_tag_params[:id] = "v_summary#{erb_node_id}" 
     717      if @html_tag_params[:id] 
     718        # add a sub-div 
     719        pre  = "<div id='v_summary#{erb_node_id}'>" 
     720        post = "</div>" 
     721      else 
     722        pre = post = '' 
     723        @html_tag_params[:id] = "v_summary#{erb_node_id}" 
     724      end 
     725       
    708726      if c = @html_tag_params[:class] || @params[:class] 
    709727        @html_tag_params[:class] = "#{c} zazen" 
     
    713731      unless @params[:or] 
    714732        text = @params[:text] ? @params[:text].inspect : node_attribute('v_summary') 
    715         out "<%= zazen(#{text}#{limit}, :node=>#{node}) %>
     733        out "#{pre}<%= zazen(#{text}#{limit}, :node=>#{node}) %>#{post}
    716734      else 
    717735        limit ||= ', :limit => 2' 
     
    721739        second_name = @params[:or].gsub(/[^a-z_]/,'') # FIXME: ist this still needed ? (ERB injection) 
    722740        second = node_attribute(second_name) 
    723         out "<% if #{first} != '' %>" 
     741        out "#{pre}<% if #{first} != '' %>" 
    724742        out "<%= zazen(#{first}, :node=>#{node}) %>" 
    725743        out "<% else %>" 
    726744        out "<%= zazen(#{second}#{limit}, :node=>#{node}) %>" 
    727         out "<% end %>
     745        out "<% end %>#{post}
    728746      end 
    729747    end 
  • trunk/test/helpers/zena_parser/basic.yml

    r1106 r1107  
    790790  res: "<div class='zazen' id='v_summary11'><p>This is the root of your peaceful tests.</p></div>" 
    791791 
     792summary_in_div_with_id: 
     793  src: "<div id='foo' do='summary'/>" 
     794  res: "<div class='zazen' id='foo'><div id='v_summary22'><p>status summary</p></div></div>" 
     795 
    792796text: 
    793797  src: "<r:text/>"