From 7679d149dc8af8a27d340065aadca9e16e5d463f Mon Sep 17 00:00:00 2001 From: Karel Picman Date: Wed, 19 Mar 2014 16:10:24 +0100 Subject: [PATCH] #236 Documents tagging --- app/helpers/dmsf_helper.rb | 16 +--------------- app/views/dmsf/show.html.erb | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/app/helpers/dmsf_helper.rb b/app/helpers/dmsf_helper.rb index 447745c9..e06e403d 100644 --- a/app/helpers/dmsf_helper.rb +++ b/app/helpers/dmsf_helper.rb @@ -74,20 +74,6 @@ module DmsfHelper # of methods - however seems functional. Not sure if MySQL return obj.to_s.to_time(ActiveRecord::Base.default_timezone) if obj.class.name == 'Mysql::Time' return obj - end - - # Return custom field html tag corresponding to its format - def custom_field_tag_ex(prefix, custom_value, data) - custom_value.custom_field.format.edit_tag self, - custom_field_tag_id(prefix, custom_value.custom_field), - custom_field_tag_name(prefix, custom_value.custom_field), - custom_value, - {:class => "#{custom_value.custom_field.field_format}_cf}"}.merge(data) - end - - # Return custom field tag with its label tag - def custom_field_tag_with_label_ex(name, custom_value, options={}, data={}) - custom_field_label_tag(name, custom_value, options) + custom_field_tag_ex(name, custom_value, data) - end + end end diff --git a/app/views/dmsf/show.html.erb b/app/views/dmsf/show.html.erb index 957a2609..57581a78 100644 --- a/app/views/dmsf/show.html.erb +++ b/app/views/dmsf/show.html.erb @@ -113,12 +113,10 @@ <% values = @folder ? @folder.custom_field_values : @parent ? @parent.custom_field_values : DmsfFolder.new(:project => @project).custom_field_values %> <% unless values.empty? %> -
- <%= custom_field_tag_with_label_ex( +
+ <%= custom_field_tag_with_label( :dmsf_folder, - CustomValue.new(:custom_field_id => params[:custom_field_id].present? ? params[:custom_field_id] : values.first.custom_field_id, :value => params[:custom_value]), - {}, - :onchange => 'this.form.submit(); return false;') %> + CustomValue.new(:custom_field_id => params[:custom_field_id].present? ? params[:custom_field_id] : values.first.custom_field_id, :value => params[:custom_value])) %>
<% end %> @@ -198,15 +196,19 @@ <% end %>