Changeset 648
- Timestamp:
- 2007-06-21 16:16:20 (2 years ago)
- Files:
-
- trunk/TODO (modified) (1 diff)
- trunk/app/helpers/application_helper.rb (modified) (2 diffs)
- trunk/app/models/document.rb (modified) (1 diff)
- trunk/app/views/comments/list.rhtml (modified) (1 diff)
- trunk/app/views/groups/index.rhtml (modified) (1 diff)
- trunk/app/views/relations/index.erb (modified) (1 diff)
- trunk/app/views/users/index.rhtml (modified) (1 diff)
- trunk/app/views/users/preferences.html.erb (modified) (1 diff)
- trunk/app/views/virtual_classes/index.erb (modified) (1 diff)
- trunk/db/init/base/skins/default/Contact.html (modified) (1 diff)
- trunk/db/init/base/skins/default/Node.html (modified) (2 diffs)
- trunk/db/init/base/skins/default/Node_admin_layout.html (modified) (1 diff)
- trunk/db/init/base/skins/default/Node_login.html (modified) (2 diffs)
- trunk/db/init/base/skins/default/Node_not_found.html (modified) (1 diff)
- trunk/db/init/base/skins/default/Node_search.html (modified) (1 diff)
- trunk/db/init/base/skins/default/Node_tree.html (modified) (1 diff)
- trunk/db/init/base/skins/default/Project.html (modified) (2 diffs)
- trunk/db/init/base/skins/default/default.css (modified) (4 diffs)
- trunk/db/init/base/skins/default/layout.html (modified) (5 diffs)
- trunk/lib/parser/lib/parser.rb (modified) (10 diffs)
- trunk/lib/parser/lib/rules/zafu.rb (modified) (4 diffs)
- trunk/lib/parser/lib/rules/zena.rb (modified) (3 diffs)
- trunk/lib/parser/test/parser_test.rb (modified) (2 diffs)
- trunk/lib/parser/test/zafu.yml (modified) (7 diffs)
- trunk/po/en/zena.po (modified) (2 diffs)
- trunk/public/stylesheets/admin.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/TODO
r637 r648 15 15 Tag ==> VirtualClass ? 16 16 Tracker => VirtualClass 17 18 * add zafu part by object id. <h1 id='title'>...</h1> <r:with id='part'>...</r:with> 17 19 18 20 * replace 'link_to_remote, :method => post/put' by 'button_to_remote' trunk/app/helpers/application_helper.rb
r645 r648 889 889 node = opts[:node] || @node 890 890 tag = opts[:tag] || 'li' 891 join = opts[:join] || ' /'891 join = opts[:join] || '' 892 892 nav = [] 893 893 node.ancestors.each do |obj| … … 896 896 897 897 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}>" 899 899 end 900 900 trunk/app/models/document.rb
r599 r648 103 103 end 104 104 105 def rootpath 106 super + ".#{version.content.ext}" 107 end 108 105 109 private 106 110 trunk/app/views/comments/list.rhtml
r512 r648 1 <div id='content'> 2 <h3><%= _('manage comments') %></h3> 1 <h3><%= _('manage comments') %></h3> 3 2 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> 7 6 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 %> 10 9 11 <div id='bin'> 12 <%= render :partial=>'comments/bin' %> 13 </div> 10 <div id='bin'> 11 <%= render :partial=>'comments/bin' %> 14 12 </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> 12 2 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'>2 1 <h3><%= @user.fullname %> : <%= _('preferences') %> </h3> 3 2 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> 12 2 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 1 1 <r:include template='layout.html'> 2 <r:with part=' body/container/content/main'>2 <r:with part='main'> 3 3 <h1 do='title' attr='c_fullname' actions='all'>Gaspard Bucher</h1> 4 4 </r:with> trunk/db/init/base/skins/default/Node.html
r549 r648 1 1 <r:include template='layout.html'> 2 <r:with part=' body/container/context'>2 <r:with part='context'> 3 3 <r:project> 4 4 <h2 do='show' attr='name'>zena</h2> … … 14 14 </r:project> 15 15 </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'/> 18 18 19 19 <r:summary text=''/> trunk/db/init/base/skins/default/Node_admin_layout.html
r566 r648 1 1 <r:include template='layout.html'> 2 <r:with part=' head/stylesheets'>2 <r:with part='stylesheets'> 3 3 <r:stylesheets list='reset,zena,comment,admin,search'/> 4 4 <link href="default.css" rel="Stylesheet" type="text/css"/> 5 <style> 6 ul.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> 5 13 </r:with> 6 14 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> 12 24 </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>18 25 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> 45 57 </r:with> 46 58 </r:include> trunk/db/init/base/skins/default/Node_login.html
r540 r648 60 60 </style> 61 61 </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'> 64 64 <div id='login_form'><div> 65 65 <form action="/session" method="post"> <table> … … 77 77 </form></div></div> 78 78 </r:with> 79 <r:with part=' body/siteinfo'/>79 <r:with part='siteinfo'/> 80 80 </r:include> trunk/db/init/base/skins/default/Node_not_found.html
r540 r648 1 1 <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'> 4 4 <div id="not_found"><div> 5 5 <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 1 1 <r:include template='layout.html'> 2 <r:with part=' body/container/context'/>2 <r:with part='context'/> 3 3 4 <r:with part=' body/container/content/main'>4 <r:with part='main'> 5 5 6 6 <h2 do=trans>search results</h2> trunk/db/init/base/skins/default/Node_tree.html
r540 r648 1 1 <r:include template='layout.html'> 2 <r:with part=' body/navigation/menu'/>2 <r:with part='menu'/> 3 3 4 <r:with part=' body/container/content/main'>4 <r:with part='main'> 5 5 <div class='header'><h1 do='title' class='s30' status='true' actions='all'>this is the title</h1></div> 6 6 <ul class='tree' do='nodes'> trunk/db/init/base/skins/default/Project.html
r637 r648 1 1 <r:include template='layout.html'> 2 <r:with part=' head/stylesheets'>2 <r:with part='stylesheets'> 3 3 <r:stylesheets list='reset,zena,code,calendars'/> 4 4 <link href="default.css" rel="Stylesheet" type="text/css"/> 5 5 </r:with> 6 <r:with part=' body/container/context'>6 <r:with part='context'> 7 7 <div id='small_calendar' do='calendar' find='notes' or='added_notes'/> 8 8 <r:hot> … … 14 14 </r:hot> 15 15 </r:with> 16 <r:with part=' body/container/content/main'>16 <r:with part='main'> 17 17 18 18 <r:home> 19 <r:include template='layout.html' part=' body/container/content/main/title'/>19 <r:include template='layout.html' part='title'/> 20 20 <r:summary text=''/> 21 21 <r:text/> 22 22 <r:else> 23 <r:include template='layout.html' part=' body/container/content/main/title'/>23 <r:include template='layout.html' part='title'/> 24 24 </r:else> 25 25 </r:home> trunk/db/init/base/skins/default/default.css
r615 r648 24 24 25 25 /* 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;} 31 31 /* 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; } 34 34 but 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; } 45 45 /* end IE */ 46 46 … … 84 84 b, strong { font-weight:bold; } 85 85 i, em { font-style:italic; } 86 .zazen i, .zazen em { font-style:italic; } 86 .tinycal em { font-style:normal;} 87 87 88 /* inline forms */ 88 89 .inline_form { margin:2px; padding:3px; background:#9FA6AC; border:1px dotted grey; font-size:80%;} … … 119 120 120 121 /* 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; } 129 130 130 131 /* branding */ … … 155 156 #related .group { font-size:1em; font-weight:normal;} 156 157 #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;} 157 161 158 162 /* site info */ trunk/db/init/base/skins/default/layout.html
r637 r648 17 17 18 18 <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'> 21 21 <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> 23 23 <div id='login' do='login_link'><a href='#'>login</a></div> 24 24 <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> 26 26 </div> 27 27 28 <div id=' nav_menu' do='void' name='menu'>28 <div id='menu'> 29 29 <ul do='root' do='pages'> 30 30 <li do='each'><r:link attr='name'/> … … 35 35 </ul> 36 36 </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> 40 38 </div> 41 39 … … 44 42 45 43 <r:void name='container'> 46 <div id='context' do='void' name='context'>44 <div id='context'> 47 45 </div> 48 46 49 47 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'> 53 51 <r:if kind_of='Document'><p class="document"><r:link format="data"><r:img mode='pv'/></r:link></p></r:if> 54 52 <h1 do='title' class='s30' status='true' actions='all'>this is the title</h1> … … 67 65 </div> 68 66 69 <div id='related' do='void' name='related'>67 <div id='related'> 70 68 <r:documents name='documents'><h3 class='group'>documents</h3> 71 69 <ol> … … 88 86 </div> 89 87 </r:void> 90 <ul id='siteinfo' do='void' name='siteinfo'>88 <ul id='siteinfo'> 91 89 <li do='design' skin='default' by='teti.ch' href='http://teti.ch'/> 92 90 <li do='zena' version='true' type='garden'/> trunk/lib/parser/lib/parser.rb
r637 r648 46 46 47 47 class Parser 48 attr_accessor :text, :method, :pass, :options, :blocks, :params, : name48 attr_accessor :text, :method, :pass, :options, :blocks, :params, :ids, :defined_ids 49 49 50 50 class << self … … 88 88 @params = @options[:params] 89 89 @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 90 93 mode = @options[:mode] 91 94 @options.delete(:params) … … 101 104 102 105 start(mode) 103 104 106 # set name 105 @name = @params[:name] if @params 107 if @params && @name = (@params[:id] || @params[:name]) 108 @options[:ids][@name] = self 109 end 106 110 107 111 unless opts[:sub] 108 112 @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 109 118 end 110 119 @ok … … 119 128 @blocks = obj.blocks.empty? ? @blocks : obj.blocks 120 129 @params = obj.params.empty? ? @params : obj.params 130 @params[:id] = @name 121 131 end 122 132 … … 128 138 return '' if context["no_#{@method}".to_sym] 129 139 if @name 130 path = (context[:path] || []) + [@name] 131 @context = context.merge(:path => path) 140 @context = context.merge(:name => @name) 132 141 else 133 142 @context = context … … 204 213 def include_template 205 214 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 us eloop 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. 207 216 @method = 'ignore' 208 217 enter(:void) … … 210 219 end 211 220 @method = 'void' 212 text = @text213 221 214 222 # fetch text 215 223 @options[:included_history] ||= [] 216 224 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] 220 228 absolute_url += "??#{@options[:part].gsub('/','_')}" if @options[:part] 221 229 if absolute_url 222 230 if @options[:included_history].include?(absolute_url) 223 @text = "<span class='parser_error'>[include error: #{(@options[:included_history] + [absolute_url]).join(' --> ')} ]</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(' --> ')} ]</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 231 239 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 243 252 enter(:void) # normal scan on content 244 253 # replace 'with' 254 not_found = [] 245 255 @blocks.each do |b| 246 256 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]] 248 258 if target.kind_of?(String) 249 259 # error … … 251 261 target.method = 'ignore' 252 262 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) 256 264 end 257 265 else 258 266 # 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 288 271 end 289 272 … … 349 332 text = custom_text || @text 350 333 opts = @options.merge(opts).merge(:sub=>true, :mode=>mode) 334 351 335 new_obj = self.class.new(text,opts) 352 336 if new_obj.success? … … 381 365 def parse_params(text) 382 366 return {} unless text 367 return text if text.kind_of?(Hash) 383 368 params = {} 384 369 rest = text.strip trunk/lib/parser/lib/rules/zafu.rb
r603 r648 20 20 unless @html_tag 21 21 if @params[:id] || @params[:class] 22 @html_tag = @params[:tag] || 'div'22 @html_tag = @params[:tag] 23 23 @params.delete(:tag) 24 24 @html_tag_params = {} 25 25 [:id, :class].each do |k| 26 26 @html_tag_params[k] = @params[k] if @params[k] 27 @params.delete(k)28 27 end 29 28 end … … 210 209 end 211 210 end 211 # inclusion id 212 @params[:id] ||= @html_tag_params[:id] if @html_tag_params[:id] 212 213 end 213 214 … … 291 292 make(:void, opts) 292 293 elsif @text =~ /\A<(\w+)([^>]*?)do\s*=('([^>]*?[^\\]|)'|"([^>]*?[^\\]|)")([^>]*?)(\/?)>/ 293 # puts "DO:#{$~.to_a.inspect}" # do tag294 #puts "DO:#{$~.to_a.inspect}" # do tag 294 295 eat $& 295 296 opts.merge!(:method=>($4||$5), :html_tag=>$1, :html_tag_params=>$2, :params=>$6) 296 297 opts.merge!(:text=>'') if $7 != '' 297 298 make(:void, opts) 298 elsif @end_tag && @text =~ /\A<#{@end_tag}([^>]*?)(\/?)>/299 # puts "SAME:#{$~.to_a.inspect}" # simple html tag same as end_tag300 flush $&301 @end_tag_count += 1 unless $2 == '/'302 elsif @text =~ /\A<(link|img|script)/303 # puts "HTML:[#{$&}]" # html304 make(:asset)305 299 elsif @options[:form] && @text =~ /\A<(input|textarea|form)([^>]*?)(\/?)>/ 306 300 eat $& … … 310 304 opts.merge!(:end_tag=>'form') if method == 'form_tag' 311 305 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
