fix bug for deleted entries and hashtabgs
This commit is contained in:
parent
4247599fd5
commit
4bff2dfaa2
|
|
@ -17,7 +17,7 @@ class CurationPostSection
|
||||||
def get_table_entries_for_frontend
|
def get_table_entries_for_frontend
|
||||||
module_app = ModuleApp.find_by_key("universal_table")
|
module_app = ModuleApp.find_by_key("universal_table")
|
||||||
tids = self.table_entries.split(',')
|
tids = self.table_entries.split(',')
|
||||||
table_entries = TableEntry.find(tids)
|
table_entries = TableEntry.find(tids) rescue []
|
||||||
table_entries.map do |entry|
|
table_entries.map do |entry|
|
||||||
rows = []
|
rows = []
|
||||||
entry.column_entries.each do |ce|
|
entry.column_entries.each do |ce|
|
||||||
|
|
@ -33,6 +33,10 @@ class CurationPostSection
|
||||||
"text" => text
|
"text" => text
|
||||||
} if text != ""
|
} if text != ""
|
||||||
end
|
end
|
||||||
|
rows << {
|
||||||
|
"title" => I18n.t("universal_table.hashtags"),
|
||||||
|
"text" => entry.tags_for_frontend
|
||||||
|
}
|
||||||
{
|
{
|
||||||
"uid" => entry.uid,
|
"uid" => entry.uid,
|
||||||
"type" => self.section_type,
|
"type" => self.section_type,
|
||||||
|
|
@ -43,7 +47,7 @@ class CurationPostSection
|
||||||
|
|
||||||
def get_table_entries
|
def get_table_entries
|
||||||
tids = self.table_entries.split(',')
|
tids = self.table_entries.split(',')
|
||||||
TableEntry.find(tids)
|
TableEntry.find(tids) rescue []
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_frontend_object
|
def get_frontend_object
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
<span class="add-on"><%= t("curation.tables") %></span>
|
<span class="add-on"><%= t("curation.tables") %></span>
|
||||||
<%= f.select :universal_table, UTable.all.map { |table| [table.title, table.uid] },
|
<%= f.select :universal_table, UTable.all.map { |table| [table.title, table.uid] },
|
||||||
{ include_blank: t("curation.please_select") },
|
{ include_blank: t("curation.please_select") },
|
||||||
class: 'form-control' %>
|
class: 'form-control universal_table' %>
|
||||||
</span>
|
</span>
|
||||||
<% if !form_section_post.new_record? && form_section_post.section_type == "universal_table" %>
|
<% if !form_section_post.new_record? && form_section_post.section_type == "universal_table" %>
|
||||||
<%
|
<%
|
||||||
|
|
@ -69,6 +69,7 @@
|
||||||
<span class="tab-content section_type_ut_entries">
|
<span class="tab-content section_type_ut_entries">
|
||||||
<span class="add-on"><%= t("curation.table_entries") %></span>
|
<span class="add-on"><%= t("curation.table_entries") %></span>
|
||||||
<%= f.text_field :table_entries, :class => "select2", data: { value: tbData } %>
|
<%= f.text_field :table_entries, :class => "select2", data: { value: tbData } %>
|
||||||
|
<%#= f.select :universal_table, [], {}, class: 'form-control select2', multiple: true, data: { value: tbData } %>
|
||||||
</span>
|
</span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="tab-content section_type_ut_entries" style="display:none">
|
<span class="tab-content section_type_ut_entries" style="display:none">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue