Changeset 648

Show
Ignore:
Timestamp:
2007-06-21 16:16:20 (2 years ago)
Author:
gaspard
Message:

[change] part selection during zafu template inclusion is now made through a unique 'id' element instead of the whole path. Using 'id' attribute on a tag sets the part name.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/TODO

    r637 r648  
    1515Tag  ==> VirtualClass ? 
    1616Tracker => VirtualClass 
     17 
     18* add zafu part by object id. <h1 id='title'>...</h1>   <r:with id='part'>...</r:with> 
    1719 
    1820* replace 'link_to_remote, :method => post/put' by 'button_to_remote' 
  • trunk/app/helpers/application_helper.rb

    r645 r648  
    889889    node = opts[:node] || @node 
    890890    tag  = opts[:tag] || 'li' 
    891     join = opts[:join] || ' /
     891    join = opts[:join] || '
    892892    nav = [] 
    893893    node.ancestors.each do |obj| 
     
    896896     
    897897    nav << "<a href='#{url_for(zen_path(node))}' class='current'>#{node.name}</a>" 
    898     res = "#{res}<#{tag}>#{nav.join("</#{tag}>#{join}<#{tag}>")}</#{tag}>" 
     898    res = "#{res}<#{tag}>#{nav.join("</#{tag}><#{tag}>#{join}")}</#{tag}>" 
    899899  end 
    900900   
  • trunk/app/models/document.rb

    r599 r648  
    103103  end 
    104104   
     105  def rootpath 
     106    super + ".#{version.content.ext}" 
     107  end 
     108   
    105109  private 
    106110   
  • trunk/app/views/comments/list.rhtml

    r512 r648  
    1 <div id='content'> 
    2   <h3><%= _('manage comments') %></h3> 
     1<h3><%= _('manage comments') %></h3> 
    32 
    4   <ul class='comment' id='comments_list'> 
    5     <%= render :partial=>'comments/li', :collection=>@comments %> 
    6   </ul> 
     3<ul class='comment' id='comments_list'> 
     4  <%= render :partial=>'comments/li', :collection=>@comments %> 
     5</ul> 
    76 
    8   <%= link_to _("Previous page"), { :page => @comment_pages.current.previous } if @comment_pages.current.previous %> 
    9   <%= link_to _("Next page"), { :page => @comment_pages.current.next } if @comment_pages.current.next %> 
     7<%= link_to _("Previous page"), { :page => @comment_pages.current.previous } if @comment_pages.current.previous %> 
     8<%= link_to _("Next page"), { :page => @comment_pages.current.next } if @comment_pages.current.next %> 
    109 
    11   <div id='bin'> 
    12     <%= render :partial=>'comments/bin' %> 
    13   </div> 
     10<div id='bin'> 
     11  <%= render :partial=>'comments/bin' %> 
    1412</div> 
    15  
    16 <div id='right'> 
    17 </div> 
  • trunk/app/views/groups/index.rhtml

    r637 r648  
    1 <div id='content'> 
    2   <h3><%= _('manage groups') %></h3> 
    3   <table class="admin" cellspacing="0"> 
    4     <tr><th class='nav' colspan='3'> 
    5     <p class='next_page'><%= link_to _('img_next_page'), { :page => @group_pages.current.next } if @group_pages.current.next %></p> 
    6     <p class='prev_page'><%= link_to _('img_prev_page'), { :page => @group_pages.current.previous } if @group_pages.current.previous %></p></th></tr> 
    7     <%= render :partial=>'groups/li',  :collection=>@groups %> 
    8     <%= render :partial=>'groups/add', :locals=>{:users=>@users} %> 
    9   </table> 
    10 </div> 
    11  
    12 <div id='right'> 
    13 </div> 
     1<h3><%= _('manage groups') %></h3> 
     2<table class="admin" cellspacing="0"> 
     3  <tr><th class='nav' colspan='3'> 
     4  <p class='next_page'><%= link_to _('img_next_page'), { :page => @group_pages.current.next } if @group_pages.current.next %></p> 
     5  <p class='prev_page'><%= link_to _('img_prev_page'), { :page => @group_pages.current.previous } if @group_pages.current.previous %></p></th></tr> 
     6  <%= render :partial=>'groups/li',  :collection=>@groups %> 
     7  <%= render :partial=>'groups/add', :locals=>{:users=>@users} %> 
     8</table> 
  • trunk/app/views/relations/index.erb

    r637 r648  
    1 <div id='content'> 
    2   <h3><%= _('manage relations') %></h3> 
    3    
    4   <table id='relation_list' class='admin' cellspacing="0"> 
    5     <tr><th class='nav' colspan='9'> 
    6     <p class='next_page'><%= link_to _('img_next_page'), { :page => @relation_pages.current.next } if @relation_pages.current.next %></p> 
    7     <p class='prev_page'><%= link_to _('img_prev_page'), { :page => @relation_pages.current.previous } if @relation_pages.current.previous %></p></th></tr> 
    8     <%= render :partial=>'relations/li',  :collection=>@relations %> 
    9     <%= render :partial=>'relations/add' %> 
    10   </table> 
    11   <pre> 
    12     </pre> 
    13 <div id='right'> 
    14 </div> 
     1<h3><%= _('manage relations') %></h3> 
     2 
     3<table id='relation_list' class='admin' cellspacing="0"> 
     4  <tr><th class='nav' colspan='9'> 
     5  <p class='next_page'><%= link_to _('img_next_page'), { :page => @relation_pages.current.next } if @relation_pages.current.next %></p> 
     6  <p class='prev_page'><%= link_to _('img_prev_page'), { :page => @relation_pages.current.previous } if @relation_pages.current.previous %></p></th></tr> 
     7  <%= render :partial=>'relations/li',  :collection=>@relations %> 
     8  <%= render :partial=>'relations/add' %> 
     9</table> 
  • trunk/app/views/users/index.rhtml

    r637 r648  
    1 <div id='content'> 
    2   <h3><%= _('manage users') %></h3> 
    3    
    4   <table id='user_list' class='admin' cellspacing="0"> 
    5     <tr><th class='nav' colspan='5'> 
    6     <p class='next_page'><%= link_to _('img_next_page'), { :page => @user_pages.current.next } if @user_pages.current.next %></p> 
    7     <p class='prev_page'><%= link_to _('img_prev_page'), { :page => @user_pages.current.previous } if @user_pages.current.previous %></p></th></tr> 
    8     <%= render :partial=>'users/li',  :collection=>@users %> 
    9     <%= render :partial=>'users/add', :locals=>{:groups=>@groups} %> 
    10   </table>   
    11 </div> 
     1<h3><%= _('manage users') %></h3> 
    122 
    13 <div id='right'> 
    14 </div> 
     3<table id='user_list' class='admin' cellspacing="0"> 
     4  <tr><th class='nav' colspan='5'> 
     5  <p class='next_page'><%= link_to _('img_next_page'), { :page => @user_pages.current.next } if @user_pages.current.next %></p> 
     6  <p class='prev_page'><%= link_to _('img_prev_page'), { :page => @user_pages.current.previous } if @user_pages.current.previous %></p></th></tr> 
     7  <%= render :partial=>'users/li',  :collection=>@users %> 
     8  <%= render :partial=>'users/add', :locals=>{:groups=>@groups} %> 
     9</table> 
  • trunk/app/views/users/preferences.html.erb

    r512 r648  
    1 <div id='content'> 
    21<h3><%= @user.fullname %> : <%= _('preferences') %> </h3> 
    32 
    4   <ul class='actions' id='preferences'> 
    5      
    6     <li> 
    7       <div id='user_info'><%= link_to_function _('change personal information'), "['user_info', 'user_set_info'].each(Element.toggle); $('user_login').focus();" %></div> 
    8       <div id='user_set_info' style='display:none;'><%= link_to_function _('cancel'), "['user_info', 'user_set_info'].each(Element.toggle);" %> 
    9         <div id='user_info_errors' class='errors'></div> 
    10         <%= form_remote_tag(:url => user_path(@user[:id]), :method => :put) %> 
    11         <div class='hidden'><input type='hidden' name='update' value='info'/></div> 
    12         <ul> 
    13           <li id='user_info_errors'></li> 
    14           <li class='align'><%= _('login')%>      <span><%= text_field('user', 'login',        :size=>25 ) %></span></li> 
    15           <li class='align'><%= _('first name')%> <span><%= text_field('user', 'first_name',   :size=>25 ) %></span></li> 
    16           <li class='align'><%= _('name')%>       <span><%= text_field('user', 'name',         :size=>25 ) %></span></li> 
    17           <li class='align'><%= _('language')%>   <span><%= select('user', 'lang', ZENA_ENV[:languages].map{|l| [_(l),l]} ) %></span></li> 
    18           <li class='align'><%= _('time zone')%>  <span><%= time_zone_select('user', 'time_zone') %></span></li> 
    19           <li class='align'><%= _('email')%>      <span><%= text_field('user', 'email',        :size=>25 ) %></span></li> 
    20           <li><p class='btn_validate'><input type='submit' value='<%= _('validate') %>'/></p></li> 
    21         </ul> 
    22         </form> 
    23       </div> 
    24     </li> 
    25      
    26     <li> 
    27       <div id='user_pass'><%= link_to_function _('change password'), "['user_pass', 'user_set_pass'].each(Element.toggle); $('user_old_password').focus();" %></div> 
    28       <div id='user_set_pass' style='display:none;'><%= link_to_function _('cancel'), "['user_pass', 'user_set_pass'].each(Element.toggle); $('user_password').value='';" %> 
    29         <div id='user_pass_errors' class='errors'></div> 
    30         <%= form_remote_tag(:url => user_path(@user[:id]), :method => :put) %> 
    31         <div class='hidden'><input type='hidden' name='update' value='pass'/></div> 
    32         <ul> 
    33           <li class='align'><%= _("old password")%> <span><%= password_field('user', 'old_password',       :size=>20, :value=>'' ) %></span></li> 
    34           <li class='align'><%= _("new password")%> <span><%= password_field('user', 'password',           :size=>20, :value=>'' ) %></span></li> 
    35           <li class='align'><%= _("retype new password")%> <span><%= password_field('user', 'retype_password', :size=>20, :value=>'' ) %></span></li> 
    36           <li><p class='btn_validate'><input type='submit' value='<%= _('validate') %>'/></p></li> 
    37         </ul> 
    38         </form> 
    39       </div> 
    40     </li> 
    41   </ul> 
    42 </div> 
    43  
    44 <div id='related'> 
    45 </div> 
     3<ul class='actions' id='preferences'> 
     4   
     5  <li> 
     6    <div id='user_info'><%= link_to_function _('change personal information'), "['user_info', 'user_set_info'].each(Element.toggle); $('user_login').focus();" %></div> 
     7    <div id='user_set_info' style='display:none;'><%= link_to_function _('cancel'), "['user_info', 'user_set_info'].each(Element.toggle);" %> 
     8      <div id='user_info_errors' class='errors'></div> 
     9      <%= form_remote_tag(:url => user_path(@user[:id]), :method => :put) %> 
     10      <div class='hidden'><input type='hidden' name='update' value='info'/></div> 
     11      <ul> 
     12        <li id='user_info_errors'></li> 
     13        <li class='align'><%= _('login')%>      <span><%= text_field('user', 'login',        :size=>25 ) %></span></li> 
     14        <li class='align'><%= _('first name')%> <span><%= text_field('user', 'first_name',   :size=>25 ) %></span></li> 
     15        <li class='align'><%= _('name')%>       <span><%= text_field('user', 'name',         :size=>25 ) %></span></li> 
     16        <li class='align'><%= _('language')%>   <span><%= select('user', 'lang', ZENA_ENV[:languages].map{|l| [_(l),l]} ) %></span></li> 
     17        <li class='align'><%= _('time zone')%>  <span><%= time_zone_select('user', 'time_zone') %></span></li> 
     18        <li class='align'><%= _('email')%>      <span><%= text_field('user', 'email',        :size=>25 ) %></span></li> 
     19        <li><p class='btn_validate'><input type='submit' value='<%= _('validate') %>'/></p></li> 
     20      </ul> 
     21      </form> 
     22    </div> 
     23  </li> 
     24   
     25  <li> 
     26    <div id='user_pass'><%= link_to_function _('change password'), "['user_pass', 'user_set_pass'].each(Element.toggle); $('user_old_password').focus();" %></div> 
     27    <div id='user_set_pass' style='display:none;'><%= link_to_function _('cancel'), "['user_pass', 'user_set_pass'].each(Element.toggle); $('user_password').value='';" %> 
     28      <div id='user_pass_errors' class='errors'></div> 
     29      <%= form_remote_tag(:url => user_path(@user[:id]), :method => :put) %> 
     30      <div class='hidden'><input type='hidden' name='update' value='pass'/></div> 
     31      <ul> 
     32        <li class='align'><%= _("old password")%> <span><%= password_field('user', 'old_password',       :size=>20, :value=>'' ) %></span></li> 
     33        <li class='align'><%= _("new password")%> <span><%= password_field('user', 'password',           :size=>20, :value=>'' ) %></span></li> 
     34        <li class='align'><%= _("retype new password")%> <span><%= password_field('user', 'retype_password', :size=>20, :value=>'' ) %></span></li> 
     35        <li><p class='btn_validate'><input type='submit' value='<%= _('validate') %>'/></p></li> 
     36      </ul> 
     37      </form> 
     38    </div> 
     39  </li> 
     40</ul> 
  • trunk/app/views/virtual_classes/index.erb

    r637 r648  
    1 <div id='content'> 
    2   <h3><%= _('manage classes') %></h3> 
    3    
    4   <table id='virtual_class_list' class='admin' cellspacing="0"> 
    5     <tr><th class='nav' colspan='6'> 
    6     <p class='next_page'><%= link_to _('img_next_page'), { :page => @virtual_class_pages.current.next } if @virtual_class_pages.current.next %></p> 
    7     <p class='prev_page'><%= link_to _('img_prev_page'), { :page => @virtual_class_pages.current.previous } if @virtual_class_pages.current.previous %></p></th></tr> 
    8     <%= render :partial=>'virtual_classes/li',  :collection=>@virtual_classes %> 
    9     <%= render :partial=>'virtual_classes/add' %> 
    10   </table> 
    11 </div> 
     1<h3><%= _('manage classes') %></h3> 
    122 
    13 <div id='right'> 
    14 </div> 
     3<table id='virtual_class_list' class='admin' cellspacing="0"> 
     4  <tr><th class='nav' colspan='6'> 
     5  <p class='next_page'><%= link_to _('img_next_page'), { :page => @virtual_class_pages.current.next } if @virtual_class_pages.current.next %></p> 
     6  <p class='prev_page'><%= link_to _('img_prev_page'), { :page => @virtual_class_pages.current.previous } if @virtual_class_pages.current.previous %></p></th></tr> 
     7  <%= render :partial=>'virtual_classes/li',  :collection=>@virtual_classes %> 
     8  <%= render :partial=>'virtual_classes/add' %> 
     9</table> 
  • trunk/db/init/base/skins/default/Contact.html

    r540 r648  
    11<r:include template='layout.html'> 
    2   <r:with part='body/container/content/main'> 
     2  <r:with part='main'> 
    33    <h1 do='title' attr='c_fullname' actions='all'>Gaspard Bucher</h1> 
    44  </r:with> 
  • trunk/db/init/base/skins/default/Node.html

    r549 r648  
    11<r:include template='layout.html'> 
    2   <r:with part='body/container/context'> 
     2  <r:with part='context'> 
    33    <r:project> 
    44      <h2 do='show' attr='name'>zena</h2> 
     
    1414    </r:project> 
    1515  </r:with> 
    16   <r:with part='body/container/content/main'> 
    17     <r:include template='layout.html' part='body/container/content/main/title'/> 
     16  <r:with part='main'> 
     17    <r:include template='layout.html' part='title'/> 
    1818     
    1919    <r:summary text=''/> 
  • trunk/db/init/base/skins/default/Node_admin_layout.html

    r566 r648  
    11<r:include template='layout.html'> 
    2   <r:with part='head/stylesheets'> 
     2  <r:with part='stylesheets'> 
    33    <r:stylesheets list='reset,zena,comment,admin,search'/> 
    44    <link href="default.css" rel="Stylesheet" type="text/css"/> 
     5<style> 
     6ul.admin_links { margin:70px 25px 0; border:1px solid #35462B; background:#eee;} 
     7.admin_links li { padding:0;} 
     8.admin_links li a { margin:0; border-top:1px solid #35462B; padding:10px 5px; font-size:0.9em; color:#560B0A;  display:block;} 
     9.admin_links li:first-child a { border:0; } 
     10.admin_links li a:hover { background:#C47330; } 
     11.admin_links li a.on {background:#C28D61;} 
     12</style> 
    513  </r:with> 
    614   
    7   <r:with part='body/container'> 
    8     <div id='context' do='void' name='context'> 
    9       <ul> 
    10         <li do='admin_links'><a href='#'>do this</a></li> 
    11       </ul> 
     15  <r:with part='context'> 
     16    <ul class='admin_links'> 
     17      <li do='admin_links'><a href='#'>do this</a></li> 
     18    </ul> 
     19  </r:with> 
     20   
     21  <r:with part='content' do='content_for_layout'> 
     22    <div id='main'> 
     23      <h2><r:trans>home of</r:trans> <r:show attr='fullname'>Panther Tigris</r:show></h2> 
    1224    </div> 
    13     <r:content_for_layout> 
    14       <div id='content' do='void' name='content'> 
    15         <div id='main' do='void' name='main'> 
    16           <h2><r:trans>home of</r:trans> <r:show attr='fullname'>Panther Tigris</r:show></h2> 
    17         </div> 
    1825 
    19         <div id='related' do='void' name='related'> 
    20           <ul class='actions' do='user'> 
    21             <li do='to_publish'><r:trans>to publish</r:trans> 
    22               <ul class='list'> 
    23                 <li do='each' set_class='li_s[status]'><r:link/></li> 
    24               </ul> 
    25             </li> 
    26             <li do='comments_to_publish'><r:trans>comments to publish</r:trans> 
    27               <ul class='list'> 
    28                 <li do='each'><r:show attr='title'/></li> 
    29               </ul> 
    30             </li> 
    31             <li do='proposed'><r:trans>waiting for publication</r:trans> 
    32               <ul class='list'> 
    33                 <li do='each'><r:link/></li> 
    34               </ul> 
    35             </li> 
    36             <li do='redactions'><r:trans>redactions</r:trans> 
    37               <ul class='list'> 
    38                 <li do='each' set_class='li_s[status]'><r:link/></li> 
    39               </ul> 
    40             </li> 
    41           </ul> 
    42         </div> 
    43       </div> 
    44     </r:content_for_layout> 
     26    <div id='related'> 
     27      <r:user> 
     28        <r:to_publish> 
     29          <h3 class='group' do='trans'>to publish</h3> 
     30          <ol> 
     31            <li do='each' set_class='li_s[status]'><r:link/></li> 
     32          </ol> 
     33        </r:to_publish> 
     34 
     35        <r:comments_to_publish> 
     36          <h3 class='group' do='trans'>comments to publish</h3> 
     37          <ol> 
     38            <li do='each'><r:show attr='title'/></li> 
     39          </ol> 
     40        </r:comments_to_publish> 
     41 
     42        <r:proposed> 
     43          <h3 class='group' do='trans'>waiting for publication</h3> 
     44          <ol> 
     45            <li do='each' set_class='li_s[status]'><r:link/></li> 
     46          </ol> 
     47        </r:proposed> 
     48 
     49        <r:redactions> 
     50          <h3 class='group' do='trans'>redactions</h3> 
     51          <ol> 
     52            <li do='each' set_class='li_s[status]'><r:link/></li> 
     53          </ol> 
     54        </r:redactions> 
     55      </r:user> 
     56    </div> 
    4557  </r:with> 
    4658</r:include> 
  • trunk/db/init/base/skins/default/Node_login.html

    r540 r648  
    6060</style> 
    6161</r:with> 
    62   <r:with part='body/navigation/menu'/> 
    63   <r:with part='body/container'> 
     62  <r:with part='menu'/> 
     63  <r:with part='container'> 
    6464    <div id='login_form'><div> 
    6565      <form action="/session" method="post">    <table> 
     
    7777      </form></div></div> 
    7878  </r:with> 
    79   <r:with part='body/siteinfo'/> 
     79  <r:with part='siteinfo'/> 
    8080</r:include> 
  • trunk/db/init/base/skins/default/Node_not_found.html

    r540 r648  
    11<r:include template='layout.html'> 
    2   <r:with part='body/navigation/menu'/> 
    3   <r:with part='body/container'> 
     2  <r:with part='menu'/> 
     3  <r:with part='container'> 
    44    <div id="not_found"><div> 
    55      <p><b><r:trans>Sorry, the requested page could not be found.</r:trans></b></p> 
  • trunk/db/init/base/skins/default/Node_search.html

    r540 r648  
    11<r:include template='layout.html'> 
    2   <r:with part='body/container/context'/> 
     2  <r:with part='context'/> 
    33 
    4   <r:with part='body/container/content/main'> 
     4  <r:with part='main'> 
    55     
    66    <h2 do=trans>search results</h2> 
  • trunk/db/init/base/skins/default/Node_tree.html

    r540 r648  
    11<r:include template='layout.html'> 
    2   <r:with part='body/navigation/menu'/> 
     2  <r:with part='menu'/> 
    33   
    4   <r:with part='body/container/content/main'> 
     4  <r:with part='main'> 
    55  <div class='header'><h1 do='title' class='s30' status='true' actions='all'>this is the title</h1></div> 
    66    <ul class='tree' do='nodes'> 
  • trunk/db/init/base/skins/default/Project.html

    r637 r648  
    11<r:include template='layout.html'> 
    2   <r:with part='head/stylesheets'> 
     2  <r:with part='stylesheets'> 
    33    <r:stylesheets list='reset,zena,code,calendars'/> 
    44    <link href="default.css" rel="Stylesheet" type="text/css"/> 
    55  </r:with> 
    6   <r:with part='body/container/context'> 
     6  <r:with part='context'> 
    77    <div id='small_calendar' do='calendar' find='notes' or='added_notes'/> 
    88    <r:hot> 
     
    1414    </r:hot> 
    1515  </r:with> 
    16   <r:with part='body/container/content/main'> 
     16  <r:with part='main'> 
    1717     
    1818    <r:home> 
    19       <r:include template='layout.html' part='body/container/content/main/title'/> 
     19      <r:include template='layout.html' part='title'/> 
    2020      <r:summary text=''/> 
    2121      <r:text/> 
    2222      <r:else> 
    23         <r:include template='layout.html' part='body/container/content/main/title'/> 
     23        <r:include template='layout.html' part='title'/> 
    2424      </r:else> 
    2525    </r:home> 
  • trunk/db/init/base/skins/default/default.css

    r615 r648  
    2424 
    2525/* menu. see below for styling */ 
    26 #nav_menu { z-index:9999; position:absolute; top:25px; left:260px;} 
    27 #nav_menu li    { float:left; position:relative; } 
    28 #nav_menu li ul { position:absolute; left:-1px; width:10em; } 
    29 #nav_menu li ul li { float:none; } 
    30 #nav_menu li ul li ul { position:absolute; left:10em; top:-1px;} 
     26#menu { z-index:9999; position:absolute; top:25px; left:260px;} 
     27#menu li    { float:left; position:relative; } 
     28#menu li ul { position:absolute; left:-1px; width:10em; } 
     29#menu li ul li { float:none; } 
     30#menu li ul li ul { position:absolute; left:10em; top:-1px;} 
    3131/* if IE was any good we could use 
    32 #nav_menu li       > ul { display:none;  } 
    33 #nav_menu li:hover > ul { display:block; } 
     32#menu li       > ul { display:none;  } 
     33#menu li:hover > ul { display:block; } 
    3434but we have to use :*/ 
    35 #nav_menu li       ul { display:none;  } 
    36 #nav_menu li:hover ul { display:block; } 
    37 #nav_menu li:hover ul li       ul { display:none;  } 
    38 #nav_menu li:hover ul li:hover ul { display:block; } 
    39 #nav_menu li:hover ul li:hover ul li       ul { display:none;  } 
    40 #nav_menu li:hover ul li:hover ul li:hover ul { display:block; } 
    41 #nav_menu li:hover ul li:hover ul li:hover ul li       ul { display:none;  } 
    42 #nav_menu li:hover ul li:hover ul li:hover ul li:hover ul { display:block; } 
    43 #nav_menu li:hover ul li:hover ul li:hover ul li:hover ul li       ul { display:none;  } 
    44 #nav_menu li:hover ul li:hover ul li:hover ul li:hover ul li:hover ul { display:block; } 
     35#menu li       ul { display:none;  } 
     36#menu li:hover ul { display:block; } 
     37#menu li:hover ul li       ul { display:none;  } 
     38#menu li:hover ul li:hover ul { display:block; } 
     39#menu li:hover ul li:hover ul li       ul { display:none;  } 
     40#menu li:hover ul li:hover ul li:hover ul { display:block; } 
     41#menu li:hover ul li:hover ul li:hover ul li       ul { display:none;  } 
     42#menu li:hover ul li:hover ul li:hover ul li:hover ul { display:block; } 
     43#menu li:hover ul li:hover ul li:hover ul li:hover ul li       ul { display:none;  } 
     44#menu li:hover ul li:hover ul li:hover ul li:hover ul li:hover ul { display:block; } 
    4545/* end IE */ 
    4646 
     
    8484b, strong { font-weight:bold;  } 
    8585i, em     { font-style:italic; } 
    86 .zazen i, .zazen em     { font-style:italic; } 
     86.tinycal em { font-style:normal;} 
     87 
    8788/* inline forms */ 
    8889.inline_form { margin:2px; padding:3px; background:#9FA6AC; border:1px dotted grey; font-size:80%;} 
     
    119120 
    120121/* menu */ 
    121 #nav_menu { background-color:#F3F2E8; } 
    122 #nav_menu li { border:solid grey; border-width:0 1px 1px 0px; background-color:#F3F2E8; } 
    123 #nav_menu a  { display:block; color:black; padding:1px 8px 3px; font:1.1em Georgia, Times, serif;} 
    124 #nav_menu li:first-child { border-left-width:1px; } 
    125 #nav_menu li:hover { background-color:#D3D0B0;} 
    126 #nav_menu li ul { border:solid grey; border-width:1px 1px 0; background-color:#F3F2E8; } 
    127 #nav_menu li ul li { width:100%; border:solid grey; border-width:0 0 1px; } 
    128 #nav_menu li ul li:first-child { border-left-width:0; } 
     122#menu { background-color:#F3F2E8; } 
     123#menu li { border:solid grey; border-width:0 1px 1px 0px; background-color:#F3F2E8; } 
     124#menu a  { display:block; color:black; padding:1px 8px 3px; font:1.1em Georgia, Times, serif;} 
     125#menu li:first-child { border-left-width:1px; } 
     126#menu li:hover { background-color:#D3D0B0;} 
     127#menu li ul { border:solid grey; border-width:1px 1px 0; background-color:#F3F2E8; } 
     128#menu li ul li { width:100%; border:solid grey; border-width:0 0 1px; } 
     129#menu li ul li:first-child { border-left-width:0; } 
    129130 
    130131/* branding */ 
     
    155156#related .group { font-size:1em; font-weight:normal;} 
    156157#related ol { margin-left:1.5em; margin-bottom:0; } 
     158#tinycal { font-size:0.75em;} 
     159#tinycal td {line-height:1.5em;} 
     160#tinycal .head a { font-size:1em; font-weight:bold;} 
    157161 
    158162/* site info */ 
  • trunk/db/init/base/skins/default/layout.html

    r637 r648  
    1717 
    1818<body do='void' name='body'> 
    19   <div id='navigation' do='void' name='navigation'
    20     <div id='nav_main' do='void' name='main'
     19  <div id='navigation'
     20    <div id='nav_main'
    2121      <div id='lang' do='lang_links'><a>en</a> | <b>fr</b></div> 
    22       <div id='path' do='show_path'><ul><li><a href='#'>first</a></li> / <li><a href='#'>second</a></li> / <li><a href='#' class='current'>here</a></li></ul></div> 
     22      <div id='path' do='show_path' join=' / '><ul><li><a href='#'>first</a></li> / <li><a href='#'>second</a></li> / <li><a href='#' class='current'>here</a></li></ul></div> 
    2323      <div id='login' do='login_link'><a href='#'>login</a></div> 
    2424      <div id='visitor' do='visitor_link'><a href='#'>visitor name</a></div> 
    25       <div id='search' do='search_box'><div class='search'><form><input type='text' id='search' name='search'/></form></div></div> 
     25      <div id='search' do='search_box'><div class='search'><form><input type='text' name='search'/></form></div></div> 
    2626    </div> 
    2727 
    28     <div id='nav_menu' do='void' name='menu'> 
     28    <div id='menu'> 
    2929      <ul do='root' do='pages'> 
    3030        <li do='each'><r:link attr='name'/> 
     
    3535      </ul> 
    3636    </div> 
    37     <r:void name='branding'> 
    38       <div id='branding' do='root' do='link' href='root'><r:icon><r:img mode='full'/><r:else><img src='/img/logo.png' width='220' height='100' alt='logo'/></r:else></r:icon></div> 
    39     </r:void> 
     37    <div id='branding' do='root' do='link' href='root'><r:icon><r:img mode='full'/><r:else><img src='/img/logo.png' width='220' height='100' alt='logo'/></r:else></r:icon></div> 
    4038  </div> 
    4139 
     
    4442 
    4543  <r:void name='container'> 
    46     <div id='context' do='void' name='context'
     44    <div id='context'
    4745    </div> 
    4846 
    4947 
    50     <div id='content' do='content_for_layout' name='content'
    51       <div id='main' do='void' name='main'
    52         <div class='title' do='void' name='title'> 
     48    <div id='content' do='content_for_layout'
     49      <div id='main'
     50        <div id='title'> 
    5351          <r:if kind_of='Document'><p class="document"><r:link format="data"><r:img mode='pv'/></r:link></p></r:if> 
    5452          <h1 do='title' class='s30' status='true' actions='all'>this is the title</h1> 
     
    6765      </div> 
    6866 
    69       <div id='related' do='void' name='related'
     67      <div id='related'
    7068          <r:documents name='documents'><h3 class='group'>documents</h3> 
    7169            <ol> 
     
    8886    </div> 
    8987  </r:void> 
    90   <ul id='siteinfo' do='void' name='siteinfo'
     88  <ul id='siteinfo'
    9189    <li do='design' skin='default' by='teti.ch' href='http://teti.ch'/> 
    9290    <li do='zena' version='true' type='garden'/> 
  • trunk/lib/parser/lib/parser.rb

    r637 r648  
    4646 
    4747class Parser 
    48   attr_accessor :text, :method, :pass, :options, :blocks, :params, :name 
     48  attr_accessor :text, :method, :pass, :options, :blocks, :params, :ids, :defined_ids 
    4949     
    5050  class << self 
     
    8888    @params  = @options[:params] 
    8989    @method  = @options[:method] 
     90    @ids     = @options[:ids] ||= {} 
     91    original_ids = @ids.dup 
     92    @defined_ids = {} # ids defined in this node or this node's sub blocks 
    9093    mode     = @options[:mode] 
    9194    @options.delete(:params) 
     
    101104     
    102105    start(mode) 
    103      
    104106    # set name 
    105     @name = @params[:name] if @params 
     107    if @params && @name = (@params[:id] || @params[:name]) 
     108      @options[:ids][@name] = self 
     109    end 
    106110     
    107111    unless opts[:sub] 
    108112      @text = after_parse(@text) 
     113    end 
     114    @ids.keys.each do |k| 
     115      if original_ids[k] != @ids[k] 
     116        @defined_ids[k] = @ids[k] 
     117      end 
    109118    end 
    110119    @ok 
     
    119128    @blocks   = obj.blocks.empty? ? @blocks : obj.blocks 
    120129    @params   = obj.params.empty? ? @params : obj.params 
     130    @params[:id] = @name 
    121131  end 
    122132   
     
    128138    return '' if context["no_#{@method}".to_sym] 
    129139    if @name 
    130       path = (context[:path] || []) + [@name] 
    131       @context = context.merge(:path => path) 
     140      @context = context.merge(:name => @name) 
    132141    else 
    133142      @context = context 
     
    204213  def include_template 
    205214    if @options[:part] && @options[:part] == @params[:part] 
    206       # fetching only a part, do not open this element (same as original caller) as it is useless and will make use loop the loop. 
     215      # fetching only a part, do not open this element (same as original caller) as it is useless and will make us loop the loop. 
    207216      @method = 'ignore' 
    208217      enter(:void) 
     
    210219    end 
    211220    @method = 'void' 
    212     text    = @text 
    213221     
    214222    # fetch text 
    215223    @options[:included_history] ||= [] 
    216224     
    217     @text, absolute_url = self.class.get_template_text(@params[:template], @options[:helper], @options[:current_folder]) 
    218      
    219     absolute_url += "::#{@params[:part].gsub('/','_')}" if @params[:part] 
     225    included_text, absolute_url = self.class.get_template_text(@params[:template], @options[:helper], @options[:current_folder]) 
     226     
     227    absolute_url += "::#{@params[:part].gsub('/','_')}" if @params[:part] 
    220228    absolute_url += "??#{@options[:part].gsub('/','_')}" if @options[:part] 
    221229    if absolute_url 
    222230      if @options[:included_history].include?(absolute_url) 
    223         @text = "<span class='parser_error'>[include error: #{(@options[:included_history] + [absolute_url]).join(' --&gt; ')} ]</span>" 
    224       else 
    225         @options[:included_history] += [absolute_url] 
    226         @options[:current_folder]    = absolute_url.split('/')[1..-2].join('/') 
    227       end 
    228     end 
    229      
    230     @text = before_parse(@text) 
     231        included_text = "<span class='parser_error'>[include error: #{(@options[:included_history] + [absolute_url]).join(' --&gt; ')} ]</span>" 
     232      else 
     233        included_history  = @options[:included_history] + [absolute_url] 
     234        current_folder    = absolute_url.split('/')[1..-2].join('/') 
     235      end 
     236    end 
     237    res = self.class.new(included_text, :helper=>@options[:helper], :current_folder=>current_folder, :included_history=>included_history, :part => @params[:part]) # we set :part to avoid loop failure when doing self inclusion 
     238     
    231239    if @params[:part] 
    232       part_bak = @options[:part] 
    233       @options[:part] = @params[:part] 
    234       enter(:void) # scan fetched text 
    235       @options[:part] = part_bak 
    236       included_blocks = [find_part(@blocks, @params[:part])] 
    237     else 
    238       enter(:void) # scan fetched text 
    239       included_blocks = @blocks 
    240     end 
    241     @blocks = [] 
    242     @text   = text 
     240      if iblock = res.ids[@params[:part]] 
     241        included_blocks = [iblock] 
     242        # get all ids from inside the included part: 
     243        @ids.merge! iblock.defined_ids 
     244      else 
     245        included_blocks = ["<span class='parser_error'>'#{@params[:part]}' not found in template '#{@params[:template]}'</span>"] 
     246      end 
     247    else 
     248      included_blocks = res.blocks 
     249      @ids.merge! res.ids 
     250    end 
     251     
    243252    enter(:void) # normal scan on content 
    244253    # replace 'with' 
     254    not_found = [] 
    245255    @blocks.each do |b| 
    246256      next if b.kind_of?(String) || b.method != 'with' 
    247       if target = find_part(included_blocks, b.params[:part]) 
     257      if target = res.ids[b.params[:part]] 
    248258        if target.kind_of?(String) 
    249259          # error 
     
    251261          target.method = 'ignore' 
    252262        else 
    253           name = target.params[:name] 
    254           target.replace_with(b) if !target.kind_of?(String) 
    255           target.params[:name] = name # make sure it is kept during 'replace' 
     263          target.replace_with(b) 
    256264        end 
    257265      else 
    258266        # part not found 
    259       end 
    260     end 
    261     @blocks = included_blocks 
    262   end 
    263    
    264   def find_part(blocks, path) 
    265     res    = self 
    266     found  = [] 
    267     path.split('/').reject {|e| e==''}.each do |name| 
    268       if res = find_name(blocks, name) 
    269         found << name 
    270         blocks = res.blocks 
    271       else 
    272         return "<span class='parser_error'>'#{(found + [name]).join('/')}' not found in template '#{@params[:template]}'</span>" 
    273       end 
    274     end 
    275     res 
    276   end 
    277    
    278   def find_name(blocks, name) 
    279     blocks.each do |b| 
    280       next if b.kind_of?(String) 
    281       return b if b.name == name 
    282       next if b.name # bad name 
    283       if res = find_name(b.blocks,name) 
    284         return res 
    285       end 
    286     end 
    287     return nil 
     267        not_found << "<span class='parser_error'>'#{b.params[:part]}' not found in template '#{@params[:template]}'</span>" 
     268      end 
     269    end 
     270    @blocks = included_blocks + not_found 
    288271  end 
    289272   
     
    349332    text = custom_text || @text 
    350333    opts = @options.merge(opts).merge(:sub=>true, :mode=>mode) 
     334     
    351335    new_obj = self.class.new(text,opts) 
    352336    if new_obj.success? 
     
    381365  def parse_params(text) 
    382366    return {} unless text 
     367    return text if text.kind_of?(Hash) 
    383368    params = {} 
    384369    rest = text.strip 
  • trunk/lib/parser/lib/rules/zafu.rb

    r603 r648  
    2020      unless @html_tag 
    2121        if @params[:id] || @params[:class] 
    22           @html_tag = @params[:tag] || 'div' 
     22          @html_tag = @params[:tag] 
    2323          @params.delete(:tag) 
    2424          @html_tag_params = {} 
    2525          [:id, :class].each do |k| 
    2626            @html_tag_params[k] = @params[k] if @params[k] 
    27             @params.delete(k) 
    2827          end 
    2928        end 
     
    210209        end 
    211210      end 
     211      # inclusion id 
     212      @params[:id] ||= @html_tag_params[:id] if @html_tag_params[:id] 
    212213    end 
    213214     
     
    291292        make(:void, opts) 
    292293      elsif @text =~ /\A<(\w+)([^>]*?)do\s*=('([^>]*?[^\\]|)'|"([^>]*?[^\\]|)")([^>]*?)(\/?)>/ 
    293         # puts "DO:#{$~.to_a.inspect}" # do tag 
     294        #puts "DO:#{$~.to_a.inspect}" # do tag 
    294295        eat $& 
    295296        opts.merge!(:method=>($4||$5), :html_tag=>$1, :html_tag_params=>$2, :params=>$6) 
    296297        opts.merge!(:text=>'') if $7 != '' 
    297298        make(:void, opts) 
    298       elsif @end_tag && @text =~ /\A<#{@end_tag}([^>]*?)(\/?)>/ 
    299         # puts "SAME:#{$~.to_a.inspect}" # simple html tag same as end_tag 
    300         flush $& 
    301         @end_tag_count += 1 unless $2 == '/' 
    302       elsif @text =~ /\A<(link|img|script)/ 
    303         # puts "HTML:[#{$&}]" # html 
    304         make(:asset) 
    305299      elsif @options[:form] && @text =~ /\A<(input|textarea|form)([^>]*?)(\/?)>/ 
    306300        eat $& 
     
    310304        opts.merge!(:end_tag=>'form') if method == 'form_tag' 
    311305        make(:void, opts) 
     306      elsif @text =~ /\A<(\w+)([^>]*?)id\s*=('[^>]*?[^\\]'|"[^>]*?[^\\]")([^>]*?)(\/?)>/ 
     307        #puts "ID:#{$~.to_a.inspect}" # id tag 
     308        eat $& 
     309        opts.merge!(:method=>'void', :html_tag=>$1, :params=>{:id => $3[1..-2]}, :html_tag_params=>"#{$2}id=#{$3}#{$4}") 
     310        opts.merge!(:text=>'') if $5 != '' 
     311        make(:void, opts) 
     312      elsif @end_tag && @text =~ /\A<#{@end_tag}([^>]*?)(\/?)>/ 
     313        #puts "SAME:#{$~.to_a.inspect}" # simple html tag same as end_tag 
     314        flush $& 
     315        @end_tag_count += 1 unless $2 == '/' 
     316      elsif @text =~ /\A<(link|img|script)/ 
     317    &nbs