Fix link bug.
This commit is contained in:
parent
c4ae7af68e
commit
7d65070611
|
@ -109,7 +109,9 @@ class Book
|
||||||
if !page.nil? && page.custom_string_field == "table"
|
if !page.nil? && page.custom_string_field == "table"
|
||||||
case t
|
case t
|
||||||
when "book_title", "extracted_chapters"
|
when "book_title", "extracted_chapters"
|
||||||
pd_data << { "data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_book')}' title=\"#{p.send(t)}\" target='_blank'>#{p.send(t)}</a>" }
|
link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_book')
|
||||||
|
link = (link == "#" ? p.send(t) : "<a href='#{link}' title=\"#{p.send(t)}\" target='_blank'>#{p.send(t)}</a>")
|
||||||
|
pd_data << { "data_title" => link }
|
||||||
when "publish_date", "publication_date"
|
when "publish_date", "publication_date"
|
||||||
pd = ""
|
pd = ""
|
||||||
if !p.publication_date.nil?
|
if !p.publication_date.nil?
|
||||||
|
@ -126,7 +128,9 @@ class Book
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if t == "book_title"
|
if t == "book_title"
|
||||||
pd_data << { "data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_book')}' title=\"#{p.create_link}\" target='_blank'>#{p.create_link}</a>" }
|
link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_book')
|
||||||
|
link = (link == "#" ? p.create_link : "<a href='#{link}' title=\"#{p.create_link}\" target='_blank'>#{p.create_link}</a>")
|
||||||
|
pd_data << { "data_title" => link }
|
||||||
else
|
else
|
||||||
pd_data << { "data_title" => p.send(t) }
|
pd_data << { "data_title" => p.send(t) }
|
||||||
end
|
end
|
||||||
|
|
|
@ -47,7 +47,8 @@
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<td><%= book.year %></td>
|
<td><%= book.year %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to book.create_link, OrbitHelper.url_to_plugin_show(book.to_param,'personal_book'), target: "blank"%>
|
<% link = OrbitHelper.url_to_plugin_show(book.to_param,'personal_book') %>
|
||||||
|
<%= (link == "#" ? book.create_link : link_to(book.create_link, link , target: "blank")) %>
|
||||||
<% if has_access? %>
|
<% if has_access? %>
|
||||||
<div class="quick-edit">
|
<div class="quick-edit">
|
||||||
<ul class="nav nav-pills hide">
|
<ul class="nav nav-pills hide">
|
||||||
|
|
Loading…
Reference in New Issue