DVGM/app/views/grades/index_student.html.erb

46 lines
1.4 KiB
Plaintext

<p data-search-info></p>
<table class="w3-table w3-striped w3-bordered" style="margin: auto">
<tr>
<th>Lecturer</th>
<th>Lecture</th>
<th>Grade</th>
<th>Submission</th>
<th>Comment</th>
</tr>
<% @grades.each do |grade| %>
<tr>
<td><%= grade.lecture.lecturer.login %></td>
<td><%= grade.lecture.name %></td>
<td><%= grade.grade %></td>
<td>
<% if grade.submission.attached? %>
<%= link_to grade.submission.filename.to_s, rails_blob_url(grade.submission, disposition: "attachment") %>
<% end %>
</td>
<td>
<% if grade.comment %>
<%= grade.comment.html_safe %>
<% end %>
</td>
<td><%= link_to 'Comment', edit_grade_path(grade), :class => "w3-button w3-light-blue" %></td>
</tr>
<% end %>
</table>
<div class="w3-center">
<%= link_to "Generate Report", {controller: "reports", action: "create"}, :method => :post, :class => "w3-button w3-light-blue" %>
</div>
<%= form_tag(grades_url, method: "get", class: "w3-margin") do %>
<div class="w3-right" style="width: 10%">
<%= submit_tag("Filter", class: "w3-button w3-light-blue") %>
</div>
<%= text_field_tag(:lecturer, "", class: "w3-input w3-border w3-round", placeholder: "Filter by lecturer...", style: "width: 90%") %>
<% end %>
<div class="w3-center w3-margin">
<%= link_to 'New Submission', new_grade_path, :class => "w3-button w3-light-blue" %>
</div>