diff --git a/app/models/book.rb b/app/models/book.rb index 75f0374..77175f9 100644 --- a/app/models/book.rb +++ b/app/models/book.rb @@ -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" => "#{p.send(t)}" } + link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_book') + link = (link == "#" ? p.send(t) : "#{p.send(t)}") + 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" => "#{p.create_link}" } + link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_book') + link = (link == "#" ? p.create_link : "#{p.create_link}") + pd_data << { "data_title" => link } else pd_data << { "data_title" => p.send(t) } end diff --git a/app/views/plugin/personal_book/_profile.html.erb b/app/views/plugin/personal_book/_profile.html.erb index d8a89ce..2ac8b3a 100644 --- a/app/views/plugin/personal_book/_profile.html.erb +++ b/app/views/plugin/personal_book/_profile.html.erb @@ -47,7 +47,8 @@ <% end -%> <%= book.year %> - <%= 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? %>