课程相关优化

This commit is contained in:
huang 2016-03-25 16:30:00 +08:00
parent e02ad85bbb
commit cca570e75c
4 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,7 @@
</script> </script>
<style type="text/css"> <style type="text/css">
</style> </style>
<% course_activities.each do |activity| if course_activities %> <% course_activities.includes(:course_act).each do |activity| if course_activities %>
<script> <script>
function expand_reply(container, btnid) { function expand_reply(container, btnid) {
var target = $(container); var target = $(container);
@ -73,7 +73,7 @@
sd_create_editor_from_data(<%= activity.id%>, null, "100%", "<%= activity.class.to_s %>"); sd_create_editor_from_data(<%= activity.id%>, null, "100%", "<%= activity.class.to_s %>");
}); });
</script> </script>
<% if activity && activity.course_act%> <% if activity && activity.course_act %>
<% act = activity.course_act %> <% act = activity.course_act %>
<% case activity.course_act_type.to_s %> <% case activity.course_act_type.to_s %>
<% when 'HomeworkCommon' %> <% when 'HomeworkCommon' %>

View File

@ -151,7 +151,7 @@
<% else %> <% else %>
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %> <% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %>
<% end %> <% end %>
<% student_works.each_with_index do |sw, i| %> <% student_works.includes(:user).each_with_index do |sw, i| %>
<div class="fl mr10 w100" style="text-align:center;"> <div class="fl mr10 w100" style="text-align:center;">
<a href="javascript:void(0);" class="linkBlue"> <a href="javascript:void(0);" class="linkBlue">
<% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %> <% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %>

View File

@ -113,7 +113,7 @@
<% if count > 0 %> <% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>"> <div class="" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.children.reorder("created_on desc").each do |reply|%> <% activity.children.includes(:author).reorder("created_on desc").each do |reply|%>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_content_<%= reply.id %>'); showNormalImage('reply_content_<%= reply.id %>');

View File

@ -155,7 +155,7 @@
<% else %> <% else %>
<% student_works = homework_common.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %> <% student_works = homework_common.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %>
<% end %> <% end %>
<% student_works.each_with_index do |sw, i| %> <% student_works.includes(:user).each_with_index do |sw, i| %>
<div class="fl mr10 w100" style="text-align:center;"> <div class="fl mr10 w100" style="text-align:center;">
<a href="javascript:void(0);" class="linkBlue"> <a href="javascript:void(0);" class="linkBlue">
<% if User.current.member_of_course?(homework_common.course) || User.current.admin? || homework_common.is_open == 1 %> <% if User.current.member_of_course?(homework_common.course) || User.current.admin? || homework_common.is_open == 1 %>