Changeset 1255
- Timestamp:
- 2008-11-14 12:53:23 (2 months ago)
- Files:
-
- trunk/app/models/user.rb (modified) (2 diffs)
- trunk/app/views/templates/defaults/+adminLayout.zafu (modified) (1 diff)
- trunk/db/init/base/skins/default/Node-+adminLayout.zafu (modified) (1 diff)
- trunk/lib/parser/lib/rules/zena.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/models/user.rb
r1232 r1255 23 23 class User < ActiveRecord::Base 24 24 zafu_readable :login, :initials, :fullname, :status, :status_name 25 zafu_context :contact => "Contact", :to_publish => ["Version"], :redactions => ["Version"], 26 :proposed => ["Version"], :comments_to_publish => ["Comment"] 25 zafu_context :contact => "Contact" 27 26 attr_accessible :login, :password, :lang, :first_name, :name, :email, :time_zone, :status, :group_ids, :site_ids 28 27 attr_accessor :visited_node_ids … … 312 311 313 312 def comments_to_publish 314 if i d == 2313 if is_su? 315 314 # su can view all 316 315 secure(Comment) { Comment.find(:all, :conditions => "status = '#{Zena::Status[:prop]}'") } trunk/app/views/templates/defaults/+adminLayout.zafu
r1254 r1255 30 30 <div id='content' do='content_for_layout'> 31 31 <div id='related'> 32 <r:user> 33 <r:to_publish> 34 <h3 class='group' do='trans'>to publish</h3> 35 <ol> 36 <li do='each' set_class='li_s[status]'><r:link/></li> 37 </ol> 38 </r:to_publish> 32 <r:to_publish> 33 <h3 class='group' do='trans'>to publish</h3> 34 <ol> 35 <li do='each' set_class='li_s[status]'><r:link/></li> 36 </ol> 37 </r:to_publish> 39 38 40 <r:comments_to_publish>41 <h3 class='group' do='trans'>comments to publish</h3>42 <ol>43 <li do='each'><r:show attr='title'/></li>44 </ol>45 </r:comments_to_publish>39 <r:comments_to_publish> 40 <h3 class='group' do='trans'>comments to publish</h3> 41 <ol> 42 <li do='each'><r:show attr='title'/></li> 43 </ol> 44 </r:comments_to_publish> 46 45 47 <r:proposed>48 <h3 class='group' do='trans'>waiting for publication</h3>49 <ol>50 <li do='each' set_class='li_s[status]'><r:link/></li>51 </ol>52 </r:proposed>46 <r:proposed> 47 <h3 class='group' do='trans'>waiting for publication</h3> 48 <ol> 49 <li do='each' set_class='li_s[status]'><r:link/></li> 50 </ol> 51 </r:proposed> 53 52 54 <r:redactions> 55 <h3 class='group' do='trans'>redactions</h3> 56 <ol> 57 <li do='each' set_class='li_s[status]'><r:link/></li> 58 </ol> 59 </r:redactions> 60 </r:user> 53 <r:redactions> 54 <h3 class='group' do='trans'>redactions</h3> 55 <ol> 56 <li do='each' set_class='li_s[status]'><r:link/></li> 57 </ol> 58 </r:redactions> 61 59 </div> 62 60 <div id='main'> trunk/db/init/base/skins/default/Node-+adminLayout.zafu
r1217 r1255 13 13 <r:with part='content' do='content_for_layout'> 14 14 <div id='related'> 15 <r:user> 16 <r:to_publish> 17 <h3 class='group' do='trans'>to publish</h3> 18 <ol> 19 <li do='each' set_class='li_s[status]'><r:link/></li> 20 </ol> 21 </r:to_publish> 15 <r:to_publish> 16 <h3 class='group' do='trans'>to publish</h3> 17 <ol> 18 <li do='each' set_class='li_s[status]'><r:link/></li> 19 </ol> 20 </r:to_publish> 22 21 23 <r:comments_to_publish>24 <h3 class='group' do='trans'>comments to publish</h3>25 <ol>26 <li do='each'><r:show attr='title'/></li>27 </ol>28 </r:comments_to_publish>22 <r:comments_to_publish> 23 <h3 class='group' do='trans'>comments to publish</h3> 24 <ol> 25 <li do='each'><r:show attr='title'/></li> 26 </ol> 27 </r:comments_to_publish> 29 28 30 <r:proposed>31 <h3 class='group' do='trans'>waiting for publication</h3>32 <ol>33 <li do='each' set_class='li_s[status]'><r:link/></li>34 </ol>35 </r:proposed>29 <r:proposed> 30 <h3 class='group' do='trans'>waiting for publication</h3> 31 <ol> 32 <li do='each' set_class='li_s[status]'><r:link/></li> 33 </ol> 34 </r:proposed> 36 35 37 <r:redactions> 38 <h3 class='group' do='trans'>redactions</h3> 39 <ol> 40 <li do='each' set_class='li_s[status]'><r:link/></li> 41 </ol> 42 </r:redactions> 43 </r:user> 36 <r:redactions> 37 <h3 class='group' do='trans'>redactions</h3> 38 <ol> 39 <li do='each' set_class='li_s[status]'><r:link/></li> 40 </ol> 41 </r:redactions> 44 42 </div> 45 43 <r:include template='Node' part='main'/> trunk/lib/parser/lib/rules/zena.rb
r1251 r1255 708 708 end 709 709 710 # FIXME: replace by zafu_known_contexts, each, etc 711 #def r_comments 712 # "<%= render :partial=>'comments/list', :locals=>{:node=>#{node}} %>" 713 #end 710 def r_comments_to_publish 711 open_context("visitor.comments_to_publish", :node_class => [Comment]) 712 end 713 714 def r_to_publish 715 open_context("visitor.to_publish", :node_class => [Version]) 716 end 717 718 def r_proposed 719 open_context("visitor.proposed", :node_class => [Version]) 720 end 721 722 def r_redactions 723 open_context("visitor.redactions", :node_class => [Version]) 724 end 714 725 715 726 def r_edit … … 1967 1978 context = node_class.zafu_known_contexts[method] 1968 1979 if context && @params.keys == [:select] 1969 klass = context[:node_class] 1970 # hack to store last 'Node' context until we fix node(Node) stuff: 1971 previous_node = node_kind_of?(Node) ? node : @context[:previous_node] 1972 if klass.kind_of?(Array) 1973 # plural 1974 do_list( "#{node}.#{method}", nil, context.merge(:node_class => klass[0], :previous_node => previous_node) ) 1975 else 1976 # singular 1977 do_var( "#{node}.#{method}", context.merge(:previous_node => previous_node) ) 1978 end 1980 open_context("#{node}.#{method}", context) 1979 1981 elsif node_kind_of?(Node) 1980 1982 count = ['first','all','count'].include?(@params[:find]) ? @params[:find].to_sym : nil … … 1997 1999 else 1998 2000 "unknown relation (#{method}) for #{node_class} class" 2001 end 2002 end 2003 2004 def open_context(finder, context) 2005 klass = context[:node_class] 2006 # hack to store last 'Node' context until we fix node(Node) stuff: 2007 previous_node = node_kind_of?(Node) ? node : @context[:previous_node] 2008 if klass.kind_of?(Array) 2009 # plural 2010 do_list( finder, nil, context.merge(:node_class => klass[0], :previous_node => previous_node) ) 2011 else 2012 # singular 2013 do_var( finder, context.merge(:previous_node => previous_node) ) 1999 2014 end 2000 2015 end
