personal-course/app/views/admin/courses/course_assignments.html.erb

82 lines
5.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h4><%=t("personal_course.assignment_management")%>-<%=@course.title rescue "" %></h4>
<% student_assignment = (StudentAssignment rescue nil) %>
<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>
<% if !student_assignment.nil? %>
<th class="span2"><%=t("personal_course.already_deliver")%></th>
<% end %>
</tr>
</thead>
<tbody id="tbody_writing_journals" class="sort-holder">
<% @course_assignments.each do |course_assignment| %>
<tr>
<td>
<%= course_assignment.name %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<li><%= link_to t('edit'), edit_assignment_admin_courses_path(:uid=>course_assignment.uid,:name=>course_assignment.name,:page => params[:page]) %></li>
<li><%= link_to t(:delete_), destroy_assignment_admin_courses_path(id: course_assignment.id, :page => params[:page]), method: :delete, data: { confirm: t('personal_course.delete_assignment_message') } %></li>
</ul>
</div>
</td>
<td><%= course_assignment.detail %></td>
<td><%= course_assignment.display_attachments %></td>
<td><%= course_assignment.display_assign_date %></td>
<td><%= course_assignment.display_deadline %></td>
<% if !student_assignment.nil? %>
<td><%= link_to course_assignment.deliver_count, show_assignments_admin_courses_path(:name=>course_assignment.name, :uid => course_assignment.uid ) %></td>
<% end %>
</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>