Fix link bug.

This commit is contained in:
BoHung Chiu 2022-01-03 23:02:30 +08:00
parent 3a92c8ec03
commit 1136e0ff7c
2 changed files with 5 additions and 2 deletions

View File

@ -94,7 +94,9 @@ class Course
pd_data = [] pd_data = []
fields_to_show.collect do |t| fields_to_show.collect do |t|
if t == "title" if t == "title"
pd_data << { "data_title" => "<a href='#{OrbitHelper.url_to_plugin_show(p.to_param,'personal_course')}' target='_blank'>#{p.send(t)}" } link = OrbitHelper.url_to_plugin_show(p.to_param,'personal_course')
link = (link == "#" ? p.send(t) : "<a href='#{link}' title=\"#{p.send(t)}\" target='_blank'>#{p.send(t)}</a>")
pd_data << { "data_title" => link }
elsif t == "course_category" elsif t == "course_category"
pd_data << {"data_title" => (p.course_category.title rescue "")} pd_data << {"data_title" => (p.course_category.title rescue "")}
else else

View File

@ -44,7 +44,8 @@
<% end %> <% end %>
<td><%= course.year %></td> <td><%= course.year %></td>
<td> <td>
<%= link_to course.title, OrbitHelper.url_to_plugin_show(course.to_param,'personal_course').to_s, target: "blank"%> <% link = OrbitHelper.url_to_plugin_show(course.to_param,'personal_course') %>
<%= (link = (link == "#") ? course.title : link_to(course.title, link, target: "blank")) %>
<div class="quick-edit"> <div class="quick-edit">
<ul class="nav nav-pills hide"> <ul class="nav nav-pills hide">
<% if has_access? %> <% if has_access? %>