new code for attribute fields and values for new member interface
This commit is contained in:
1 parent
293dc80ceb
commit
8b9cffd4f2
15 files changed
+226
-116
No files matched your search
@@ -11,7 +11,7 @@ class AttributeValue
|
||||
|
||||
before_save :check_key
|
||||
|
||||
NO_MULTI_TAG = ["select","date","radio_button","checkbox","date_durnation"]
|
||||
# NO_MULTI_TAG = ["select","date","radio_button","checkbox","date_durnation"]
|
||||
|
||||
def check_key
|
||||
self.key = attribute_field.key
|
||||
@@ -31,19 +31,25 @@ class AttributeValue
|
||||
self.attribute_field.locale ? self[locale] : self[:value]
|
||||
when "select"
|
||||
self.attribute_field.markup_value[self[:value]][locale.to_s] || NoData
|
||||
when "email"
|
||||
self[:value]
|
||||
when "text_area"
|
||||
#self[:value]
|
||||
when "date"
|
||||
Date.new(self[:value]["(1i)"].to_i,self[:value]["(2i)"].to_i,self[:value]["(3i)"].to_i)
|
||||
when "addr"
|
||||
self[:value]
|
||||
when "radio_button"
|
||||
self[:value]
|
||||
when "checkbox"
|
||||
self[:value]
|
||||
when "date_durnation"
|
||||
self[:value]
|
||||
else
|
||||
self.attribute_field.locale ? self[locale] : self[:value]
|
||||
end
|
||||
end
|
||||
|
||||
def get_values
|
||||
if self.attribute_field.locale && !(NO_MULTI_TAG.include? self.attribute_field.markup)
|
||||
if self.attribute_field.locale && LIST[:markups][self.attribute_field.markup]["muti_lang_input_supprt"]
|
||||
return Hash[VALID_LOCALES.collect{|lang| [lang,self[lang.to_sym]]}]
|
||||
else
|
||||
return self[:value]
|
||||
|
||||
Reference in new issue
Block a user