Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: app/views/users/user_homeworks.html.erb
This commit is contained in:
commit
c2dbd9449e
|
@ -34,20 +34,20 @@ class CommentsController < ApplicationController
|
|||
ids = params[:asset_id].split(',')
|
||||
update_kindeditor_assets_owner ids,@comment.id,OwnerTypeHelper::COMMENT
|
||||
end
|
||||
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add start
|
||||
if( @comment.id && @news.course )
|
||||
if(@news.author_id != User.current.id)
|
||||
notify = ActivityNotify.new()
|
||||
notify.activity_container_id = @news.course.id
|
||||
notify.activity_container_type = 'Course'
|
||||
notify.activity_id = @comment.id
|
||||
notify.activity_type = 'Comment'
|
||||
notify.notify_to = @news.author_id
|
||||
notify.is_read = 0
|
||||
notify.save()
|
||||
end
|
||||
end
|
||||
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
|
||||
# # <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add start
|
||||
# if( @comment.id && @news.course )
|
||||
# if(@news.author_id != User.current.id)
|
||||
# notify = ActivityNotify.new()
|
||||
# notify.activity_container_id = @news.course.id
|
||||
# notify.activity_container_type = 'Course'
|
||||
# notify.activity_id = @comment.id
|
||||
# notify.activity_type = 'Comment'
|
||||
# notify.notify_to = @news.author_id
|
||||
# notify.is_read = 0
|
||||
# notify.save()
|
||||
# end
|
||||
# end
|
||||
# # <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
|
||||
flash[:notice] = l(:label_comment_added)
|
||||
end
|
||||
|
||||
|
|
|
@ -544,6 +544,10 @@ module UsersHelper
|
|||
#获取指定用户作为老师的课程
|
||||
def get_as_teacher_courses user
|
||||
type = []
|
||||
option = []
|
||||
option << "请选择发布作业的课程"
|
||||
option << -1
|
||||
type << option
|
||||
user.courses.select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
|
||||
option = []
|
||||
option << course.name+"("+course.time.to_s+course.term+")"
|
||||
|
|
|
@ -50,16 +50,15 @@
|
|||
<div class="homepagePostReplyBanner">
|
||||
<% count=0 %>
|
||||
<div class="homepagePostReplyBannerCount">回复(
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% count=activity.replies_count%>
|
||||
<%=count %>
|
||||
<% else %>
|
||||
<% count=activity.parent.replies_count%>
|
||||
<%=count %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<%= count %>
|
||||
)</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||
<%if count>2 %>
|
||||
<%if count > 2 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
点击展开更多回复(<%= count.to_s%>)
|
||||
|
@ -83,9 +82,9 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% activity= activity.parent_id.nil? ? activity:activity.parent%>
|
||||
<% activity= activity.parent ? activity.parent : activity%>
|
||||
<% replies_all_i = 0 %>
|
||||
<% unless activity.children.empty? %>
|
||||
<% if count > 0 %>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.children.reorder("created_on desc").each do |reply|%>
|
||||
|
@ -102,17 +101,10 @@
|
|||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_date(reply.created_on) %>
|
||||
<%#= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'messages', :action => 'destroy', :id => reply.id, :board_id => reply.board_id, :is_board => 'false'},
|
||||
:method => :post,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete),
|
||||
:class => 'replyGrey fr ml10'
|
||||
) if reply.course_destroyable_by?(User.current) %>
|
||||
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>-->
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word"><%= reply.content.html_safe %></div>
|
||||
<div class="homepagePostReplyContent break_word">
|
||||
<%= reply.content.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
|
|
@ -18,29 +18,26 @@
|
|||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_date(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img" id="activity_description_<%= user_activity_id %>">通知描述:<%= activity.description.html_safe %></div>
|
||||
|
||||
<div class="homepagePostSetting none" id="act-<%= user_activity_id %>">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="homepagePostIntro break_word upload_img" id="activity_description_<%= user_activity_id %>">
|
||||
通知描述:
|
||||
<%= activity.description.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count=activity.comments_count %>
|
||||
<div class="homepagePostReplyBannerCount">回复(<%= count %>)</div>
|
||||
<% count=activity.comments.count %>
|
||||
<div class="homepagePostReplyBannerCount">
|
||||
回复(<%= count %>)
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<%if count>2 %>
|
||||
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >点击展开更多回复(<%= count.to_s%>)</a></div>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
点击展开更多回复(<%= count.to_s%>)
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
@ -59,12 +56,12 @@
|
|||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% unless activity.comments.empty? %>
|
||||
<% if count > 0 %>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.comments.reorder("created_on desc").each do |comment| %>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 2 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "45", :height => "45"), user_path(comment.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
</div>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %>
|
||||
<span class='<%= get_issue_priority(activity.priority_id)[0] %>'><%= get_issue_priority(activity.priority_id)[1] %></span>
|
||||
<span class='<%= get_issue_priority(activity.priority_id)[0] %>'>
|
||||
<%= get_issue_priority(activity.priority_id)[1] %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostAssignTo">指派给
|
||||
|
@ -26,7 +28,10 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostDeadline">时间:<%=format_date(activity.created_on) %></div>
|
||||
<div class="homepagePostDeadline">
|
||||
时间:
|
||||
<%=format_date(activity.created_on) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img" id="activity_description_<%= user_activity_id %>">缺陷描述:
|
||||
<% if activity.description? %>
|
||||
|
@ -55,30 +60,21 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostSetting" id="act-<%=user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReply">
|
||||
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count=activity.journals.count %>
|
||||
<% count = activity.journals.count %>
|
||||
<div class="homepagePostReplyBannerCount">回复(<%= count %>)</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<% if count>2 %>
|
||||
<% if count > 2 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">点击展开更多回复(<%= count.to_s %>
|
||||
)</a></div>
|
||||
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
||||
点击展开更多回复(<%= count.to_s %>)
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
@ -97,11 +93,11 @@
|
|||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% unless activity.journals.empty? %>
|
||||
<% if count > 0 %>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.journals.reorder("created_on desc").each do |reply| %>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
<% replies_all_i=replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "45", :height => "45"), user_path(reply.user_id), :alt => "用户头像" %>
|
||||
|
@ -114,15 +110,17 @@
|
|||
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_date(reply.created_on) %>
|
||||
|
||||
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>-->
|
||||
</div>
|
||||
<% if reply.details.any? %>
|
||||
<% details_to_strings(reply.details).each do |string| %>
|
||||
<div class="homepagePostReplyContent break_word"><%= string %></div>
|
||||
<div class="homepagePostReplyContent break_word">
|
||||
<%= string %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="homepagePostReplyContent break_word"><%= reply.notes.html_safe %></div>
|
||||
<div class="homepagePostReplyContent break_word">
|
||||
<%= reply.notes.html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -33,30 +33,19 @@
|
|||
<%= activity.parent.content.to_s.html_safe%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner"><% count=0 %>
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count = 0 %>
|
||||
<div class="homepagePostReplyBannerCount">回复(
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% count=activity.replies_count%>
|
||||
<%=count %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.parent.replies_count%>
|
||||
<%=count %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<%=count %>
|
||||
)</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||
<%if count>2 %>
|
||||
|
@ -81,7 +70,7 @@
|
|||
|
||||
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
||||
<% replies_all_i = 0 %>
|
||||
<% unless activity.children.empty? %>
|
||||
<% if count > 0 %>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.children.reorder("created_on desc").each do |reply| %>
|
||||
|
@ -98,15 +87,6 @@
|
|||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_date(reply.created_on) %>
|
||||
<%#= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'messages', :action => 'destroy', :id => reply.id, :board_id => reply.board_id, :is_board => 'false'},
|
||||
:method => :post,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete),
|
||||
:class => 'replyGrey fr ml10'
|
||||
) if reply.course_destroyable_by?(User.current) %>
|
||||
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>-->
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word"><%= reply.content.html_safe %></div>
|
||||
</div>
|
||||
|
|
|
@ -61,4 +61,4 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<input type="hidden" value="<%= page%>"/>
|
||||
<%= link_to "点击展开更多",user_activities_path(@user.id),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<%= link_to "点击展开更多",user_activities_path(@user.id,:type => type),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||
<%= javascript_include_tag 'homework','baiduTemplate' %>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||
<%= javascript_include_tag 'homework','baiduTemplate' %>
|
||||
<% end %>
|
||||
|
||||
<div class="HomeWorkCon">
|
||||
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="homework_editor" style="display: none"></div>
|
||||
<div id="homework_editor" style="display: none">
|
||||
<div class="mt10">
|
||||
<% if edit_mode %>
|
||||
<%= f.kindeditor :description, :editor_id => 'homework_description_editor', :height => "150px", :owner_id => homework.id, :owner_type => OwnerTypeHelper::HOMEWORKCOMMON %>
|
||||
|
@ -41,53 +41,47 @@
|
|||
</div>
|
||||
|
||||
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick=" submit_comm_homework('new_homework_common');">发送</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<a href="javascript:void(0);" class=" fr mr10 mt3" onclick="reset_homework();">取消</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick=" submit_comm_homework('new_homework_common');">发送</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<a href="javascript:void(0);" class=" fr mr10 mt3" onclick="reset_homework();">取消</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" class=" fl DropBtn">编程选项</a>
|
||||
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" class=" fl DropBtn">编程选项</a>
|
||||
<div class="DropLine"></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="advanced_option" style="display:none;">
|
||||
<div class="advanced_option" style="display:none;">
|
||||
<div class="mt10">
|
||||
<select class="InputBox W120" name="program[language]">
|
||||
<option value="1" selected>C语言</option>
|
||||
<option value="2">C++</option>
|
||||
</select>
|
||||
<select class="InputBox W120" name="program[language]">
|
||||
<option value="1" selected>C语言</option>
|
||||
<option value="2">C++</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" name="program[input][]"></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出" name="program[output][]"></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<div class="cl"></div>
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" name="program[input][]"></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出" name="program[output][]"></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="homework_type" value="1">
|
||||
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="homework_type" value="1">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<script id="t:test-answer-list" type="text/html">
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" required name="program[input][]"></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出" required name="program[output][]"></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a>
|
||||
<div class="cl"></div>
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" required name="program[input][]"></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出" required name="program[output][]"></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function (){
|
||||
$("#course_id").append("<option value='-1' id='option_select' hidden selected>请选择发布作业的课程</option>");
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -37,4 +37,4 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0} %>
|
||||
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type} %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',:locals => {:user_activities => @user_activities, :page => @page} )%>");
|
||||
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',:locals => {:user_activities => @user_activities, :page => @page,:type => @type} )%>");
|
||||
<% if @user_activities.count < 10%>
|
||||
$("#show_more_activities").hide();
|
||||
<% end%>
|
||||
|
|
|
@ -12,15 +12,13 @@
|
|||
|
||||
}
|
||||
</script>
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="NewsBannerName">作业</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<!-- 老师身份才可以发布作业 -->
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="NewsBannerName">发布作业</div>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="HomeWork mb10">
|
||||
<% homework = HomeworkCommon.new %>
|
||||
<%= labelled_form_for homework,:url => user_new_homework_users_path,:method => "post" do |f| %>
|
||||
|
@ -29,12 +27,6 @@
|
|||
</div>
|
||||
<% end%>
|
||||
</div><!----HomeWork end-->
|
||||
|
||||
<%else%>
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="NewsBannerName">作业</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
|
||||
<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homework_commons,:page => 0} %>
|
||||
|
|
|
@ -5,3 +5,4 @@ $("#homework_end_time").val("<%= @homework.end_time%>");
|
|||
$("#course_id").val("<%= @homework.course_id%>");
|
||||
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework })%>");
|
||||
homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>");
|
||||
$("#homework_editor").show();
|
||||
|
|
Loading…
Reference in New Issue