app/helpers/cmsedit_helper.rb in drg_cms-0.5.3 vs app/helpers/cmsedit_helper.rb in drg_cms-0.5.5
- old
+ new
@@ -608,10 +608,22 @@
end
value
end
############################################################################
+# Creates top or bottom horizontal line on form.
+############################################################################
+def top_bottom_line(yaml)
+ if yaml.class == Hash
+ clas = yaml['class']
+ style = yaml['style']
+ end
+ clas ||= 'dc-separator'
+ "<tr><td colspan=\"4\" class=\"#{clas}\" style=\"#{style}\"></td></tr>"
+end
+
+############################################################################
# Creates input field for one tab. Subroutine of dc_fields_for_form.
############################################################################
def dc_fields_for_tab(fields) #:nodoc:
@js ||= ''
double_field = 0
@@ -652,10 +664,13 @@
@js << field.js
field.html
else # litle error string
"Error: Code for field type #{options['type']} not defined!"
end
+# Separator
+ html << top_bottom_line(options['top-line']) if options['top-line']
+# Double entry fields in one row
double_field = 1 if options['double']
html << '<tr>' if double_field < 2
#
html << if labels_pos == 'top'
%Q[<td class="dc-form-label dc-color-#{odd_even} dc-align-left" title="#{help}"
@@ -670,9 +685,10 @@
]
end
html << '</tr>' if double_field != 1
double_field = 0 if double_field == 2
double_field = 2 if double_field == 1
+ html << top_bottom_line(options['bottom-line']) if options['bottom-line']
end
html << '</table></table>'
end
############################################################################