forked from saurabh/personal-book
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"
|
||||
case t
|
||||
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"
|
||||
pd = ""
|
||||
if !p.publication_date.nil?
|
||||
|
@ -126,7 +128,9 @@ class Book
|
|||
end
|
||||
else
|
||||
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
|
||||
pd_data << { "data_title" => p.send(t) }
|
||||
end
|
||||
|
|
|
@ -47,7 +47,8 @@
|
|||
<% end -%>
|
||||
<td><%= book.year %></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? %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
|
|
Loading…
Reference in New Issue