commit
54317af6d8
@ -0,0 +1,76 @@
|
|||||||
|
<div class="contextual">
|
||||||
|
<%= link_to l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>
|
||||||
|
<%=l(:label_course_all)%>
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<%= form_tag({}, :method => :get) do %>
|
||||||
|
<fieldset>
|
||||||
|
<label for='name'>
|
||||||
|
课程:
|
||||||
|
</label>
|
||||||
|
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '课程名称' %>
|
||||||
|
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||||
|
<a class="icon icon-reload" onclick="$('#name').val('')" style="cursor: pointer;text-decoration: none;">
|
||||||
|
<%= l(:button_clear)%>
|
||||||
|
</a>
|
||||||
|
</fieldset>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="autoscroll">
|
||||||
|
<table class="list" style="width: 100%;table-layout: fixed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 30px;">
|
||||||
|
序号
|
||||||
|
</th>
|
||||||
|
<th style="width: 120px;">
|
||||||
|
课程
|
||||||
|
</th>
|
||||||
|
<th style="width: 50px;">
|
||||||
|
主讲老师
|
||||||
|
</th>
|
||||||
|
<th style="width: 30px;">
|
||||||
|
学时
|
||||||
|
</th>
|
||||||
|
<th style="width: 20px;">
|
||||||
|
<%=l(:field_is_public)%>
|
||||||
|
</th>
|
||||||
|
<th style="width: 70px;">
|
||||||
|
<%=l(:field_created_on)%>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% @courses.each do |course| %>
|
||||||
|
<tr class="<%= cycle("odd", "even") %>">
|
||||||
|
<td style="text-align: center;">
|
||||||
|
<%= course.id %>
|
||||||
|
</td>
|
||||||
|
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||||
|
<span>
|
||||||
|
<%= link_to(course.name, course_path(course.id)) %>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<%= course.class_period %>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<%= checked_image course.is_public? %>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<%= format_date(course.created_at) %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% html_title(l(:label_course_all)) -%>
|
@ -1,11 +1,11 @@
|
|||||||
$('#issue_notes').val("<%= raw escape_javascript(@content) %>");
|
$('#journal_issue_note').html("<%= raw escape_javascript(@content.html_safe) %>");
|
||||||
|
$("input[name='issue_quote_new']").val("<%= raw escape_javascript(@content.html_safe) %>");
|
||||||
<%
|
<%
|
||||||
# when quoting a private journal, check the private checkbox
|
# when quoting a private journal, check the private checkbox
|
||||||
if @journal && @journal.private_notes?
|
if @journal && @journal.private_notes?
|
||||||
%>
|
%>
|
||||||
$('#issue_private_notes').attr('checked', true);
|
$('#issue_private_notes').attr('checked', true);
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
showAndScrollTo("update", "notes");
|
showAndScrollTo("update", "notes");
|
||||||
$('#notes').scrollTop = $('#notes').scrollHeight - $('#notes').clientHeight;
|
$('#notes').scrollTop = $('#notes').scrollHeight - $('#notes').clientHeight;
|
||||||
|
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
class DeleteSameScore < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
student_work_scores = StudentWorksScore.find_by_sql("SELECT * FROM student_works_scores AS a
|
||||||
|
WHERE (a.student_work_id,a.user_id) IN (SELECT student_work_id,user_id FROM student_works_scores GROUP BY student_work_id,user_id HAVING COUNT(*) > 1)
|
||||||
|
AND id NOT IN (SELECT MIN(id) FROM student_works_scores GROUP BY student_work_id,user_id HAVING COUNT(*)>1)")
|
||||||
|
student_work_scores.each do |score|
|
||||||
|
score.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue