Here's a modified version of <field-list> that takes a show-non- 
editable attribute

<def tag="field-list" attrs="tag, show-non-editable">
   <% tag ||= scope.in_form ? "input" : "view" %>
   <labelled-item-list merge-attrs="&attributes -  
attrs_for(:with_fields)">
     <with-fields merge-attrs="&attributes & attrs_for(:with_fields)">< 
% field_name = this_field_name %>
       <labelled-item unless="&tag == 'input' && !can_edit? && ! 
show_non_editable">
         <item-label param="#{this_field.to_s.sub('?', '')}-label"  
unless="&field_name.blank?">
           <do param="label"><%= field_name %></do>
         </item-label>
         <item-value param="#{this_field.to_s.sub('?', '')}-view"  
colspan="&2 if field_name.blank?">
           <do param="view"><call-tag tag="&tag"  
param="#{this_field.to_s.sub('?', '')}-tag"/></do>
           <div param="input-help" if="&tag.to_sym == :input && ! 
this_field_help.blank?"><%= this_field_help %></div>
         </item-value>
       </labelled-item>
     </with-fields>
   </labelled-item-list>
</def>


e.g. on an edit page

<edit-page>
   <form:><field-list: show-non-editable/></form:>
</edit-page>

(not tested!)

Tom


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to