Changeset 1107
- Timestamp:
- 2008-07-18 09:56:07 (6 months ago)
- Files:
-
- trunk/app/views/versions/_tr.rhtml (modified) (1 diff)
- trunk/lib/parser/lib/rules/zena.rb (modified) (5 diffs)
- trunk/test/helpers/zena_parser/basic.yml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/views/versions/_tr.rhtml
r1057 r1107 6 6 <td class="sign"><%= tr.user.initials %></td> 7 7 <td class="comment"><%= tr.comment %></td> 8 <td class="date"><%= t r.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> 9 9 <td class="actions"><%= version_actions(tr) %></td> 10 10 </tr> trunk/lib/parser/lib/rules/zena.rb
r1106 r1107 677 677 text = @params[:text] ? @params[:text].inspect : "#{node_attribute('v_text')}" 678 678 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 680 690 if c = @html_tag_params[:class] || @params[:class] 681 691 @html_tag_params[:class] = "#{c} zazen" … … 684 694 end 685 695 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 -%>" 687 697 out "<%= zazen(\"<code\#{l ? \" lang='\#{l}'\" : ''} class=\\'full\\'>\#{#{text}}</code>\") %>" 688 698 out "<% else -%>" 689 699 out "<%= zazen(#{text}#{limit}, :node=>#{node}) %>" 690 out "<% end -%> "691 else 692 out ''700 out "<% end -%>#{post}" 701 else 702 out "#{pre}#{post}" 693 703 end 694 704 end … … 705 715 limit = @params[:limit] ? ", :limit=>#{@params[:limit].to_i}" : "" 706 716 @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 708 726 if c = @html_tag_params[:class] || @params[:class] 709 727 @html_tag_params[:class] = "#{c} zazen" … … 713 731 unless @params[:or] 714 732 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}" 716 734 else 717 735 limit ||= ', :limit => 2' … … 721 739 second_name = @params[:or].gsub(/[^a-z_]/,'') # FIXME: ist this still needed ? (ERB injection) 722 740 second = node_attribute(second_name) 723 out " <% if #{first} != '' %>"741 out "#{pre}<% if #{first} != '' %>" 724 742 out "<%= zazen(#{first}, :node=>#{node}) %>" 725 743 out "<% else %>" 726 744 out "<%= zazen(#{second}#{limit}, :node=>#{node}) %>" 727 out "<% end %> "745 out "<% end %>#{post}" 728 746 end 729 747 end trunk/test/helpers/zena_parser/basic.yml
r1106 r1107 790 790 res: "<div class='zazen' id='v_summary11'><p>This is the root of your peaceful tests.</p></div>" 791 791 792 summary_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 792 796 text: 793 797 src: "<r:text/>"
