fix bug
This commit is contained in:
parent
31feee3e79
commit
365eefb1ee
|
@ -6,7 +6,7 @@ class Writing
|
||||||
|
|
||||||
belongs_to :member_profile
|
belongs_to :member_profile
|
||||||
|
|
||||||
field :lab_title, :as=>:slug_title, localize: true
|
field :writing_title, :as=>:slug_title, localize: true
|
||||||
field :location, localize: true
|
field :location, localize: true
|
||||||
field :participating_professor, localize: true
|
field :participating_professor, localize: true
|
||||||
field :participating_student, localize: true
|
field :participating_student, localize: true
|
||||||
|
@ -24,8 +24,8 @@ class Writing
|
||||||
|
|
||||||
# paginates_per 10
|
# paginates_per 10
|
||||||
|
|
||||||
has_many :lab_files, :autosave => true, :dependent => :destroy
|
has_many :writing_files, :autosave => true, :dependent => :destroy
|
||||||
accepts_nested_attributes_for :lab_files, :allow_destroy => true
|
accepts_nested_attributes_for :writing_files, :allow_destroy => true
|
||||||
|
|
||||||
before_validation :add_http
|
before_validation :add_http
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class Writing
|
||||||
|
|
||||||
fields_to_show = [
|
fields_to_show = [
|
||||||
"year",
|
"year",
|
||||||
"lab_title",
|
"writing_title",
|
||||||
"location"
|
"location"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class Writing
|
||||||
|
|
||||||
pd_data = []
|
pd_data = []
|
||||||
fields_to_show.collect do |t|
|
fields_to_show.collect do |t|
|
||||||
if t == "lab_title"
|
if t == "writing_title"
|
||||||
pd_data << { "data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_writing')}' title='#{p.send(t)}' target='_blank'>#{p.send(t)}" }
|
pd_data << { "data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_writing')}' title='#{p.send(t)}' target='_blank'>#{p.send(t)}" }
|
||||||
else
|
else
|
||||||
pd_data << { "data_title" => p.send(t) }
|
pd_data << { "data_title" => p.send(t) }
|
||||||
|
@ -93,9 +93,9 @@ class Writing
|
||||||
value = I18n.t(self.language) rescue ""
|
value = I18n.t(self.language) rescue ""
|
||||||
when "file"
|
when "file"
|
||||||
files = []
|
files = []
|
||||||
self.lab_files.each do |lab_file|
|
self.writing_files.each do |writing_file|
|
||||||
url = lab_file.file.url
|
url = writing_file.file.url
|
||||||
title = (lab_file.title.blank? ? File.basename(lab_file.file.path) : lab_file.title)
|
title = (writing_file.title.blank? ? File.basename(writing_file.file.path) : writing_file.title)
|
||||||
files << "<li><a href='#{url}'' target='_blank'>#{title}</li>"
|
files << "<li><a href='#{url}'' target='_blank'>#{title}</li>"
|
||||||
end
|
end
|
||||||
value = files.join("")
|
value = files.join("")
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<% @labs.each do |writing| %>
|
<% @writings.each do |writing| %>
|
||||||
<tr id="<%= dom_id writing %>" class="<%= writing.is_hidden ? "checkHide" : "" %>">
|
<tr id="<%= dom_id writing %>" class="<%= writing.is_hidden ? "checkHide" : "" %>">
|
||||||
<td><%= writing.year %></td>
|
<td><%= writing.year %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to writing.lab_title, OrbitHelper.url_to_plugin_show(writing.to_param,'personal_writing'), target: "blank"%>
|
<%= link_to writing.writing_title, OrbitHelper.url_to_plugin_show(writing.to_param,'personal_writing'), target: "blank"%>
|
||||||
<div class="quick-edit">
|
<div class="quick-edit">
|
||||||
<ul class="nav nav-pills hide">
|
<ul class="nav nav-pills hide">
|
||||||
<li><%= link_to t('edit'), edit_admin_lab_path(writing) %></li>
|
<li><%= link_to t('edit'), edit_admin_writing_path(writing) %></li>
|
||||||
<li><%= link_to t(:delete_), admin_lab_path(id: writing.id), method: :delete, remote: true, data: { confirm: 'Are you sure?' } %></li>
|
<li><%= link_to t(:delete_), admin_writing_path(id: writing.id), method: :delete, remote: true, data: { confirm: 'Are you sure?' } %></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Reference in New Issue