personal-selected_course/app/views/admin/selected_courses/_selected_courses.html.erb

35 lines
1.7 KiB
Plaintext
Raw Normal View History

2020-09-20 06:24:31 +00:00
<% protocol = ("#{URI(request.referer).scheme}://" rescue request.protocol) %>
<% host_url = protocol+(request.host_with_port) %>
<% @selected_courses.each do |selected_course| %>
<tr id="<%= dom_id selected_course %>" class="with_action">
2020-09-20 06:37:35 +00:00
<% member_profile = selected_course.member_profile %>
2020-09-20 06:24:31 +00:00
<td class="span1"><%= selected_course.year %></td>
<td class="span1">
<%= link_to selected_course.course_title, page_for_selected_course(selected_course), target: "blank"%>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<li><%= link_to t('edit'), edit_admin_selected_course_path(selected_course,:page => params[:page]) %></li>
<li><%= link_to t(:delete_), admin_selected_course_path(id: selected_course.id, :page => params[:page]), method: :delete, data: { confirm: 'Are you sure?' } %></li>
</ul>
</div>
2020-09-20 06:37:35 +00:00
<td>
<% if member_profile.present? %>
<%= link_to CourseAssignment.where(:course_id=>selected_course.course_id).enabled_for_student.count,show_assignments_admin_selected_courses_path(:id=> selected_course.course_id,:member_profile_name=> member_profile.name,:member_profile_uid=> member_profile.uid) %>
<% else %>
0
<% end %>
</td>
2020-09-20 06:24:31 +00:00
</td>
<td class="span1"><% course_url = selected_course.course_url %>
<% if selected_course.course %>
<% if course_url != "#" %>
<% course_url = host_url + course_url %>
<a title="<%=selected_course.course_title%>" href="<%=course_url%>"><%=course_url%></a>
<% end %>
<% else %>
<a title="<%=selected_course.course_title%>" href="<%=selected_course.other_course_url%>"><%=selected_course.other_course_url%></a>
<% end %>
</td>
2020-09-20 06:37:35 +00:00
<td><%= member_profile.name rescue "" %></td>
2020-09-20 06:24:31 +00:00
</tr>
<% end %>