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

93 lines
6.7 KiB
Plaintext
Raw Permalink Normal View History

2020-09-20 06:37:35 +00:00
<h4><%=t("personal_selected_course.assignment_delivery_area")%>-<%=@course.title rescue "" %></h4>
<table class="table main-list">
<thead>
<tr>
<th class="span2"><%= t("personal_course.name") %></th>
<th class="span2"><%= t("personal_course.detail") %></th>
<th class="span2"><%= t("personal_course.course_attachment") %></th>
<th class="span2">
<%= t("personal_course.assign_date") %>
<button tabindex="0" class="help_btn" data-target="#show_assign_date_modal" style="cursor: pointer;padding: 0em 0.475em;font-size: 1.25em;border-radius: 1em;margin-left: 0.5em;background-color: #666666;border-color: #666666;color: white;" onclick="$('#show_assign_date_modal').modal('show')" type="button"><i aria-hidden="true" class="fa fa-info"></i></button>
<div id="show_assign_date_modal" class="modal fade" style="color: #333;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" aria-hidden="true" class="close" data-target="show_assign_date_modal">×</button>
<h4 class="modal-title"><%= t("personal_course.assign_date") %></h4>
</div>
<div class="modal-body"><%= t("personal_course.assign_date_hint") %></div>
<div class="modal-footer"><button type="button" class="btn btn-default close" data-target="show_assign_date_modal">Close</button></div>
</div>
</div>
</div>
</th>
<th class="span2">
<%= t("personal_course.deadline") %>
<button tabindex="0" class="help_btn" data-target="#show_deadline_modal" style="cursor: pointer;padding: 0em 0.475em;font-size: 1.25em;border-radius: 1em;margin-left: 0.5em;background-color: #666666;border-color: #666666;color: white;" onclick="$('#show_deadline_modal').modal('show')" type="button"><i aria-hidden="true" class="fa fa-info"></i></button>
<div id="show_deadline_modal" class="modal fade" style="color: #333;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" aria-hidden="true" class="close" data-target="show_deadline_modal">×</button>
<h4 class="modal-title"><%= t("personal_course.deadline") %></h4>
</div>
<div class="modal-body"><%= t("personal_course.deadline_hint") %></div>
<div class="modal-footer"><button type="button" class="btn btn-default close" data-target="show_deadline_modal">Close</button></div>
</div>
</div>
</div>
</th>
<th class="span2"><%= t("personal_selected_course.status") %></th>
</tr>
</thead>
<tbody id="tbody_writing_journals" class="sort-holder">
<% @course_assignments.each do |course_assignment| %>
<% student_assignment = StudentAssignment.where(:course_assignment_id=> course_assignment.id,:member_profile_id=>@member_profile.id).first %>
<% closed = (course_assignment.deadline < DateTime.now) rescue false %>
<tr>
<td>
<%= course_assignment.name %>
<div class="quick-edit">
<% if !closed %>
<ul class="nav nav-pills hide">
<% if student_assignment.nil? %>
2020-09-20 09:21:07 +00:00
<li><%= link_to t('new_'), new_assignment_admin_selected_courses_path(:uid=>course_assignment.uid,:name=>course_assignment.name,:page => params[:page],:member_profile_name=>@member_profile.name, :member_profile_uid=>@member_profile.uid) %></li>
2020-09-20 06:37:35 +00:00
<% else %>
2020-09-20 09:21:07 +00:00
<li><%= link_to t('edit'), edit_assignment_admin_selected_courses_path(:uid=>course_assignment.uid,:name=>course_assignment.name,:page => params[:page],:id=>student_assignment.id,:member_profile_name=>@member_profile.name, :member_profile_uid=>@member_profile.uid) %></li>
2020-09-20 06:37:35 +00:00
<% end %>
</ul>
<% else %>
<span style="color: red;"><%=t('personal_selected_course.closed')%></span>
<ul class="nav nav-pills hide">
<% if student_assignment.nil? %>
2020-09-20 09:21:07 +00:00
<li><%= link_to t('personal_selected_course.view'), new_assignment_admin_selected_courses_path(:uid=>course_assignment.uid,:name=>course_assignment.name,:page => params[:page],:member_profile_name=>@member_profile.name, :member_profile_uid=>@member_profile.uid) %></li>
2020-09-20 06:37:35 +00:00
<% else %>
2020-09-20 09:21:07 +00:00
<li><%= link_to t('personal_selected_course.view'), edit_assignment_admin_selected_courses_path(:uid=>course_assignment.uid,:name=>course_assignment.name,:page => params[:page],:id=>student_assignment.id,:member_profile_name=>@member_profile.name, :member_profile_uid=>@member_profile.uid) %></li>
2020-09-20 06:37:35 +00:00
<% end %>
</ul>
<% end %>
</div>
</td>
2020-09-21 15:29:05 +00:00
<td><%= course_assignment.detail.html_safe %></td>
2020-09-20 06:37:35 +00:00
<td><%= course_assignment.display_attachments %></td>
<td><%= course_assignment.display_assign_date %></td>
<td><%= course_assignment.display_deadline %></td>
<td><%= student_assignment.nil? ? "<span style=\"color: red;\">#{t("personal_selected_course.not_yet_deliver")}</span>".html_safe : ("<span style=\"color: green;\">#{t("personal_selected_course.already_deliver")}</span>"+"<br><span style=\"color: #aba8a8\">#{t('personal_selected_course.last_updated_date')}:#{student_assignment.display_updated_at}</span>").html_safe %></td>
</tr>
<% end %>
</tbody>
</table>
<div class="bottomnav clearfix">
<div class="action pull-right">
<%#= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:new_), new_assignment_admin_courses_path(:id=>params[:id]), :class => 'btn btn-primary' %>
</div>
<div class="pagination pagination-centered">
<%= content_tag :div, paginate(@course_assignments), class: "pagination pagination-centered" %>
</div>
</div>
<script type="text/javascript">
$('.modal .close').click(function(){
$("#"+$(this).attr("data-target")).modal('hide');
})
</script>