forked from saurabh/personal-journal
removed empty column
This commit is contained in:
parent
6c151f981f
commit
d99cc7371d
|
@ -75,12 +75,23 @@ class JournalPaper
|
||||||
"paper_title"
|
"paper_title"
|
||||||
]
|
]
|
||||||
|
|
||||||
pd_title = fields_to_show.collect do |t|
|
fields_to_remove = []
|
||||||
{
|
|
||||||
"plugin_data_title" => I18n.t("personal_journal.#{t}")
|
pd_title = []
|
||||||
}
|
|
||||||
|
fields_to_show.each do |t|
|
||||||
|
if (self.fields[t].type.to_s == "String" rescue false)
|
||||||
|
fields_to_remove << t if (datas.where(t.to_sym.ne => nil, t.to_sym.ne => "").count == 0 rescue false)
|
||||||
|
else
|
||||||
|
fields_to_remove << t if (datas.where(t.to_sym.ne => nil).count == 0 rescue false)
|
||||||
|
end
|
||||||
|
pd_title << {
|
||||||
|
"plugin_data_title" => I18n.t("personal_journal.#{t}")
|
||||||
|
} if !fields_to_remove.include?(t)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
fields_to_show = fields_to_show - fields_to_remove
|
||||||
|
|
||||||
plugin_datas = datas.sort_for_frontend.collect do |p|
|
plugin_datas = datas.sort_for_frontend.collect do |p|
|
||||||
|
|
||||||
pd_data = []
|
pd_data = []
|
||||||
|
|
Loading…
Reference in New Issue