% # repeated code means: refactor!
if(area.elemTypeBool(@base_view_el_type.DESC_AREA))
link_ids = Array.new -%>
<% area.elements.each do |area_elem| -%>
<%if(area_elem.elemTypeBool(@base_view_el_type.TEXT_BPV))-%>
<%=area_elem.val%>
<%end-%>
<%if(area_elem.elemTypeBool(@base_view_el_type.DESC_FRAGMENT))-%>
<% # TODO: here we're not allowing for links - fix %>
<%=area_elem.label.val%>
<%=area_elem.value.val%>
<%end-%>
<%if(area_elem.elemTypeBool(@base_view_el_type.DESC_BLOCK))-%>
<% if (area_elem.elements.size > 0) %>
<%=area_elem.title.val-%> | ||
<%=block_elem.label.val-%> | <%= render(:partial => "links_in_text", :locals => { :val => block_elem.value.val, :link_ids => link_ids }) -%> <% if ((block_elem.valueInShowableRepOrgGrp) && (block_elem.value.onDoOrVal.nodeToString != @desc.dObj.nodeToString)) img_base = block_elem.tmpValueImageURLBase img = KRLogic::ImgFileManager.get(img_base) has_img = (img != nil) is_root = kr_model.hasArchivalRootValue(block_elem) id = block_elem.valueLocalURIPart + link_ids.size.to_s link_ids << (id + "-img") if (has_img && !is_root) link_ids << id if (!is_root) link_ids << (id + "-grp") if (block_elem.isGroup) -%> <%= render(:partial => "linkable_df_value", :locals => { :df => block_elem, :id => id, :has_img => has_img, :img => img, :img_base => img_base, :is_root => is_root }) -%> <% end -%> | |
colspan=1> <%=block_elem.label.val-%> | <%block_section_elems.each_index do |block_sec_el_index| block_section_el = block_section_elems[block_sec_el_index]-%> <% if (block_sec_el_index > 0)-%>||
<%=block_section_el.label.val-%> | <%= render(:partial => "links_in_text", :locals => { :val => block_section_el.value.val, :link_ids => link_ids }) -%> <% if ((block_section_el.valueInShowableRepOrgGrp) && (block_section_el.value.onDoOrVal.nodeToString != @desc.dObj.nodeToString)) id = block_section_el.valueLocalURIPart + link_ids.size.to_s img_base = block_section_el.tmpValueImageURLBase img = KRLogic::ImgFileManager.get(img_base) has_img = (img != nil) is_root = kr_model.hasArchivalRootValue(block_section_el) link_ids << (id + "-img") if (has_img && !is_root) link_ids << id if (!is_root) link_ids << (id + "-grp") if (block_section_el.isGroup) -%> <%= render(:partial => "linkable_df_value", :locals => { :df => block_section_el, :id => id, :has_img => has_img, :img => img, :img_base => img_base, :is_root => is_root }) -%> <% end -%> | <%= block_section_el.val -%> | <%end%> <%end%> <%end%> <%end%> <%end%>