Merge branch 'cxt_course' into szzh
This commit is contained in:
commit
219755e4d4
|
@ -2,6 +2,7 @@
|
|||
class PollController < ApplicationController
|
||||
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll]
|
||||
before_filter :find_container, :only => [:new,:create, :index]
|
||||
before_filter :is_logged, :only => [:index, :show, :poll_result,:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll,:commit_answer,:commit_poll,:statistics_result]
|
||||
before_filter :is_member_of_course, :only => [:index,:show,:poll_result]
|
||||
before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll]
|
||||
include PollHelper
|
||||
|
@ -503,6 +504,10 @@ class PollController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def is_logged
|
||||
redirect_to signin_path unless User.current.logged?
|
||||
end
|
||||
|
||||
def is_member_of_course
|
||||
render_403 unless(@course && (User.current.member_of_course?(@course) || User.current.admin?))
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ class PraiseTreadController < ApplicationController
|
|||
end
|
||||
return
|
||||
end
|
||||
#@horizontal = params[:horizontal].downcase == "false" ? false:true
|
||||
@horizontal = params[:horizontal].downcase == "false" ? false:true if params[:horizontal]
|
||||
if @obj.respond_to?("author_id")
|
||||
author_id = @obj.author_id
|
||||
elsif @obj.respond_to?("user_id")
|
||||
|
@ -103,30 +103,36 @@ class PraiseTreadController < ApplicationController
|
|||
def find_object_by_type_and_id(type,id)
|
||||
@obj = nil
|
||||
case type
|
||||
when 'User'
|
||||
@obj = User.find_by_id(id)
|
||||
when 'Issue'
|
||||
@obj = Issue.find_by_id(id)
|
||||
when 'Project'
|
||||
@obj = Project.find_by_id(id)
|
||||
when 'Bid'
|
||||
@obj = Bid.find_by_id(id)
|
||||
when 'Contest'
|
||||
@obj = Contest.find_by_id(id)
|
||||
when 'Memo'
|
||||
@obj = Memo.find_by_id(id)
|
||||
when 'Message'
|
||||
@obj = Message.find_by_id(id)
|
||||
when 'HomeworkCommon'
|
||||
@obj = HomeworkCommon.find_by_id(id)
|
||||
when 'JournalsForMessage'
|
||||
@obj = JournalsForMessage.find_by_id(id)
|
||||
when 'News'
|
||||
@obj = News.find_by_id(id)
|
||||
when 'Comment'
|
||||
@obj = Comment.find_by_id(id)
|
||||
when 'Journal'
|
||||
@obj = Journal.find_by_id(id)
|
||||
when 'Memo'
|
||||
@obj = Memo.find_by_id(id)
|
||||
when 'Message'
|
||||
@obj = Message.find_by_id(id)
|
||||
when 'HomeworkCommon'
|
||||
@obj = HomeworkCommon.find_by_id(id)
|
||||
when 'JournalsForMessage'
|
||||
@obj = JournalsForMessage.find_by_id(id)
|
||||
when 'News'
|
||||
@obj = News.find_by_id(id)
|
||||
when 'Comment'
|
||||
@obj = Comment.find_by_id(id)
|
||||
when 'Journal'
|
||||
@obj = Journal.find_by_id(id)
|
||||
when 'BlogComment'
|
||||
@obj = BlogComment.find_by_id(id)
|
||||
when 'OrgDocumentComment'
|
||||
@obj = OrgDocumentComment.find_by_id(id)
|
||||
when 'User'
|
||||
@obj = User.find_by_id(id)
|
||||
when 'Issue'
|
||||
@obj = Issue.find_by_id(id)
|
||||
when 'Project'
|
||||
@obj = Project.find_by_id(id)
|
||||
when 'Bid'
|
||||
@obj = Bid.find_by_id(id)
|
||||
when 'Contest'
|
||||
@obj = Contest.find_by_id(id)
|
||||
else
|
||||
@obj = nil
|
||||
end
|
||||
return @obj
|
||||
end
|
||||
|
@ -143,7 +149,8 @@ class PraiseTreadController < ApplicationController
|
|||
# end
|
||||
|
||||
#再创建或更新praise_tread_cache表
|
||||
@ptc = PraiseTreadCache.find_by_object_id_and_object_type(id,type)
|
||||
#@ptc = PraiseTreadCache.find_by_object_id_and_object_type(id,type)
|
||||
@ptc = PraiseTreadCache.where("object_id = ? and object_type = ?",id.to_i,type).first
|
||||
@ptc = @ptc.nil? ? PraiseTreadCache.new : @ptc
|
||||
@ptc.object_id = id.to_i
|
||||
@ptc.object_type = type
|
||||
|
|
|
@ -746,14 +746,34 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
# end
|
||||
jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
if params[:type].present?
|
||||
case params[:type]
|
||||
when "public"
|
||||
jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 0').order('created_on DESC')
|
||||
@jour_count = jours.count
|
||||
@jour = jours.limit(10).offset(@page * 10)
|
||||
when "private"
|
||||
jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 1').order('created_on DESC')
|
||||
@jour_count = jours.count
|
||||
@jour = jours.limit(10).offset(@page * 10)
|
||||
else
|
||||
jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
|
||||
@jour_count = jours.count
|
||||
@jour = jours.limit(10).offset(@page * 10)
|
||||
end
|
||||
else
|
||||
jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
|
||||
@jour_count = jours.count
|
||||
@jour = jours.limit(10).offset(@page * 10)
|
||||
end
|
||||
@type = params[:type]
|
||||
if User.current == @user
|
||||
jours.update_all(:is_readed => true, :status => false)
|
||||
jours.each do |journal|
|
||||
fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
|
||||
end
|
||||
end
|
||||
@jour = paginateHelper jours,10
|
||||
@state = false
|
||||
render :layout=>'new_base_user'
|
||||
end
|
||||
|
|
|
@ -225,11 +225,11 @@ class WordsController < ApplicationController
|
|||
def leave_user_message
|
||||
if User.current.logged?
|
||||
@user = User.find(params[:id])
|
||||
if params[:new_form][:user_message].size>0 && User.current.logged? && @user
|
||||
if params[:new_form][:content].size>0 && User.current.logged? && @user
|
||||
if params[:private] && params[:private] == '1'
|
||||
@user.journals_for_messages << JournalsForMessage.new(:user_id => User.current.id, :notes => params[:new_form][:user_message], :reply_id => 0, :status => true, :is_readed => false, :private => 1)
|
||||
@user.journals_for_messages << JournalsForMessage.new(:user_id => User.current.id, :notes => params[:new_form][:content], :reply_id => 0, :status => true, :is_readed => false, :private => 1)
|
||||
else
|
||||
@user.add_jour(User.current, params[:new_form][:user_message])
|
||||
@user.add_jour(User.current, params[:new_form][:content])
|
||||
end
|
||||
end
|
||||
redirect_to feedback_path(@user)
|
||||
|
|
|
@ -2789,13 +2789,6 @@ int main(int argc, char** argv){
|
|||
ss.html_safe
|
||||
end
|
||||
|
||||
#代码提交数量
|
||||
def changesets_num project
|
||||
g = Gitlab.client
|
||||
project.gpid.nil? ? 0 : g.project(project.gpid).commit_count
|
||||
# project.changesets.count
|
||||
end
|
||||
|
||||
#课程动态的更新
|
||||
def update_course_activity type, id
|
||||
course_activity = CourseActivity.where("course_act_type=? and course_act_id =?", type.to_s, id).first
|
||||
|
@ -2836,4 +2829,13 @@ end
|
|||
principal_activity.save
|
||||
end
|
||||
end
|
||||
|
||||
#项目按更新时间排序
|
||||
def project_sort_update projects
|
||||
unless projects.empty?
|
||||
project_ids = '('+projects.map{|pro|pro.project_id}.join(',')+')'
|
||||
sort_projects = ForgeActivity.find_by_sql("SELECT MAX(updated_at) AS updated_at,user_id, project_id FROM forge_activities WHERE project_id IN #{project_ids} GROUP BY project_id ORDER BY MAX(updated_at) DESC")
|
||||
return sort_projects
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
require 'elasticsearch/model'
|
||||
class Course < ActiveRecord::Base
|
||||
include Redmine::SafeAttributes
|
||||
include ApplicationHelper
|
||||
|
||||
STATUS_ACTIVE = 1
|
||||
STATUS_CLOSED = 5
|
||||
|
@ -71,7 +70,7 @@ class Course < ActiveRecord::Base
|
|||
validates_length_of :description, :maximum => 10000
|
||||
before_save :self_validate
|
||||
# 公开课程变成私有课程,所有资源都变成私有
|
||||
after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity
|
||||
after_update :update_files_public,:update_course_ealasticsearch_index
|
||||
after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index
|
||||
before_destroy :delete_all_members,:delete_course_ealasticsearch_index
|
||||
|
||||
|
@ -429,12 +428,6 @@ class Course < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
end
|
||||
#动态的更新
|
||||
def update_activity
|
||||
update_course_activity(self.class, self.id)
|
||||
update_user_activity(self.class, self.id)
|
||||
update_org_activity(self.class, self.id)
|
||||
end
|
||||
|
||||
# Delete the previous articles index in Elasticsearch
|
||||
# Course.__elasticsearch__.client.indices.delete index: Course.index_name rescue nil
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="break_word">
|
||||
<span class="fl">
|
||||
<span title="<%= attachment.filename %>" id="attachment_<%=attachment.id %>">
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'mw400 hidden link_file_a fl newsBlue', :download => true -%>
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw400', :download => true -%>
|
||||
</span>
|
||||
</span>
|
||||
<span class="postAttSize">(
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hiddent_alert_model();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("width","511");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("width","511").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("alert_praise");
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms', locals: { bid: @bid, totle_size:@totle_size, cur_size:@cur_size, percent:@percent}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
//$('#ajax-modal').css('height','180px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms', locals: { bid: @bid, totle_size:@totle_size, cur_size:@cur_size, percent:@percent}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
//$('#ajax-modal').css('height','180px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
|
@ -116,9 +116,18 @@
|
|||
<% count=@article.children.count%>
|
||||
<% end %>
|
||||
<div class="homepagePostReply">
|
||||
<% unless count == 0 %>
|
||||
<%# unless count == 0 %>
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复(<%=count %>)</div>
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=@article.id %>">
|
||||
<% if @article.author == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(@article) > 0 ? "(#{get_praise_num(@article)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@article, :user_activity_id=>@article.id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"></div>
|
||||
<!-- <div class="homepagePostReplyBannerMore">
|
||||
<%# if @reply_count > 2%>
|
||||
|
@ -150,7 +159,14 @@
|
|||
</div>
|
||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||
<%= format_time(reply.created_on) %>
|
||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.author == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="fr mr10" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'blog_comments',:action => 'quote',:user_id=>reply.author_id,:blog_id=>reply.blog_id, :id => reply.id},
|
||||
|
@ -175,7 +191,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
<%# end %>
|
||||
<div class="cl"></div>
|
||||
<% if !@article.locked? && User.current.logged?%>
|
||||
<div class="talkWrapMsg" nhname="about_talk_reply">
|
||||
|
|
|
@ -123,11 +123,17 @@
|
|||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="topBorder" style="display: <%= count<=0 && !activity.locked ? '': 'none' %>"></div>
|
||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
|
||||
<%= count %>
|
||||
)</div>
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||
<%if count > 3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
|
@ -162,6 +168,13 @@
|
|||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.author == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img" id="reply_content_<%= reply.id %>">
|
||||
<%= reply.content.html_safe %>
|
||||
|
@ -201,5 +214,13 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
$("#moreProject_<%=user_activity_id %>").click(function(){
|
||||
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
|
||||
$("#relatePWrap_<%=user_activity_id %>").css("height","auto");
|
||||
$(this).hide();
|
||||
});
|
||||
$("#hideProject_<%=user_activity_id %>").click(function(){
|
||||
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
|
||||
$("#moreProject_<%=user_activity_id %>").show();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -7,5 +7,5 @@ $('#ajax-modal').siblings().hide();
|
|||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||
"<a href='javascript:' onclick='hidden_join_course_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/new_join', locals: { :course => @course}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').css('height','100px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/new_join', locals: { :course => @course}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').css('height','100px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
}
|
||||
$("#time_selected").click(select);
|
||||
|
|
|
@ -9,5 +9,5 @@ $('#ajax-modal').siblings().remove();
|
|||
$('#ajax-modal').before("<span>" +
|
||||
"<a href='javascript:void(0)' onclick='hidden_homework_score_form();'><img src='/images/bid/close.png' width='26px' height='26px' style='margin-left: 375px;' /></a></span>");
|
||||
//$('#ajax-modal').parent().removeClass();
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","40%").css("position","fixed");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","40%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("new-watcher");
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
<%= form_for('',
|
||||
:html => { :multipart => true },
|
||||
:url => {:controller => 'exercise',
|
||||
:action => 'commit_exercise',
|
||||
:id => exercise.id
|
||||
},:remote=>true ) do |f| %>
|
||||
<div class="ur_buttons">
|
||||
<a class="ur_button_submit" onclick="poll_submit();"> 提交 </a>
|
||||
<div class="polls_cha">
|
||||
<%= f.check_box 'show_result', :value => exercise.show_result%>
|
||||
<%= label_tag '_show_result', '允许学生查看测验结果' %>
|
||||
<!--<input name="exercise[show_result]" value="<%#exercise.show_result %>" type="checkbox" checked="true">
|
||||
<label for="">允许学生查看测验结果</label>-->
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
function poll_submit() {
|
||||
var question_form = $("form.new_exercise_question");
|
||||
if($("#polls_head_edit").is(":visible")){
|
||||
alert("请先保存测验标题及测验基本信息。");
|
||||
} else if(question_form.length > 0) {
|
||||
alert("请先保存正在编辑的题目。");
|
||||
} else{
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'exercise_submit_info', locals: { :exercise => exercise}) %>');
|
||||
showModal('ajax-modal', '400px');
|
||||
//$('#ajax-modal').css('height','120px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
}
|
||||
<%= form_for('',
|
||||
:html => { :multipart => true },
|
||||
:url => {:controller => 'exercise',
|
||||
:action => 'commit_exercise',
|
||||
:id => exercise.id
|
||||
},:remote=>true ) do |f| %>
|
||||
<div class="ur_buttons">
|
||||
<a class="ur_button_submit" onclick="poll_submit();"> 提交 </a>
|
||||
<div class="polls_cha">
|
||||
<%= f.check_box 'show_result', :value => exercise.show_result%>
|
||||
<%= label_tag '_show_result', '允许学生查看测验结果' %>
|
||||
<!--<input name="exercise[show_result]" value="<%#exercise.show_result %>" type="checkbox" checked="true">
|
||||
<label for="">允许学生查看测验结果</label>-->
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
function poll_submit() {
|
||||
var question_form = $("form.new_exercise_question");
|
||||
if($("#polls_head_edit").is(":visible")){
|
||||
alert("请先保存测验标题及测验基本信息。");
|
||||
} else if(question_form.length > 0) {
|
||||
alert("请先保存正在编辑的题目。");
|
||||
} else{
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'exercise_submit_info', locals: { :exercise => exercise}) %>');
|
||||
showModal('ajax-modal', '400px');
|
||||
//$('#ajax-modal').css('height','120px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -1,8 +1,8 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status,:exercise =>@exercise}) %>');
|
||||
showModal('ajax-modal', '270px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hidden_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status,:exercise =>@exercise}) %>');
|
||||
showModal('ajax-modal', '270px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hidden_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
|
@ -25,7 +25,7 @@
|
|||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@
|
|||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index =>@index}) %>");
|
||||
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>");
|
||||
showModal('ajax-modal', '250px');
|
||||
//$('#ajax-modal').css('height','111px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index =>@index}) %>");
|
||||
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>");
|
||||
showModal('ajax-modal', '250px');
|
||||
//$('#ajax-modal').css('height','111px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("poll_alert_form");
|
|
@ -1,10 +1,10 @@
|
|||
$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index => @index}) %>");
|
||||
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>");
|
||||
showModal('ajax-modal', '250px');
|
||||
//$('#ajax-modal').css('height','80px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index => @index}) %>");
|
||||
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>");
|
||||
showModal('ajax-modal', '250px');
|
||||
//$('#ajax-modal').css('height','80px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("poll_alert_form");
|
|
@ -40,7 +40,7 @@
|
|||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
|
@ -1,11 +1,11 @@
|
|||
<% if @can_quote %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => ''}) %>');
|
||||
<% else %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => '403'}) %>');
|
||||
<% end %>
|
||||
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
<% if @can_quote %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => ''}) %>');
|
||||
<% else %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => '403'}) %>');
|
||||
<% end %>
|
||||
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
|
@ -7,5 +7,5 @@
|
|||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","35%");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","35%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
|
@ -1,6 +1,6 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
|
@ -3,13 +3,13 @@
|
|||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
<% elsif @course %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_course_files',:locals => {:course => @course,:course_attachment_type => 1}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
<% end %>
|
|
@ -1,10 +1,10 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show') %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').css('height','569px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||
"<a href='javascript:void(0)' onclick='hidden_homework_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
||||
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show') %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').css('height','569px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||
"<a href='javascript:void(0)' onclick='hidden_homework_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms') %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed");
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms') %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
|
|
@ -1,6 +1,6 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity => @course_activity}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed");
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity => @course_activity}) %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
|
|
@ -3,4 +3,4 @@ showModal('ajax-modal', '350px');
|
|||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
|
|
@ -4,7 +4,7 @@ showModal('ajax-modal', '350px');
|
|||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
$(function() { $('#evaluation_start_time').datepicker(datepickerOptions);
|
||||
$('#evaluation_end_time').datepicker(datepickerOptions);
|
||||
});
|
|
@ -70,12 +70,11 @@
|
|||
<div class="cl"></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id %>' name="notes"></textarea>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10 fl">
|
||||
<div class="mt5 fl">
|
||||
<%= render :partial => 'attachments/issue_reply', :locals => {:container => @issue} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span nhname='contentmsg_<%= @issue.id %>' class="fl"></span>
|
||||
<a id="new_message_submit_btn_<%= @issue.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<a id="new_message_submit_btn_<%= @issue.id %>" href="javascript:void(0)" class="blue_n_btn fr mt5" style="display:none;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
@ -83,4 +82,5 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -126,7 +126,8 @@
|
|||
<%# 工具栏展开 %>
|
||||
<% if @course.homework_commons.count == 0 || @course.news.count == 0 || course_file_num == 0 || course_poll_count == 0 || @course.exercises.count == 0 ||
|
||||
course_feedback_count == 0 || @course.exercises.count == 0 || (@course.boards.first ? @course.boards.first.topics.count : 0) == 0 %>
|
||||
<div class="subNav subNav_jiantou" id="expand_tools_expand" nhtype="toggle4cookiecourse" data-id="expand_tool_more" data-target="#navContentCourse" data-val="retract"><%= l(:label_project_more) %></div>
|
||||
|
||||
<div class="subNav subNav_jiantou" id="expand_tools_expand"><%= l(:label_project_more) %></div>
|
||||
<ul class="navContent" id="navContentCourse">
|
||||
<%= render 'courses/tool_expand', :locals => {:is_teacher => is_teacher, :course_file_num => course_file_num} %>
|
||||
</ul>
|
||||
|
@ -278,7 +279,7 @@
|
|||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
// 鼠标经过的时候显示内容
|
||||
|
@ -292,6 +293,9 @@
|
|||
obj.parent().parent().next("div").hide();
|
||||
}
|
||||
|
||||
$("#expand_tools_expand").click(function(){
|
||||
$("#navContentCourse").toggle();
|
||||
});
|
||||
</script>
|
||||
|
||||
</html>
|
|
@ -242,9 +242,13 @@
|
|||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
$("#expand_tools_expand").click(function(){
|
||||
$("#navContent").toggle();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
$("img[nhname='avatar_image']").attr('src',$("#nh_user_tx").attr('src'));
|
||||
$('#ajax-modal').html($("#nh_tx_dialog_html").html());
|
||||
showModal('ajax-modal','460px');
|
||||
$('#ajax-modal').siblings().hide();
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
//$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
||||
$('#ajax-modal').parent().css("border", "2px solid #15bccf").css("border-radius", "0").css(" -webkit-border-radius", "0").css(" -moz-border-radius", "0");
|
||||
$("img[nhname='avatar_image']").attr('src',$("#nh_user_tx").attr('src'));
|
||||
$('#ajax-modal').html($("#nh_tx_dialog_html").html());
|
||||
showModal('ajax-modal','460px');
|
||||
$('#ajax-modal').siblings().hide();
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
//$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
||||
$('#ajax-modal').parent().css("border", "3px solid #269ac9").css("border-radius", "0").css(" -webkit-border-radius", "0").css(" -moz-border-radius", "0");
|
|
@ -65,9 +65,18 @@
|
|||
<% count = @document.children.count() %>
|
||||
|
||||
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= @document.id %>">
|
||||
<% if count > 0 %>
|
||||
<%# if count > 0 %>
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复(<%= count %>)</div>
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=@document.id %>">
|
||||
<% if @document.creator_id.to_i == User.current.id.to_i %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(@document) > 0 ? "(#{get_praise_num(@document)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@document, :user_activity_id=>@document.id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="" id="reply_div_<%= @document.id %>">
|
||||
<% comments_for_doc.each_with_index do |reply,i| %>
|
||||
|
@ -88,13 +97,20 @@
|
|||
</div>
|
||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||
<%= format_time(reply.created_at) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.creator_id.to_i == User.current.id.to_i %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'org_document_comments',:action => 'quote',:user_id=>reply.creator_id, :id => reply.id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:class => 'fr newsBlue',
|
||||
:class => 'fr newsBlue mr10',
|
||||
:title => l(:button_reply)) if User.current.logged? %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
|
@ -113,7 +129,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<%# end %>
|
||||
<% if User.current.logged?%>
|
||||
<div class="talkWrapMsg" nhname="about_talk_reply">
|
||||
<em class="talkWrapArrow"></em>
|
||||
|
|
|
@ -1,96 +1,96 @@
|
|||
<script>
|
||||
function searchone4reload(fileid){
|
||||
var url = "<%= searchone4reload_course_files_path(@course)%>";
|
||||
var data = {};data.fileid=fileid;
|
||||
$.ajax({
|
||||
url:url,dataType:'text',data:data,success:function(text){
|
||||
var container_file_div = $("#container_files_"+fileid);
|
||||
container_file_div.after(text);
|
||||
container_file_div.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
function show_upload(obj)
|
||||
{
|
||||
switch(obj)
|
||||
{
|
||||
case 1:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 1}) %>');
|
||||
break;
|
||||
case 2:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 2}) %>');
|
||||
break;
|
||||
case 3:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 3}) %>');
|
||||
break;
|
||||
case 4:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 4}) %>');
|
||||
break;
|
||||
case 6:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 6}) %>');
|
||||
break;
|
||||
default:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 5}) %>');
|
||||
}
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
function closeModal()
|
||||
{
|
||||
hideModal($("#popbox_upload"));
|
||||
}
|
||||
|
||||
function presscss(id)
|
||||
{
|
||||
if(id == "incourse")
|
||||
{
|
||||
$('#incourse').attr("class", "re_schbtn b_dblue");
|
||||
$('#insite').attr("class", "re_schbtn b_lblue");
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#incourse').attr("class", "re_schbtn b_lblue");
|
||||
$('#insite').attr("class", "re_schbtn b_dblue");
|
||||
}
|
||||
}
|
||||
function buttoncss()
|
||||
{
|
||||
$('#incourse').attr("class", "re_schbtn b_lblue");
|
||||
$('#insite').attr("class", "re_schbtn b_lblue");
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
<div class="resource"><!--资源库内容开始--->
|
||||
<div class="re_top">
|
||||
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %>
|
||||
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
|
||||
<%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %>
|
||||
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
|
||||
<% end %>
|
||||
<% if is_course_teacher(User.current,@course) || (@course.publish_resource==1 && User.current.member_of_course?(@course) ) %> <!-- show_window('light','fade','20%','35%')-->
|
||||
<!--<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>-->
|
||||
<p class="c_grey fr mt10 mr5">
|
||||
上传:
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(1);">课件</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(2);">软件</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(3);">媒体</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(4);">代码</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(6);">论文</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(5);">其他</a>
|
||||
</p>
|
||||
<% end %>
|
||||
</div><!---re_top end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="re_con" id="course_list">
|
||||
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
|
||||
</div><!---re_con end-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function searchone4reload(fileid){
|
||||
var url = "<%= searchone4reload_course_files_path(@course)%>";
|
||||
var data = {};data.fileid=fileid;
|
||||
$.ajax({
|
||||
url:url,dataType:'text',data:data,success:function(text){
|
||||
var container_file_div = $("#container_files_"+fileid);
|
||||
container_file_div.after(text);
|
||||
container_file_div.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
function show_upload(obj)
|
||||
{
|
||||
switch(obj)
|
||||
{
|
||||
case 1:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 1}) %>');
|
||||
break;
|
||||
case 2:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 2}) %>');
|
||||
break;
|
||||
case 3:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 3}) %>');
|
||||
break;
|
||||
case 4:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 4}) %>');
|
||||
break;
|
||||
case 6:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 6}) %>');
|
||||
break;
|
||||
default:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 5}) %>');
|
||||
}
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
function closeModal()
|
||||
{
|
||||
hideModal($("#popbox_upload"));
|
||||
}
|
||||
|
||||
function presscss(id)
|
||||
{
|
||||
if(id == "incourse")
|
||||
{
|
||||
$('#incourse').attr("class", "re_schbtn b_dblue");
|
||||
$('#insite').attr("class", "re_schbtn b_lblue");
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#incourse').attr("class", "re_schbtn b_lblue");
|
||||
$('#insite').attr("class", "re_schbtn b_dblue");
|
||||
}
|
||||
}
|
||||
function buttoncss()
|
||||
{
|
||||
$('#incourse').attr("class", "re_schbtn b_lblue");
|
||||
$('#insite').attr("class", "re_schbtn b_lblue");
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
<div class="resource"><!--资源库内容开始--->
|
||||
<div class="re_top">
|
||||
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %>
|
||||
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
|
||||
<%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %>
|
||||
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
|
||||
<% end %>
|
||||
<% if is_course_teacher(User.current,@course) || (@course.publish_resource==1 && User.current.member_of_course?(@course) ) %> <!-- show_window('light','fade','20%','35%')-->
|
||||
<!--<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>-->
|
||||
<p class="c_grey fr mt10 mr5">
|
||||
上传:
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(1);">课件</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(2);">软件</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(3);">媒体</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(4);">代码</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(6);">论文</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(5);">其他</a>
|
||||
</p>
|
||||
<% end %>
|
||||
</div><!---re_top end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="re_con" id="course_list">
|
||||
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
|
||||
</div><!---re_con end-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<% html_title(l(:label_attachment_plural)) -%>
|
|
@ -17,13 +17,9 @@
|
|||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl">
|
||||
<div class="homepagePostDate">
|
||||
创建时间:<%= format_time(activity.created_at) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
|
|
|
@ -1,313 +1,349 @@
|
|||
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
|
||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% end %> TO <!--+"(课程名称)" -->
|
||||
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle hidden m_w505 fl"> <!--+"(作业名称)"-->
|
||||
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey"%>
|
||||
</div>
|
||||
<% if activity.homework_detail_manual%>
|
||||
<% if activity.homework_detail_manual.comment_status == 1%>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<span class="grey_homework_btn_cir ml5">未开启匿评</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<% if Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
|
||||
<span class="green_homework_btn_cir ml5">作品提交中</span>
|
||||
<% elsif Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
|
||||
<span class="red_homework_btn_cir ml5">作品补交中</span>
|
||||
<% end %>
|
||||
<% elsif activity.homework_detail_manual.comment_status == 2%>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<span class="green_homework_btn_cir ml5">匿评中</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
||||
<% elsif activity.homework_detail_manual.comment_status == 3%>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已结束</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
||||
<% end%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
|
||||
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
|
||||
<% end %>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%>
|
||||
<% projects = cur_user_projects_for_homework activity %>
|
||||
<% works = cur_user_works_for_homework activity %>
|
||||
<% if works.nil? && projects.nil? %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
|
||||
<%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %>
|
||||
</div>
|
||||
<% elsif works.nil? %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="homepagePostSubmit">
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
|
||||
<%= user_for_homework_common activity,is_teacher %>
|
||||
</div>
|
||||
|
||||
<% if activity.homework_type == 2 && is_teacher%>
|
||||
<div class="homepagePostSubmit">
|
||||
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.homework_type == 2%>
|
||||
<div class="homepagePostDeadline mr15">
|
||||
语言:
|
||||
<%= activity.language_name%>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group%>
|
||||
<div class="homepagePostDeadline mr15">
|
||||
分组人数:<%=activity.homework_detail_group.min_num %>-<%=activity.homework_detail_group.max_num %> 人
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.homework_detail_manual && activity.homework_detail_manual.comment_status < 2 %>
|
||||
<div class="homepagePostDeadline">提交截止时间:<%= activity.end_time.to_s %> 23:59</div>
|
||||
<% elsif activity.homework_detail_manual && activity.homework_detail_manual.comment_status >= 2 %>
|
||||
<div class="homepagePostDeadline">匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %> 23:59</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<div class="homepagePostDeadline">
|
||||
迟交扣分:<%= activity.late_penalty%>分
|
||||
</div>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=user_activity_id %>">
|
||||
匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="homepagePostDeadline">
|
||||
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
|
||||
</div>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=user_activity_id %>">
|
||||
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if activity.student_works.count != 0 %>
|
||||
<% sw = activity.student_works.reorder("created_at desc").first %>
|
||||
<div class="mt10 homepagePostDeadline">
|
||||
<%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if activity.student_works.count != 0 %>
|
||||
<% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %>
|
||||
<% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
||||
<% unless student_work_scores.empty? %>
|
||||
<% last_score = student_work_scores.first %>
|
||||
<div class="mt5 homepagePostDeadline">
|
||||
<%=time_from_now last_score.created_at %><%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
||||
<div class="mt10">
|
||||
<% projects = activity.student_work_projects.where("is_leader = 1") %>
|
||||
<div class="fl mr20 fontGrey3">
|
||||
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% projects.each do |pro| %>
|
||||
<% project = Project.find pro.project_id %>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#project_img_<%=project.id %>_<%=activity.id %>").mouseover(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","block");
|
||||
}).mouseout(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","none");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
|
||||
<% end %>
|
||||
<% time=project.updated_on %>
|
||||
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
|
||||
<p><%=time_from_now time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
|
||||
项目名称:<%=project.name %><br />
|
||||
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
|
||||
更新时间:<%=time_from_now time %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if is_teacher%>
|
||||
<% comment_status = activity.homework_detail_manual.comment_status %>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity), :class => "postOptionLink"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => 0),:class => "postOptionLink", :remote => true) %>
|
||||
</li>
|
||||
<% if activity.anonymous_comment == 0 %>
|
||||
<li>
|
||||
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
|
||||
</li>
|
||||
<li>
|
||||
<%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
||||
<li>
|
||||
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% count=activity.journals_for_messages.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.user == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"></div>
|
||||
<%if count>3 %>
|
||||
<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" >
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.journals_for_messages.reorder("created_on desc").each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if comment.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(comment.created_on) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.user == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
<div id="message_edit_<%=comment.id %>" style="display: none" class="mr10 fr">
|
||||
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
|
||||
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "replyGrey fr ml10", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.notes.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
|
||||
<%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
|
||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% end %> TO <!--+"(课程名称)" -->
|
||||
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle hidden m_w505 fl"> <!--+"(作业名称)"-->
|
||||
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey"%>
|
||||
</div>
|
||||
<% if activity.homework_detail_manual%>
|
||||
<% if activity.homework_detail_manual.comment_status == 1%>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<span class="grey_homework_btn_cir ml5">未开启匿评</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<% if Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
|
||||
<span class="green_homework_btn_cir ml5">作品提交中</span>
|
||||
<% elsif Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
|
||||
<span class="red_homework_btn_cir ml5">作品补交中</span>
|
||||
<% end %>
|
||||
<% elsif activity.homework_detail_manual.comment_status == 2%>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<span class="green_homework_btn_cir ml5">匿评中</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
||||
<% elsif activity.homework_detail_manual.comment_status == 3%>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已结束</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
||||
<% end%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
|
||||
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
|
||||
<% end %>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%>
|
||||
<% projects = cur_user_projects_for_homework activity %>
|
||||
<% works = cur_user_works_for_homework activity %>
|
||||
<% if works.nil? && projects.nil? %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
|
||||
<%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %>
|
||||
</div>
|
||||
<% elsif works.nil? %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="homepagePostSubmit">
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
|
||||
<%= user_for_homework_common activity,is_teacher %>
|
||||
</div>
|
||||
|
||||
<% if activity.homework_type == 2 && is_teacher%>
|
||||
<div class="homepagePostSubmit">
|
||||
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.homework_type == 2%>
|
||||
<div class="homepagePostDeadline mr15">
|
||||
语言:
|
||||
<%= activity.language_name%>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group%>
|
||||
<div class="homepagePostDeadline mr15">
|
||||
分组人数:<%=activity.homework_detail_group.min_num %>-<%=activity.homework_detail_group.max_num %> 人
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.homework_detail_manual && activity.homework_detail_manual.comment_status < 2 %>
|
||||
<div class="homepagePostDeadline">提交截止时间:<%= activity.end_time.to_s %> 23:59</div>
|
||||
<% elsif activity.homework_detail_manual && activity.homework_detail_manual.comment_status >= 2 %>
|
||||
<div class="homepagePostDeadline">匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %> 23:59</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<div class="homepagePostDeadline">
|
||||
迟交扣分:<%= activity.late_penalty%>分
|
||||
</div>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=user_activity_id %>">
|
||||
匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="homepagePostDeadline">
|
||||
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
|
||||
</div>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=user_activity_id %>">
|
||||
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if activity.student_works.count != 0 %>
|
||||
<% sw = activity.student_works.reorder("created_at desc").first %>
|
||||
<div class="mt10 homepagePostDeadline">
|
||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if activity.student_works.count != 0 %>
|
||||
<% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %>
|
||||
<% student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %>
|
||||
<%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
||||
<% unless student_work_scores.empty? %>
|
||||
<% last_score = student_work_scores.first %>
|
||||
<div class="mt10">
|
||||
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
||||
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||
</p>
|
||||
<% ids = '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
||||
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||
<% student_works.each_with_index do |sw, i| %>
|
||||
<div class="fl mr10 w100" style="text-align:center;">
|
||||
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
||||
<p class="w100 hidden"><%= link_to sw.user.show_name, student_work_index_path(:homework => activity.id)%></p>
|
||||
</a>
|
||||
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
|
||||
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score<0 ? 0 : score) %>分</span></p>
|
||||
</div>
|
||||
<% if i == 4 %>
|
||||
<% break %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
||||
<% projects = activity.student_work_projects.where("is_leader = 1") %>
|
||||
<% unless projects.empty? %>
|
||||
<% sort_projects = project_sort_update projects %>
|
||||
<div class="mt10 relatePWrap" id="relatePWrap_<%=user_activity_id %>">
|
||||
<div class="mr5 fontGrey2">
|
||||
# <%=time_from_now sort_projects.first.updated_at %><%= link_to User.find(sort_projects.first.user_id).show_name, user_activities_path(sort_projects.first.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% sort_projects.each_with_index do |pro, i| %>
|
||||
<% project = Project.find pro.project_id %>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#project_img_<%=project.id %>_<%=activity.id %>").mouseover(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","block");
|
||||
}).mouseout(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","none");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
|
||||
<% end %>
|
||||
<% time=project.updated_on %>
|
||||
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<p class="mh18"><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
|
||||
<p class="mh18"><%=time_from_now time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
|
||||
项目名称:<%=project.name %><br />
|
||||
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
|
||||
更新时间:<%=time_from_now time %>
|
||||
</div>
|
||||
</div>
|
||||
<% if i == 9 && projects.count > 10 %>
|
||||
<a href="javascript:void(0);" class="linkGrey2 fl ml50" style="margin-top:68px;" id="moreProject_<%=user_activity_id %>">更多>></a>
|
||||
<% end %>
|
||||
<% if i > 9 && i == (projects.count - 1) %>
|
||||
<a href="javascript:void(0);" class="linkGrey2 fr mr10" style="margin-top:68px;" id="hideProject_<%=user_activity_id %>">收回<<</a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if is_teacher%>
|
||||
<% comment_status = activity.homework_detail_manual.comment_status %>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity), :class => "postOptionLink"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => 0),:class => "postOptionLink", :remote => true) %>
|
||||
</li>
|
||||
<% if activity.anonymous_comment == 0 %>
|
||||
<li>
|
||||
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
|
||||
</li>
|
||||
<li>
|
||||
<%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
||||
<li>
|
||||
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% count=activity.journals_for_messages.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.user == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"></div>
|
||||
<%if count>3 %>
|
||||
<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" >
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.journals_for_messages.reorder("created_on desc").each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if comment.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(comment.created_on) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.user == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
<div id="message_edit_<%=comment.id %>" style="display: none" class="mr10 fr">
|
||||
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
|
||||
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "replyGrey fr ml10", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.notes.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
|
||||
<%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$("#moreProject_<%=user_activity_id %>").click(function(){
|
||||
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
|
||||
$("#relatePWrap_<%=user_activity_id %>").css("height","auto");
|
||||
$(this).hide();
|
||||
});
|
||||
$("#hideProject_<%=user_activity_id %>").click(function(){
|
||||
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
|
||||
$("#moreProject_<%=user_activity_id %>").show();
|
||||
});
|
||||
</script>
|
|
@ -75,7 +75,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -117,7 +117,7 @@
|
|||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.author == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
@ -157,6 +157,3 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -86,7 +86,7 @@
|
|||
<%= format_time(comment.created_on) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.author == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
@ -121,6 +121,3 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -56,6 +56,3 @@
|
|||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -97,7 +97,7 @@
|
|||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.user == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
@ -139,6 +139,3 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -96,7 +96,7 @@
|
|||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.author == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
@ -133,6 +133,3 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -19,13 +19,9 @@
|
|||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl">
|
||||
<div class="homepagePostDate">
|
||||
创建时间:<%= format_time(project.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='ProjectCreateInfo' and forge_act_id =#{project.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -97,7 +97,7 @@
|
|||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.author == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
@ -134,6 +134,3 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -60,8 +60,17 @@
|
|||
<% count = document.children.count() %>
|
||||
|
||||
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
|
||||
<div class="homepagePostReplyBanner" style="display:<%= count == 0 ? 'none' : 'block' %>">
|
||||
<div class="homepagePostReplyBannerCount">回复(<%= count %>)</div>
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=document.id %>">
|
||||
<% if document.creator_id.to_i == User.current.id.to_i %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(document) > 0 ? "(#{get_praise_num(document)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% if count > 3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
||||
|
@ -81,6 +90,13 @@
|
|||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to User.find(comment.creator_id), user_path(comment.creator_id), :class => "newsBlue mr10 f14" %>
|
||||
<%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.creator_id.to_i == User.current.id.to_i %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% unless comment.content.blank? %>
|
||||
<div class="homepagePostReplyContent"><%= comment.content.html_safe %></div>
|
||||
|
|
|
@ -1,397 +1,397 @@
|
|||
<%= stylesheet_link_tag 'polls', :media => 'all' %>
|
||||
|
||||
<script type="text/javascript">
|
||||
//编辑问卷描述之后
|
||||
var popWindow ; //弹出框的引用
|
||||
var importPollPopWindow; //选择导入的弹出框引用
|
||||
function edit_head(){
|
||||
$("#polls_description").val($("#polls_description_div").html());
|
||||
}
|
||||
$(function(){
|
||||
//点击空白处
|
||||
$(document).bind('click',function(e){
|
||||
//弹出框非空 不是a标签 点击的不是弹出框 ,那么弹出框就会隐藏
|
||||
if(popWindow && e.target.nodeName != 'A' && !popWindow.is(e.target) && popWindow.has(e.target).length === 0){ // Mark 1
|
||||
popWindow.css('display', 'none');
|
||||
}
|
||||
if(importPollPopWindow && e.target.nodeName != 'A' && !importPollPopWindow.is(e.target) && importPollPopWindow.has(e.target).length === 0){
|
||||
importPollPopWindow.css('display', 'none');
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
function dismiss(quest_type,quest_id){
|
||||
popWindow = $("#div_"+quest_type+"_"+quest_id);
|
||||
if(popWindow){
|
||||
popWindow.css('display', 'none');
|
||||
}
|
||||
}
|
||||
|
||||
function chooseQuestionType(quest_type,quest_id){
|
||||
//quest_type 分为 mc mcq single multi
|
||||
//quest_id 是quetion的id 下同
|
||||
if(popWindow){
|
||||
popWindow.css('display', 'none');
|
||||
}
|
||||
popWindow = $("#div_"+quest_type+"_"+quest_id);
|
||||
$("#div_"+quest_type+"_"+quest_id).click(function(e){
|
||||
e.stopPropagation(); //组织冒泡到document.body中去
|
||||
});
|
||||
$("#div_"+quest_type+"_"+quest_id).css("position", "absolute");
|
||||
|
||||
$("#div_"+quest_type+"_"+quest_id).css("top", $("#add_"+quest_type+"_"+quest_id).offset().top+30);
|
||||
|
||||
$("#div_"+quest_type+"_"+quest_id).css("left", $("#add_"+quest_type+"_"+quest_id).offset().left-10);
|
||||
if( $("#div_"+quest_type+"_"+quest_id).css('display') == 'block') {
|
||||
$("#div_"+quest_type+"_"+quest_id).css('display', 'none');
|
||||
}
|
||||
else{
|
||||
$("#div_"+quest_type+"_"+quest_id).css('display', 'block');
|
||||
}
|
||||
}
|
||||
|
||||
function add_MC(){
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>");
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function insert_MC(quest_type,quest_num,quest_id){
|
||||
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
|
||||
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
|
||||
' <div class="ur_editor radio"> '+
|
||||
'<div class="ur_editor_title"> '+
|
||||
'<label>问题: </label>'+
|
||||
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
|
||||
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
|
||||
'<input type="hidden" name="question_type" value="1"/>'+
|
||||
'<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入单选题标题"/>'+
|
||||
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
|
||||
'<label>必答</label>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_content">'+
|
||||
'<ul>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</ul>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_footer">'+
|
||||
'<a class="btn btn_dark btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
||||
'<%= l(:label_button_ok)%>'+
|
||||
'</a>'+
|
||||
'<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
||||
'<%= l(:button_cancel)%>'+
|
||||
'</a>'+
|
||||
'</div>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</div>'+
|
||||
'<% end%>'
|
||||
);
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function add_MCQ(){
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ') %>");
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function insert_MCQ(quest_type,quest_num,quest_id){
|
||||
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
|
||||
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
|
||||
'<div class="ur_editor checkbox">'+
|
||||
'<div class="ur_editor_title">'+
|
||||
'<label>问题: </label>'+
|
||||
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
|
||||
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
|
||||
'<input type="hidden" name="question_type" value="2"/>'+
|
||||
'<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入多选题标题"/>'+
|
||||
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
|
||||
'<label>必答</label>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_content">'+
|
||||
'<ul>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除"" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</ul>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_footer">'+
|
||||
'<a class="btn btn_dark btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
||||
'<%= l(:label_button_ok)%>'+
|
||||
'</a>'+
|
||||
'<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
||||
'<%= l(:button_cancel)%>'+
|
||||
'</a>'+
|
||||
'</div>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</div>'+
|
||||
'<% end%>'
|
||||
);
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function add_single(){
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single') %>");
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function insert_SINGLE(quest_type,quest_num,quest_id){
|
||||
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
|
||||
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
|
||||
'<div class="ur_editor text ">'+
|
||||
'<div class="ur_editor_title">'+
|
||||
'<label for="ur_question_title">问题: </label>'+
|
||||
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
|
||||
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
|
||||
'<input type="hidden" name="question_type" value="3"/>'+
|
||||
'<input maxlength="250" id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入单行主观标题"/>'+
|
||||
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
|
||||
'<label for="ur_question_require">必答</label>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_footer">'+
|
||||
'<a class="btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
||||
'<%= l(:label_button_ok)%>'+
|
||||
'</a>'+
|
||||
'<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
||||
'<%= l(:button_cancel)%>'+
|
||||
'</a>'+
|
||||
'</div>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</div>'+
|
||||
'<% end%>'
|
||||
);
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
function add_mulit(){
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_mulit') %>");
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function insert_MULIT(quest_type,quest_num,quest_id){
|
||||
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
|
||||
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
|
||||
'<div class="ur_editor textarea">'+
|
||||
'<div class="ur_editor_title">'+
|
||||
'<label for="ur_question_title">问题: </label>'+
|
||||
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
|
||||
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
|
||||
'<input type="hidden" name="question_type" value="4"/>'+
|
||||
'<input maxlength="250" id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入多行主观标题"/>'+
|
||||
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
|
||||
'<label>必答</label>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_toolbar">'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_footer">'+
|
||||
'<a class="btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
||||
'<%= l(:label_button_ok)%>'+
|
||||
'</a>'+
|
||||
'<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
||||
'<%= l(:button_cancel)%>'+
|
||||
'</a>'+
|
||||
'</div>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</div>'+
|
||||
'<% end%>'
|
||||
);
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
//选择导入调查问卷
|
||||
function importPoll(){
|
||||
importPollPopWindow = $("#import_poll");
|
||||
$("#import_poll").css("position", "absolute");
|
||||
|
||||
$("#import_poll").css("top", $("#import_btn").offset().top+30);
|
||||
|
||||
$("#import_poll").css("left", $("#import_btn").offset().left-65);
|
||||
$("#import_poll").css("display","block")
|
||||
}
|
||||
|
||||
function remote_import(){
|
||||
importPollPopWindow.css('display', 'none');
|
||||
if($("#import_poll").val() === 0){
|
||||
return;
|
||||
}else{
|
||||
if(confirm("确认导入问卷"+$("#import_poll").find("option:selected").text()+"?")){
|
||||
$("#import_form").submit();
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//添加标题时确定按钮
|
||||
function add_poll_question(doc)
|
||||
{
|
||||
var title = $.trim($("#poll_questions_title").val());
|
||||
if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();}
|
||||
}
|
||||
//修改标题时确定按钮
|
||||
function edit_poll_question(doc,id)
|
||||
{
|
||||
var title = $.trim($("#poll_questions_title_" + id).val());
|
||||
if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();}
|
||||
}
|
||||
|
||||
//问卷头
|
||||
function pollsCancel(){$("#polls_head_edit").hide();$("#polls_head_show").show();}
|
||||
function pollsSubmit(doc){
|
||||
var title = $.trim($("#polls_title").val());
|
||||
if(title.length == 0){alert("问卷标题不能为空");}else{doc.parent().parent().parent().submit();}
|
||||
}
|
||||
function pollsEdit(){$("#polls_head_edit").show();$("#polls_head_show").hide();}
|
||||
//
|
||||
function pollQuestionCancel(question_id){
|
||||
$("#show_poll_questions_"+question_id).show();
|
||||
$("#edit_poll_questions_"+question_id).hide();
|
||||
}
|
||||
function pollQuestionEdit(question_id){
|
||||
$("#show_poll_questions_"+question_id).hide();
|
||||
$("#edit_poll_questions_"+question_id).show();
|
||||
$("#poll_questions_title_"+question_id).focus();
|
||||
}
|
||||
//单选题
|
||||
function add_single_answer(doc)
|
||||
{
|
||||
doc.parent().after("<li class='ur_item'><label>选项<span class='ur_index'></span>: </label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='新建选项'/>" +
|
||||
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a><a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
|
||||
"</li><div class='cl'></div>");
|
||||
}
|
||||
function remove_single_answer(doc)
|
||||
{
|
||||
if(doc.parent().siblings("li").length == 0)
|
||||
{
|
||||
alert("选择题至少有一个选项");
|
||||
}
|
||||
else
|
||||
{
|
||||
doc.parent().remove();
|
||||
}
|
||||
}
|
||||
|
||||
function poll_submit()
|
||||
{
|
||||
var title = $.trim($("#polls_name_h").html());
|
||||
if(title.length == 0)
|
||||
{
|
||||
alert("问卷标题不能为空");
|
||||
}
|
||||
else{
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll,:is_remote => false}) %>');
|
||||
showModal('ajax-modal', '310px');
|
||||
$('#ajax-modal').css('height','120px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class=" polls_content polls_edit" id="polls">
|
||||
|
||||
<!-- 头部 -->
|
||||
<div id="polls_head_show" style="display: none;">
|
||||
<%= render :partial => 'show_head', :locals => {:poll => @poll}%>
|
||||
</div>
|
||||
<div id="polls_head_edit">
|
||||
<%= render :partial => 'edit_head', :locals => {:poll => @poll}%>
|
||||
</div>
|
||||
|
||||
<!-- 问题 -->
|
||||
<div id="poll_content">
|
||||
<%= render :partial => 'poll_content', :locals => {:poll => @poll}%>
|
||||
</div>
|
||||
|
||||
<div class="tabs">
|
||||
<ul class="tabs_list">
|
||||
<li class="tab_item02 " >
|
||||
<a title="<%= l(:label_MC) %>" class="tab_icon icon_radio" onclick="add_MC();">
|
||||
<%= l(:label_MC) %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="tab_item02 " >
|
||||
<a title="<%= l(:label_MCQ) %>" class=" tab_icon icon_checkbox" onclick="add_MCQ();">
|
||||
<%= l(:label_MCQ) %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="tab_item02 " >
|
||||
<a title="<%= l(:label_single) %>" class="tab_icon icon_text" onclick="add_single();">
|
||||
<%= l(:label_single) %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="tab_item02 " >
|
||||
<a title="<%= l(:label_mulit)%>" class="tab_icon icon_textarea" onclick="add_mulit();">
|
||||
<%= l(:label_mulit)%>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div><!--选项 end-->
|
||||
|
||||
<!-- 新增问题 -->
|
||||
<div id="new_poll_question">
|
||||
</div>
|
||||
|
||||
<div class="ur_buttons">
|
||||
<a class="ur_button_submit" onclick="poll_submit();">
|
||||
<%= l(:label_memo_create)%>
|
||||
</a>
|
||||
<div class="polls_cha">
|
||||
<input type="checkbox" name="" value="" >
|
||||
<label for="">允许学生查看调查结果</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!-- 新增问题 -->
|
||||
<div id="import_poll" style="display: none">
|
||||
<%= form_tag({:controller => 'poll', :action => 'import_poll', :to_id => @poll.id},:remote=>'true', :method => :get,:id=>"import_form") do %>
|
||||
<%= select( :poll, :id, Poll.where("polls_group_id = #{@poll.polls_group_id} and polls_type='course' and id != #{@poll.id}").map{|c| [c.polls_name, c.id]}.unshift(["选择要导入的问卷",0]),
|
||||
{ :include_blank => false,:selected=> 0,:class=>"w90"
|
||||
},
|
||||
{:onchange=>"remote_import();",:id=>"import_id",:name=>"import_id"}
|
||||
)
|
||||
%>
|
||||
<% end%>
|
||||
</select>
|
||||
</div>
|
||||
</div><!--编辑end-->
|
||||
<%= stylesheet_link_tag 'polls', :media => 'all' %>
|
||||
|
||||
<script type="text/javascript">
|
||||
//编辑问卷描述之后
|
||||
var popWindow ; //弹出框的引用
|
||||
var importPollPopWindow; //选择导入的弹出框引用
|
||||
function edit_head(){
|
||||
$("#polls_description").val($("#polls_description_div").html());
|
||||
}
|
||||
$(function(){
|
||||
//点击空白处
|
||||
$(document).bind('click',function(e){
|
||||
//弹出框非空 不是a标签 点击的不是弹出框 ,那么弹出框就会隐藏
|
||||
if(popWindow && e.target.nodeName != 'A' && !popWindow.is(e.target) && popWindow.has(e.target).length === 0){ // Mark 1
|
||||
popWindow.css('display', 'none');
|
||||
}
|
||||
if(importPollPopWindow && e.target.nodeName != 'A' && !importPollPopWindow.is(e.target) && importPollPopWindow.has(e.target).length === 0){
|
||||
importPollPopWindow.css('display', 'none');
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
function dismiss(quest_type,quest_id){
|
||||
popWindow = $("#div_"+quest_type+"_"+quest_id);
|
||||
if(popWindow){
|
||||
popWindow.css('display', 'none');
|
||||
}
|
||||
}
|
||||
|
||||
function chooseQuestionType(quest_type,quest_id){
|
||||
//quest_type 分为 mc mcq single multi
|
||||
//quest_id 是quetion的id 下同
|
||||
if(popWindow){
|
||||
popWindow.css('display', 'none');
|
||||
}
|
||||
popWindow = $("#div_"+quest_type+"_"+quest_id);
|
||||
$("#div_"+quest_type+"_"+quest_id).click(function(e){
|
||||
e.stopPropagation(); //组织冒泡到document.body中去
|
||||
});
|
||||
$("#div_"+quest_type+"_"+quest_id).css("position", "absolute");
|
||||
|
||||
$("#div_"+quest_type+"_"+quest_id).css("top", $("#add_"+quest_type+"_"+quest_id).offset().top+30);
|
||||
|
||||
$("#div_"+quest_type+"_"+quest_id).css("left", $("#add_"+quest_type+"_"+quest_id).offset().left-10);
|
||||
if( $("#div_"+quest_type+"_"+quest_id).css('display') == 'block') {
|
||||
$("#div_"+quest_type+"_"+quest_id).css('display', 'none');
|
||||
}
|
||||
else{
|
||||
$("#div_"+quest_type+"_"+quest_id).css('display', 'block');
|
||||
}
|
||||
}
|
||||
|
||||
function add_MC(){
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>");
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function insert_MC(quest_type,quest_num,quest_id){
|
||||
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
|
||||
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
|
||||
' <div class="ur_editor radio"> '+
|
||||
'<div class="ur_editor_title"> '+
|
||||
'<label>问题: </label>'+
|
||||
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
|
||||
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
|
||||
'<input type="hidden" name="question_type" value="1"/>'+
|
||||
'<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入单选题标题"/>'+
|
||||
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
|
||||
'<label>必答</label>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_content">'+
|
||||
'<ul>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</ul>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_footer">'+
|
||||
'<a class="btn btn_dark btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
||||
'<%= l(:label_button_ok)%>'+
|
||||
'</a>'+
|
||||
'<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
||||
'<%= l(:button_cancel)%>'+
|
||||
'</a>'+
|
||||
'</div>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</div>'+
|
||||
'<% end%>'
|
||||
);
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function add_MCQ(){
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ') %>");
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function insert_MCQ(quest_type,quest_num,quest_id){
|
||||
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
|
||||
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
|
||||
'<div class="ur_editor checkbox">'+
|
||||
'<div class="ur_editor_title">'+
|
||||
'<label>问题: </label>'+
|
||||
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
|
||||
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
|
||||
'<input type="hidden" name="question_type" value="2"/>'+
|
||||
'<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入多选题标题"/>'+
|
||||
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
|
||||
'<label>必答</label>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_content">'+
|
||||
'<ul>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除"" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'<li class="ur_item">'+
|
||||
'<label>选项<span class="ur_index"></span>: </label>'+
|
||||
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="新建选项"/>'+
|
||||
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
|
||||
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
|
||||
'</li>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</ul>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_footer">'+
|
||||
'<a class="btn btn_dark btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
||||
'<%= l(:label_button_ok)%>'+
|
||||
'</a>'+
|
||||
'<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
||||
'<%= l(:button_cancel)%>'+
|
||||
'</a>'+
|
||||
'</div>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</div>'+
|
||||
'<% end%>'
|
||||
);
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function add_single(){
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single') %>");
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function insert_SINGLE(quest_type,quest_num,quest_id){
|
||||
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
|
||||
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
|
||||
'<div class="ur_editor text ">'+
|
||||
'<div class="ur_editor_title">'+
|
||||
'<label for="ur_question_title">问题: </label>'+
|
||||
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
|
||||
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
|
||||
'<input type="hidden" name="question_type" value="3"/>'+
|
||||
'<input maxlength="250" id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入单行主观标题"/>'+
|
||||
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
|
||||
'<label for="ur_question_require">必答</label>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_footer">'+
|
||||
'<a class="btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
||||
'<%= l(:label_button_ok)%>'+
|
||||
'</a>'+
|
||||
'<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
||||
'<%= l(:button_cancel)%>'+
|
||||
'</a>'+
|
||||
'</div>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</div>'+
|
||||
'<% end%>'
|
||||
);
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
function add_mulit(){
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_mulit') %>");
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
function insert_MULIT(quest_type,quest_num,quest_id){
|
||||
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
|
||||
'<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
|
||||
'<div class="ur_editor textarea">'+
|
||||
'<div class="ur_editor_title">'+
|
||||
'<label for="ur_question_title">问题: </label>'+
|
||||
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
|
||||
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
|
||||
'<input type="hidden" name="question_type" value="4"/>'+
|
||||
'<input maxlength="250" id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入多行主观标题"/>'+
|
||||
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
|
||||
'<label>必答</label>'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_toolbar">'+
|
||||
'</div>'+
|
||||
'<div class="ur_editor_footer">'+
|
||||
'<a class="btn_submit c_white" data-button="ok" onclick="add_poll_question($(this));">'+
|
||||
'<%= l(:label_button_ok)%>'+
|
||||
'</a>'+
|
||||
'<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">'+
|
||||
'<%= l(:button_cancel)%>'+
|
||||
'</a>'+
|
||||
'</div>'+
|
||||
'<div class="cl"></div>'+
|
||||
'</div>'+
|
||||
'<% end%>'
|
||||
);
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
//选择导入调查问卷
|
||||
function importPoll(){
|
||||
importPollPopWindow = $("#import_poll");
|
||||
$("#import_poll").css("position", "absolute");
|
||||
|
||||
$("#import_poll").css("top", $("#import_btn").offset().top+30);
|
||||
|
||||
$("#import_poll").css("left", $("#import_btn").offset().left-65);
|
||||
$("#import_poll").css("display","block")
|
||||
}
|
||||
|
||||
function remote_import(){
|
||||
importPollPopWindow.css('display', 'none');
|
||||
if($("#import_poll").val() === 0){
|
||||
return;
|
||||
}else{
|
||||
if(confirm("确认导入问卷"+$("#import_poll").find("option:selected").text()+"?")){
|
||||
$("#import_form").submit();
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//添加标题时确定按钮
|
||||
function add_poll_question(doc)
|
||||
{
|
||||
var title = $.trim($("#poll_questions_title").val());
|
||||
if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();}
|
||||
}
|
||||
//修改标题时确定按钮
|
||||
function edit_poll_question(doc,id)
|
||||
{
|
||||
var title = $.trim($("#poll_questions_title_" + id).val());
|
||||
if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();}
|
||||
}
|
||||
|
||||
//问卷头
|
||||
function pollsCancel(){$("#polls_head_edit").hide();$("#polls_head_show").show();}
|
||||
function pollsSubmit(doc){
|
||||
var title = $.trim($("#polls_title").val());
|
||||
if(title.length == 0){alert("问卷标题不能为空");}else{doc.parent().parent().parent().submit();}
|
||||
}
|
||||
function pollsEdit(){$("#polls_head_edit").show();$("#polls_head_show").hide();}
|
||||
//
|
||||
function pollQuestionCancel(question_id){
|
||||
$("#show_poll_questions_"+question_id).show();
|
||||
$("#edit_poll_questions_"+question_id).hide();
|
||||
}
|
||||
function pollQuestionEdit(question_id){
|
||||
$("#show_poll_questions_"+question_id).hide();
|
||||
$("#edit_poll_questions_"+question_id).show();
|
||||
$("#poll_questions_title_"+question_id).focus();
|
||||
}
|
||||
//单选题
|
||||
function add_single_answer(doc)
|
||||
{
|
||||
doc.parent().after("<li class='ur_item'><label>选项<span class='ur_index'></span>: </label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='新建选项'/>" +
|
||||
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a><a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
|
||||
"</li><div class='cl'></div>");
|
||||
}
|
||||
function remove_single_answer(doc)
|
||||
{
|
||||
if(doc.parent().siblings("li").length == 0)
|
||||
{
|
||||
alert("选择题至少有一个选项");
|
||||
}
|
||||
else
|
||||
{
|
||||
doc.parent().remove();
|
||||
}
|
||||
}
|
||||
|
||||
function poll_submit()
|
||||
{
|
||||
var title = $.trim($("#polls_name_h").html());
|
||||
if(title.length == 0)
|
||||
{
|
||||
alert("问卷标题不能为空");
|
||||
}
|
||||
else{
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll,:is_remote => false}) %>');
|
||||
showModal('ajax-modal', '310px');
|
||||
$('#ajax-modal').css('height','120px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class=" polls_content polls_edit" id="polls">
|
||||
|
||||
<!-- 头部 -->
|
||||
<div id="polls_head_show" style="display: none;">
|
||||
<%= render :partial => 'show_head', :locals => {:poll => @poll}%>
|
||||
</div>
|
||||
<div id="polls_head_edit">
|
||||
<%= render :partial => 'edit_head', :locals => {:poll => @poll}%>
|
||||
</div>
|
||||
|
||||
<!-- 问题 -->
|
||||
<div id="poll_content">
|
||||
<%= render :partial => 'poll_content', :locals => {:poll => @poll}%>
|
||||
</div>
|
||||
|
||||
<div class="tabs">
|
||||
<ul class="tabs_list">
|
||||
<li class="tab_item02 " >
|
||||
<a title="<%= l(:label_MC) %>" class="tab_icon icon_radio" onclick="add_MC();">
|
||||
<%= l(:label_MC) %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="tab_item02 " >
|
||||
<a title="<%= l(:label_MCQ) %>" class=" tab_icon icon_checkbox" onclick="add_MCQ();">
|
||||
<%= l(:label_MCQ) %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="tab_item02 " >
|
||||
<a title="<%= l(:label_single) %>" class="tab_icon icon_text" onclick="add_single();">
|
||||
<%= l(:label_single) %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="tab_item02 " >
|
||||
<a title="<%= l(:label_mulit)%>" class="tab_icon icon_textarea" onclick="add_mulit();">
|
||||
<%= l(:label_mulit)%>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div><!--选项 end-->
|
||||
|
||||
<!-- 新增问题 -->
|
||||
<div id="new_poll_question">
|
||||
</div>
|
||||
|
||||
<div class="ur_buttons">
|
||||
<a class="ur_button_submit" onclick="poll_submit();">
|
||||
<%= l(:label_memo_create)%>
|
||||
</a>
|
||||
<div class="polls_cha">
|
||||
<input type="checkbox" name="" value="" >
|
||||
<label for="">允许学生查看调查结果</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!-- 新增问题 -->
|
||||
<div id="import_poll" style="display: none">
|
||||
<%= form_tag({:controller => 'poll', :action => 'import_poll', :to_id => @poll.id},:remote=>'true', :method => :get,:id=>"import_form") do %>
|
||||
<%= select( :poll, :id, Poll.where("polls_group_id = #{@poll.polls_group_id} and polls_type='course' and id != #{@poll.id}").map{|c| [c.polls_name, c.id]}.unshift(["选择要导入的问卷",0]),
|
||||
{ :include_blank => false,:selected=> 0,:class=>"w90"
|
||||
},
|
||||
{:onchange=>"remote_import();",:id=>"import_id",:name=>"import_id"}
|
||||
)
|
||||
%>
|
||||
<% end%>
|
||||
</select>
|
||||
</div>
|
||||
</div><!--编辑end-->
|
||||
|
|
|
@ -5,5 +5,5 @@ $('#ajax-modal').siblings().remove();
|
|||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hidden_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
|
@ -1,91 +1,91 @@
|
|||
<%= stylesheet_link_tag 'polls', :media => 'all' %>
|
||||
<script type="text/javascript">
|
||||
function republish_poll(poll_id)
|
||||
{
|
||||
$('#ajax-modal').html("<div id='popbox02'>" +
|
||||
"<div class='upload_con'>" +
|
||||
"<div class='upload_box'>" +
|
||||
"<p class='polls_box_p'>取消发布后问卷统计结果将会被清空<br />是否确定取消发布该问卷?</p>" +
|
||||
"<div class='polls_btn_box'>" +
|
||||
"<a href='/poll/"+ poll_id +"/republish_poll' class='upload_btn' onclick='clickCanel();' data-remote='true'>确 定</a>" +
|
||||
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取 消</a>" +
|
||||
"</div>" +
|
||||
"<div class='cl'></div>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>");
|
||||
showModal('ajax-modal', '310px');
|
||||
$('#ajax-modal').css('height','120px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
function clickCanel(){hideModal("#popbox02");}
|
||||
|
||||
function poll_submit(poll_id,poll_name)
|
||||
{
|
||||
if(poll_name == 0)
|
||||
{
|
||||
alert("问卷标题不能为空");
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#ajax-modal').html("<div id='popbox02'>" +
|
||||
"<div class='upload_con'>" +
|
||||
"<div class='upload_box'>" +
|
||||
"<p class='polls_box_p'>问卷发布后将不能对问卷进行修改,<br />是否确定发布该问卷?</p>" +
|
||||
"<div class='polls_btn_box'>" +
|
||||
"<a href='/poll/"+ poll_id +"/publish_poll' class='upload_btn' onclick='clickCanel();' data-remote='true'>确 定</a>" +
|
||||
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取 消</a>" +
|
||||
"</div>" +
|
||||
"<div class='cl'></div>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>");
|
||||
showModal('ajax-modal', '310px');
|
||||
$('#ajax-modal').css('height','120px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
}
|
||||
|
||||
function close_poll(poll_id)
|
||||
{
|
||||
$('#ajax-modal').html("<div id='popbox02'>" +
|
||||
"<div class='upload_con'>" +
|
||||
"<div class='upload_box'>" +
|
||||
"<p class='polls_box_p'>问卷关闭后学生将不能继续提交问卷,<br />是否确定关闭该问卷?</p>" +
|
||||
"<div class='polls_btn_box'>" +
|
||||
"<a href='/poll/"+ poll_id +"/close_poll' class='upload_btn' onclick='clickCanel();' data-remote='true'>确 定</a>" +
|
||||
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取 消</a>" +
|
||||
"</div>" +
|
||||
"<div class='cl'></div>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>");
|
||||
showModal('ajax-modal', '310px');
|
||||
$('#ajax-modal').css('height','120px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
function closeModal()
|
||||
{
|
||||
hideModal($("#popbox_upload"));
|
||||
}
|
||||
</script>
|
||||
<div class="polls_content02" id="polls">
|
||||
<%= render :partial => 'poll_list'%>
|
||||
<%= stylesheet_link_tag 'polls', :media => 'all' %>
|
||||
<script type="text/javascript">
|
||||
function republish_poll(poll_id)
|
||||
{
|
||||
$('#ajax-modal').html("<div id='popbox02'>" +
|
||||
"<div class='upload_con'>" +
|
||||
"<div class='upload_box'>" +
|
||||
"<p class='polls_box_p'>取消发布后问卷统计结果将会被清空<br />是否确定取消发布该问卷?</p>" +
|
||||
"<div class='polls_btn_box'>" +
|
||||
"<a href='/poll/"+ poll_id +"/republish_poll' class='upload_btn' onclick='clickCanel();' data-remote='true'>确 定</a>" +
|
||||
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取 消</a>" +
|
||||
"</div>" +
|
||||
"<div class='cl'></div>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>");
|
||||
showModal('ajax-modal', '310px');
|
||||
$('#ajax-modal').css('height','120px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
function clickCanel(){hideModal("#popbox02");}
|
||||
|
||||
function poll_submit(poll_id,poll_name)
|
||||
{
|
||||
if(poll_name == 0)
|
||||
{
|
||||
alert("问卷标题不能为空");
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#ajax-modal').html("<div id='popbox02'>" +
|
||||
"<div class='upload_con'>" +
|
||||
"<div class='upload_box'>" +
|
||||
"<p class='polls_box_p'>问卷发布后将不能对问卷进行修改,<br />是否确定发布该问卷?</p>" +
|
||||
"<div class='polls_btn_box'>" +
|
||||
"<a href='/poll/"+ poll_id +"/publish_poll' class='upload_btn' onclick='clickCanel();' data-remote='true'>确 定</a>" +
|
||||
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取 消</a>" +
|
||||
"</div>" +
|
||||
"<div class='cl'></div>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>");
|
||||
showModal('ajax-modal', '310px');
|
||||
$('#ajax-modal').css('height','120px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
}
|
||||
|
||||
function close_poll(poll_id)
|
||||
{
|
||||
$('#ajax-modal').html("<div id='popbox02'>" +
|
||||
"<div class='upload_con'>" +
|
||||
"<div class='upload_box'>" +
|
||||
"<p class='polls_box_p'>问卷关闭后学生将不能继续提交问卷,<br />是否确定关闭该问卷?</p>" +
|
||||
"<div class='polls_btn_box'>" +
|
||||
"<a href='/poll/"+ poll_id +"/close_poll' class='upload_btn' onclick='clickCanel();' data-remote='true'>确 定</a>" +
|
||||
"<a class='upload_btn upload_btn_grey' onclick='clickCanel();'>取 消</a>" +
|
||||
"</div>" +
|
||||
"<div class='cl'></div>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>");
|
||||
showModal('ajax-modal', '310px');
|
||||
$('#ajax-modal').css('height','120px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
function closeModal()
|
||||
{
|
||||
hideModal($("#popbox_upload"));
|
||||
}
|
||||
</script>
|
||||
<div class="polls_content02" id="polls">
|
||||
<%= render :partial => 'poll_list'%>
|
||||
</div><!--问卷内容end-->
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
<% if @polls.empty? %>
|
||||
alert('您目前还没有自己新建的问卷');
|
||||
<% else %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'other_poll',:locals => {:polls => @polls,:polls_group_id=>@polls_group_id}) %>');
|
||||
|
||||
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
|
||||
<% if @polls.empty? %>
|
||||
alert('您目前还没有自己新建的问卷');
|
||||
<% else %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'other_poll',:locals => {:polls => @polls,:polls_group_id=>@polls_group_id}) %>');
|
||||
|
||||
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
<% end %>
|
|
@ -6,5 +6,5 @@ $('#ajax-modal').siblings().remove();
|
|||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("poll_alert_form");
|
|
@ -6,5 +6,5 @@ $('#ajax-modal').siblings().remove();
|
|||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("poll_alert_form");
|
|
@ -1,7 +1,13 @@
|
|||
<% if PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?",activity.id,activity.class.to_s,User.current.id).empty? %>
|
||||
<a href="<%= praise_tread_praise_plus_path({:obj_id=>activity.id,:obj_type=>activity.class,:user_activity_id=>user_activity_id,:type=>type })%>" data-remote="true" class="<%=type == 'reply'? 'fr' : 'ml15' %> likeButton" title="点赞" >
|
||||
<span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></a>
|
||||
<span class="likeText">赞</span>
|
||||
<% num = get_praise_num(activity) %>
|
||||
<span class="likeNum"><%= num > 0 ? "(#{num})" : "" %></span>
|
||||
</a>
|
||||
<% else %>
|
||||
<a href="<%= praise_tread_praise_minus_path({:obj_id=>activity.id,:obj_type=>activity.class,:user_activity_id=>user_activity_id,:type=>type })%>" data-remote="true" class="<%=type == 'reply'? 'fr' : 'ml15' %> likeButton" title="取消点赞" >
|
||||
<span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></a>
|
||||
<span class="likeText">已赞</span>
|
||||
<% num = get_praise_num(activity) %>
|
||||
<span class="likeNum"><%= num > 0 ? "(#{num})" : "" %></span>
|
||||
</a>
|
||||
<% end %>
|
|
@ -22,18 +22,14 @@
|
|||
发布时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<p class="mt5 break_word"><%= textAreailizable activity, :description %><br/></p>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id %>">
|
||||
<!--<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id %>">
|
||||
<div id="intro_content_<%= user_activity_id %>">
|
||||
<%#= activity.description.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="cl"></div>
|
||||
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
</div>
|
|
@ -54,7 +54,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<!-- more -->
|
||||
<div class="subNav subNav_jiantou" id="expand_tools_expand" nhtype="toggle4cookie" data-id="expand_tool_more" data-target="#navContent" data-val="retract"><%= l(:label_project_more) %></div>
|
||||
<div class="subNav subNav_jiantou" id="expand_tools_expand"><%= l(:label_project_more) %></div>
|
||||
<ul class="navContent" id="navContent">
|
||||
<%= render 'projects/tools_expand' %>
|
||||
</ul>
|
||||
|
|
|
@ -19,13 +19,9 @@
|
|||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl">
|
||||
<div class="homepagePostDate">
|
||||
创建时间:<%= format_time(project.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='ProjectCreateInfo' and forge_act_id =#{project.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -86,7 +86,7 @@
|
|||
<%= format_time(comment.created_on) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.author == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
@ -120,7 +120,4 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
</div>
|
|
@ -1,10 +1,10 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/join_project') %>');
|
||||
showModal('ajax-modal', '540px');
|
||||
$('#ajax-modal').css('height','260px');
|
||||
//$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').siblings().hide();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||
"<a href='#' onclick='hidden_join_course_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/join_project') %>');
|
||||
showModal('ajax-modal', '540px');
|
||||
$('#ajax-modal').css('height','260px');
|
||||
//$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').siblings().hide();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||
"<a href='#' onclick='hidden_join_course_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
||||
|
|
|
@ -23,13 +23,17 @@
|
|||
<% end%>
|
||||
<script type="text/javascript">
|
||||
function score_submit(id){
|
||||
if ($.trim($('#score_comment_'+id).val()) == "") {
|
||||
$('#hint_message_'+id).html("为了对其他学生的作品负责,请您务必填写评语");
|
||||
$("#hint_message_"+id).css('color','#ff0000');
|
||||
$("#score_comment_"+id).focus();
|
||||
} else {
|
||||
<% if !@is_teacher %>
|
||||
if ($.trim($('#score_comment_'+id).val()) == "") {
|
||||
$('#hint_message_'+id).html("为了对其他学生的作品负责,请您务必填写评语");
|
||||
$("#hint_message_"+id).css('color','#ff0000');
|
||||
$("#score_comment_"+id).focus();
|
||||
} else {
|
||||
$("#work_submit_"+id).parent().parent().submit();
|
||||
$('#about_hwork_'+id).html('');
|
||||
}
|
||||
<% else %>
|
||||
$("#work_submit_"+id).parent().parent().submit();
|
||||
$('#about_hwork_'+id).html('');
|
||||
}
|
||||
<% end %>
|
||||
}
|
||||
</script>
|
|
@ -80,8 +80,8 @@
|
|||
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
$('#score_<%= work.id%>').peSlider({range: 'min'});
|
||||
<% end %>
|
||||
$('#score_<%= work.id%>').peSlider({range: 'min'});
|
||||
<% end %>
|
||||
});
|
||||
</script>
|
|
@ -1,24 +1,24 @@
|
|||
<% if @has_commit %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/has_commit_work') %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
<% elsif @submit_result%>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_information') %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='/student_work/"+ <%=@student_work.id%> +"/retry_work' class='upload_btn' data-remote='true'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
<% else %>
|
||||
window.location.href = '<%= new_student_work_url(:homework => @homework.id)%>';
|
||||
<% end %>
|
||||
|
||||
function clickCanel() {
|
||||
hideModal('#popbox02');
|
||||
window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
|
||||
<% if @has_commit %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/has_commit_work') %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
<% elsif @submit_result%>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_information') %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='/student_work/"+ <%=@student_work.id%> +"/retry_work' class='upload_btn' data-remote='true'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
<% else %>
|
||||
window.location.href = '<%= new_student_work_url(:homework => @homework.id)%>';
|
||||
<% end %>
|
||||
|
||||
function clickCanel() {
|
||||
hideModal('#popbox02');
|
||||
window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
|
||||
}
|
|
@ -1,118 +1,118 @@
|
|||
<div class="homepageRightBanner mb10">
|
||||
<div class="NewsBannerName">编辑作品</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="HomeWork" id="users_setting">
|
||||
|
||||
<div class="HomeWorkBox">
|
||||
<div class="">
|
||||
<div class="homepagePostTitle fl m_w530 hidden">
|
||||
<%= @homework.name%>(作业名称)
|
||||
</div>
|
||||
<span class="fr c_grey">
|
||||
截止时间:<%= @homework.end_time%>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class="c_blue">
|
||||
<%= link_to @homework.user.show_name, user_activities_path(@homework.user_id), :class => "c_blue"%>
|
||||
</a>
|
||||
<div class="cl"></div>
|
||||
<div class="HomeWorkP">
|
||||
<%= @homework.description.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
</div><!----HomeWorkBox end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="HomeWorkCon mt15">
|
||||
<%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%>
|
||||
<div class=" c_red mb10">
|
||||
提示:作品名称和描述中不要出现真实的姓名信息
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<span id="min_num_member" style="display: none"><%=@homework.homework_detail_group.min_num %></span>
|
||||
<span id="max_num_member" style="display: none"><%=@homework.homework_detail_group.max_num %></span>
|
||||
<% str = User.current.id.to_s%>
|
||||
<% @work.student_work_projects.where("is_leader = ?", 0).each do |pro| %>
|
||||
<% str += ','+pro.user_id.to_s %>
|
||||
<% end %>
|
||||
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>str %>
|
||||
<% end %>
|
||||
<div>
|
||||
<input type="text" name="student_work[name]" id="student_work_name" placeholder="请简洁的概括作品的功能或特性" class="InputBox W700" maxlength="200" onkeyup="regexStudentWorkName();" value="<%= @work.name%>">
|
||||
<div class="cl"></div>
|
||||
<p id="student_work_name_span" class="c_red mb10"></p>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<textarea name="student_work[description]" id="student_work_description" placeholder="请介绍你的作品" class="InputBox W700 H150" maxlength="6000" onkeyup="regexStudentWorkDescription();"><%= @work.description%></textarea>
|
||||
<script>
|
||||
var text = document.getElementById("student_work_description");
|
||||
autoTextarea(text);// 调用
|
||||
</script>
|
||||
<div class="cl"></div>
|
||||
<p id="student_work_description_textarea" class="c_red mb10"></p>
|
||||
</div>
|
||||
|
||||
<div id="homework_attachments">
|
||||
<%= render :partial => 'users/user_homework_attachment', :locals => {:container => @work, :has_program=>false,:has_group=>false} %>
|
||||
</div>
|
||||
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="memberBtn fl mt3 mr15" title="请添加小组的其他成员" onclick="show_group_member();">合作成员</a>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();edit_student_work(<%= @work.id%>);">确定</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
</div><!----HomeWorkCon end-->
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
<% if @homework.homework_detail_group %>
|
||||
$(function(){
|
||||
<%members = @work.student_work_projects.where("is_leader =?",0) %>
|
||||
var str = $('#group_members_show').html();
|
||||
<% members.each do |member| %>
|
||||
str += '、<%= (User.find member.user_id).show_name %>';
|
||||
<% end %>
|
||||
$('#group_members_show').html(str);
|
||||
$('span.group_detail_info').text('分组人数:<%=@homework.homework_detail_group.min_num %>-<%=@homework.homework_detail_group.max_num %> 人');
|
||||
});
|
||||
<% end %>
|
||||
// 添加组成员
|
||||
function show_group_member() {
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/choose_group_member',:locals => {:homework=>@homework,:edit_mode => true}) %>');
|
||||
showModal('ajax-modal', '528px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("addMemberCP");
|
||||
}
|
||||
|
||||
function popupRegex(){
|
||||
if(regexStudentWorkName()&®exStudentWorkDescription())
|
||||
{
|
||||
if($("#group_member_ids").length > 0) {
|
||||
if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
|
||||
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
}
|
||||
} else {
|
||||
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
}
|
||||
}
|
||||
}
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="NewsBannerName">编辑作品</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="HomeWork" id="users_setting">
|
||||
|
||||
<div class="HomeWorkBox">
|
||||
<div class="">
|
||||
<div class="homepagePostTitle fl m_w530 hidden">
|
||||
<%= @homework.name%>(作业名称)
|
||||
</div>
|
||||
<span class="fr c_grey">
|
||||
截止时间:<%= @homework.end_time%>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class="c_blue">
|
||||
<%= link_to @homework.user.show_name, user_activities_path(@homework.user_id), :class => "c_blue"%>
|
||||
</a>
|
||||
<div class="cl"></div>
|
||||
<div class="HomeWorkP">
|
||||
<%= @homework.description.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
</div><!----HomeWorkBox end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="HomeWorkCon mt15">
|
||||
<%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%>
|
||||
<div class=" c_red mb10">
|
||||
提示:作品名称和描述中不要出现真实的姓名信息
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<span id="min_num_member" style="display: none"><%=@homework.homework_detail_group.min_num %></span>
|
||||
<span id="max_num_member" style="display: none"><%=@homework.homework_detail_group.max_num %></span>
|
||||
<% str = User.current.id.to_s%>
|
||||
<% @work.student_work_projects.where("is_leader = ?", 0).each do |pro| %>
|
||||
<% str += ','+pro.user_id.to_s %>
|
||||
<% end %>
|
||||
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>str %>
|
||||
<% end %>
|
||||
<div>
|
||||
<input type="text" name="student_work[name]" id="student_work_name" placeholder="请简洁的概括作品的功能或特性" class="InputBox W700" maxlength="200" onkeyup="regexStudentWorkName();" value="<%= @work.name%>">
|
||||
<div class="cl"></div>
|
||||
<p id="student_work_name_span" class="c_red mb10"></p>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<textarea name="student_work[description]" id="student_work_description" placeholder="请介绍你的作品" class="InputBox W700 H150" maxlength="6000" onkeyup="regexStudentWorkDescription();"><%= @work.description%></textarea>
|
||||
<script>
|
||||
var text = document.getElementById("student_work_description");
|
||||
autoTextarea(text);// 调用
|
||||
</script>
|
||||
<div class="cl"></div>
|
||||
<p id="student_work_description_textarea" class="c_red mb10"></p>
|
||||
</div>
|
||||
|
||||
<div id="homework_attachments">
|
||||
<%= render :partial => 'users/user_homework_attachment', :locals => {:container => @work, :has_program=>false,:has_group=>false} %>
|
||||
</div>
|
||||
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="memberBtn fl mt3 mr15" title="请添加小组的其他成员" onclick="show_group_member();">合作成员</a>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();edit_student_work(<%= @work.id%>);">确定</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
</div><!----HomeWorkCon end-->
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
<% if @homework.homework_detail_group %>
|
||||
$(function(){
|
||||
<%members = @work.student_work_projects.where("is_leader =?",0) %>
|
||||
var str = $('#group_members_show').html();
|
||||
<% members.each do |member| %>
|
||||
str += '、<%= (User.find member.user_id).show_name %>';
|
||||
<% end %>
|
||||
$('#group_members_show').html(str);
|
||||
$('span.group_detail_info').text('分组人数:<%=@homework.homework_detail_group.min_num %>-<%=@homework.homework_detail_group.max_num %> 人');
|
||||
});
|
||||
<% end %>
|
||||
// 添加组成员
|
||||
function show_group_member() {
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/choose_group_member',:locals => {:homework=>@homework,:edit_mode => true}) %>');
|
||||
showModal('ajax-modal', '528px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("addMemberCP");
|
||||
}
|
||||
|
||||
function popupRegex(){
|
||||
if(regexStudentWorkName()&®exStudentWorkDescription())
|
||||
{
|
||||
if($("#group_member_ids").length > 0) {
|
||||
if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
|
||||
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
}
|
||||
} else {
|
||||
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -30,7 +30,7 @@
|
|||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
}
|
||||
|
||||
$(function(){
|
||||
|
|
|
@ -1,177 +1,177 @@
|
|||
<!-- 此界面只用来新建匿评作业作品 -->
|
||||
<script type="text/javascript">
|
||||
<%if @homework.homework_detail_manual.comment_status != 1%>
|
||||
$(function(){
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/new_student_work_alert') %>');
|
||||
showModal('ajax-modal', '360px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","65%").css("left","60%");
|
||||
$('#ajax-modal').parent().addClass("anonymos_work");
|
||||
});
|
||||
<% end%>
|
||||
<% if @homework.homework_detail_group %>
|
||||
$(function(){
|
||||
$('span.group_detail_info').text('分组人数:<%=@homework.homework_detail_group.min_num %>-<%=@homework.homework_detail_group.max_num %> 人');
|
||||
});
|
||||
<% end %>
|
||||
|
||||
//快速创建项目的弹框
|
||||
function new_project(){
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/new_project') %>');
|
||||
showModal('ajax-modal', '800px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","20%").css("position","fixed");
|
||||
}
|
||||
|
||||
// 点击 checkbox选中引用的资源的时候,保存该资源的id到session里去
|
||||
function store_seleted_resource(dom){
|
||||
if(dom.attr('checked') == 'checked' ){
|
||||
$.get(
|
||||
'<%= store_selected_resource_user_path(User.current) %>'+'?save=y&res_id='+dom.val()
|
||||
)
|
||||
}else {
|
||||
$.get(
|
||||
'<%= store_selected_resource_user_path(User.current) %>'+'?save=n&res_id='+dom.val()
|
||||
)
|
||||
}
|
||||
}
|
||||
// 添加组成员
|
||||
function show_group_member() {
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/choose_group_member',:locals => {:homework=>@homework}) %>');
|
||||
showModal('ajax-modal', '528px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("addMemberCP");
|
||||
}
|
||||
// 关联项目
|
||||
function show_project() {
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/relate_project',:locals => {:homework=>@homework}) %>');
|
||||
showModal('ajax-modal', '320px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("groupPopUp");
|
||||
}
|
||||
// 作品校验
|
||||
function popupRegex(){
|
||||
if(regexStudentWorkName()&®exStudentWorkDescription())
|
||||
{
|
||||
if($("#group_member_ids").length > 0) {
|
||||
if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
|
||||
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
}
|
||||
} else {
|
||||
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="NewsBannerName">提交作品</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="HomeWork" id="users_setting">
|
||||
|
||||
<div class="HomeWorkBox">
|
||||
<div class="">
|
||||
<div class="homepagePostTitle fl m_w530 hidden">
|
||||
<%= @homework.name%>(作业名称)
|
||||
</div>
|
||||
<span class="fr c_grey">
|
||||
截止时间:<%= @homework.end_time%>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class="c_blue">
|
||||
<%= link_to @homework.user.show_name, user_activities_path(@homework.user_id), :class => "c_blue"%>
|
||||
</a>
|
||||
<div class="cl"></div>
|
||||
<div class="HomeWorkP">
|
||||
<%= @homework.description.html_safe %>
|
||||
</div>
|
||||
<div>
|
||||
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => @homework.attachments} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!----HomeWorkBox end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="HomeWorkCon mt15">
|
||||
<%= form_for(@student_work,
|
||||
:html => { :multipart => true },
|
||||
:url => {:controller => 'student_work',
|
||||
:action => 'create',
|
||||
:homework => @homework.id
|
||||
},:remote=>true ) do |f| %>
|
||||
<div class=" c_red mb10">
|
||||
提示:作品名称和描述中不要出现真实的姓名信息
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<span id="min_num_member" style="display: none"><%=@homework.homework_detail_group.min_num %></span>
|
||||
<span id="max_num_member" style="display: none"><%=@homework.homework_detail_group.max_num %></span>
|
||||
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %>
|
||||
<% end %>
|
||||
<div>
|
||||
<%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请简洁的概括作品的功能或特性", :onkeyup => "regexStudentWorkName();" %>
|
||||
<div class="cl"></div>
|
||||
<p id="student_work_name_span" class="c_red mb10"></p>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<%= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请介绍你的作品", :onkeyup => "regexStudentWorkDescription();"%>
|
||||
<script>
|
||||
var text = document.getElementById("student_work_description");
|
||||
autoTextarea(text);// 调用
|
||||
</script>
|
||||
<div class="cl"></div>
|
||||
<p id="student_work_description_textarea" class="c_red mb10"></p>
|
||||
</div>
|
||||
|
||||
<div id="homework_attachments">
|
||||
<%= render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false,:has_group=>false} %>
|
||||
</div>
|
||||
<div id="group_member">
|
||||
</div>
|
||||
<div id="relate_project">
|
||||
</div>
|
||||
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="memberBtn fl mt3 mr15" title="请添加小组的其他成员" onclick="show_group_member();">合作成员</a>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<!--<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="RalationIcon fl mt3" title="请选择作业的关联项目" onclick="show_project();">关联项目</a>
|
||||
</div>-->
|
||||
|
||||
<!--<div class="mt10 none" id="about_project">
|
||||
<%#= select_tag :project_id, options_for_select(user_projects_option, @student_work.project_id), {:class => "InputBox W680 fl"} %>
|
||||
<%#=link_to "", new_project_path, :class => "ml5 mt5 SetUpIcon fl", :title => "快速创建"%>
|
||||
<a class=" ml5 mt5 SetUpIcon fl" href="javascript:void(0)" title="快速创建" onclick="new_project();"></a>
|
||||
<div class="cl"></div>
|
||||
</div>-->
|
||||
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();new_student_work();">提交</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<%= link_to "取消", delete_work_student_work_index_path(:homework =>@homework.id), :class => "fr mr10 mt3"%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
</div><!----HomeWorkCon end-->
|
||||
<!-- 此界面只用来新建匿评作业作品 -->
|
||||
<script type="text/javascript">
|
||||
<%if @homework.homework_detail_manual.comment_status != 1%>
|
||||
$(function(){
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/new_student_work_alert') %>');
|
||||
showModal('ajax-modal', '360px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","65%").css("left","60%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("anonymos_work");
|
||||
});
|
||||
<% end%>
|
||||
<% if @homework.homework_detail_group %>
|
||||
$(function(){
|
||||
$('span.group_detail_info').text('分组人数:<%=@homework.homework_detail_group.min_num %>-<%=@homework.homework_detail_group.max_num %> 人');
|
||||
});
|
||||
<% end %>
|
||||
|
||||
//快速创建项目的弹框
|
||||
function new_project(){
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/new_project') %>');
|
||||
showModal('ajax-modal', '800px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","20%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
}
|
||||
|
||||
// 点击 checkbox选中引用的资源的时候,保存该资源的id到session里去
|
||||
function store_seleted_resource(dom){
|
||||
if(dom.attr('checked') == 'checked' ){
|
||||
$.get(
|
||||
'<%= store_selected_resource_user_path(User.current) %>'+'?save=y&res_id='+dom.val()
|
||||
)
|
||||
}else {
|
||||
$.get(
|
||||
'<%= store_selected_resource_user_path(User.current) %>'+'?save=n&res_id='+dom.val()
|
||||
)
|
||||
}
|
||||
}
|
||||
// 添加组成员
|
||||
function show_group_member() {
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/choose_group_member',:locals => {:homework=>@homework}) %>');
|
||||
showModal('ajax-modal', '528px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("addMemberCP");
|
||||
}
|
||||
// 关联项目
|
||||
function show_project() {
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/relate_project',:locals => {:homework=>@homework}) %>');
|
||||
showModal('ajax-modal', '320px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("groupPopUp");
|
||||
}
|
||||
// 作品校验
|
||||
function popupRegex(){
|
||||
if(regexStudentWorkName()&®exStudentWorkDescription())
|
||||
{
|
||||
if($("#group_member_ids").length > 0) {
|
||||
if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) {
|
||||
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
}
|
||||
} else {
|
||||
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="NewsBannerName">提交作品</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="HomeWork" id="users_setting">
|
||||
|
||||
<div class="HomeWorkBox">
|
||||
<div class="">
|
||||
<div class="homepagePostTitle fl m_w530 hidden">
|
||||
<%= @homework.name%>(作业名称)
|
||||
</div>
|
||||
<span class="fr c_grey">
|
||||
截止时间:<%= @homework.end_time%>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class="c_blue">
|
||||
<%= link_to @homework.user.show_name, user_activities_path(@homework.user_id), :class => "c_blue"%>
|
||||
</a>
|
||||
<div class="cl"></div>
|
||||
<div class="HomeWorkP">
|
||||
<%= @homework.description.html_safe %>
|
||||
</div>
|
||||
<div>
|
||||
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => @homework.attachments} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!----HomeWorkBox end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="HomeWorkCon mt15">
|
||||
<%= form_for(@student_work,
|
||||
:html => { :multipart => true },
|
||||
:url => {:controller => 'student_work',
|
||||
:action => 'create',
|
||||
:homework => @homework.id
|
||||
},:remote=>true ) do |f| %>
|
||||
<div class=" c_red mb10">
|
||||
提示:作品名称和描述中不要出现真实的姓名信息
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<span id="min_num_member" style="display: none"><%=@homework.homework_detail_group.min_num %></span>
|
||||
<span id="max_num_member" style="display: none"><%=@homework.homework_detail_group.max_num %></span>
|
||||
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %>
|
||||
<% end %>
|
||||
<div>
|
||||
<%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请简洁的概括作品的功能或特性", :onkeyup => "regexStudentWorkName();" %>
|
||||
<div class="cl"></div>
|
||||
<p id="student_work_name_span" class="c_red mb10"></p>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<%= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请介绍你的作品", :onkeyup => "regexStudentWorkDescription();"%>
|
||||
<script>
|
||||
var text = document.getElementById("student_work_description");
|
||||
autoTextarea(text);// 调用
|
||||
</script>
|
||||
<div class="cl"></div>
|
||||
<p id="student_work_description_textarea" class="c_red mb10"></p>
|
||||
</div>
|
||||
|
||||
<div id="homework_attachments">
|
||||
<%= render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false,:has_group=>false} %>
|
||||
</div>
|
||||
<div id="group_member">
|
||||
</div>
|
||||
<div id="relate_project">
|
||||
</div>
|
||||
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="memberBtn fl mt3 mr15" title="请添加小组的其他成员" onclick="show_group_member();">合作成员</a>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<!--<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="RalationIcon fl mt3" title="请选择作业的关联项目" onclick="show_project();">关联项目</a>
|
||||
</div>-->
|
||||
|
||||
<!--<div class="mt10 none" id="about_project">
|
||||
<%#= select_tag :project_id, options_for_select(user_projects_option, @student_work.project_id), {:class => "InputBox W680 fl"} %>
|
||||
<%#=link_to "", new_project_path, :class => "ml5 mt5 SetUpIcon fl", :title => "快速创建"%>
|
||||
<a class=" ml5 mt5 SetUpIcon fl" href="javascript:void(0)" title="快速创建" onclick="new_project();"></a>
|
||||
<div class="cl"></div>
|
||||
</div>-->
|
||||
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();new_student_work();">提交</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<%= link_to "取消", delete_work_student_work_index_path(:homework =>@homework.id), :class => "fr mr10 mt3"%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
</div><!----HomeWorkCon end-->
|
||||
</div>
|
|
@ -1,16 +1,16 @@
|
|||
<% if @submit_result%>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_edit_information') %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
<% else %>
|
||||
window.location.href = '<%= edit_student_work_url(@work)%>';
|
||||
<% end %>
|
||||
|
||||
function clickCanel() {
|
||||
hideModal('#popbox02');
|
||||
window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
|
||||
<% if @submit_result%>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_edit_information') %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
<% else %>
|
||||
window.location.href = '<%= edit_student_work_url(@work)%>';
|
||||
<% end %>
|
||||
|
||||
function clickCanel() {
|
||||
hideModal('#popbox02');
|
||||
window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
|
||||
}
|
|
@ -17,13 +17,9 @@
|
|||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl">
|
||||
<div class="homepagePostDate">
|
||||
创建时间:<%= format_time(activity.created_at) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
|
|
|
@ -127,58 +127,86 @@
|
|||
<% if activity.student_works.count != 0 %>
|
||||
<% sw = activity.student_works.reorder("created_at desc").first %>
|
||||
<div class="mt10 homepagePostDeadline">
|
||||
<%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if activity.student_works.count != 0 %>
|
||||
<% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %>
|
||||
<% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
||||
<% student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %>
|
||||
<%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
||||
<% unless student_work_scores.empty? %>
|
||||
<% last_score = student_work_scores.first %>
|
||||
<div class="mt5 homepagePostDeadline">
|
||||
<%=time_from_now last_score.created_at %><%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品
|
||||
<div class="mt10">
|
||||
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
||||
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||
</p>
|
||||
<% ids = '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
||||
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||
<% student_works.each_with_index do |sw, i| %>
|
||||
<div class="fl mr10 w100" style="text-align:center;">
|
||||
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
||||
<p class="w100 hidden"><%= link_to sw.user.show_name, student_work_index_path(:homework => activity.id)%></p>
|
||||
</a>
|
||||
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
|
||||
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score<0 ? 0 : score) %>分</span></p>
|
||||
</div>
|
||||
<% if i == 4 %>
|
||||
<% break %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
||||
<div class="mt10">
|
||||
<% projects = activity.student_work_projects.where("is_leader = 1") %>
|
||||
<div class="fl mr20 fontGrey3">
|
||||
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% projects.each do |pro| %>
|
||||
<% project = Project.find pro.project_id %>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#project_img_<%=project.id %>_<%=activity.id %>").mouseover(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","block");
|
||||
}).mouseout(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","none");
|
||||
<% unless projects.empty? %>
|
||||
<% sort_projects = project_sort_update projects %>
|
||||
<div class="mt10 relatePWrap" id="relatePWrap_<%=user_activity_id %>">
|
||||
<div class="mr5 fontGrey2">
|
||||
# <%=time_from_now sort_projects.first.updated_at %><%= link_to User.find(sort_projects.first.user_id).show_name, user_activities_path(sort_projects.first.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% sort_projects.each_with_index do |pro, i| %>
|
||||
<% project = Project.find pro.project_id %>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#project_img_<%=project.id %>_<%=activity.id %>").mouseover(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","block");
|
||||
}).mouseout(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=activity.id %>").css("display","none");
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
|
||||
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
|
||||
<% end %>
|
||||
<% time=project.updated_on %>
|
||||
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<p class="mh18"><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
|
||||
<p class="mh18"><%=time_from_now time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
|
||||
项目名称:<%=project.name %><br />
|
||||
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
|
||||
更新时间:<%=time_from_now time %>
|
||||
</div>
|
||||
</div>
|
||||
<% if i == 9 && projects.count > 10 %>
|
||||
<a href="javascript:void(0);" class="linkGrey2 fl ml50" style="margin-top:68px;" id="moreProject_<%=user_activity_id %>">更多>></a>
|
||||
<% end %>
|
||||
<% if i > 9 && i == (projects.count - 1) %>
|
||||
<a href="javascript:void(0);" class="linkGrey2 fr mr10" style="margin-top:68px;" id="hideProject_<%=user_activity_id %>">收回<<</a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% time=project.updated_on %>
|
||||
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
|
||||
<p><%=time_from_now time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
|
||||
项目名称:<%=project.name %><br />
|
||||
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
|
||||
更新时间:<%=time_from_now time %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if is_teacher%>
|
||||
|
@ -225,7 +253,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.user == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -266,7 +294,7 @@
|
|||
<%= format_time(comment.created_on) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.user == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
@ -310,5 +338,13 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
$("#moreProject_<%=user_activity_id %>").click(function(){
|
||||
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
|
||||
$("#relatePWrap_<%=user_activity_id %>").css("height","auto");
|
||||
$(this).hide();
|
||||
});
|
||||
$("#hideProject_<%=user_activity_id %>").click(function(){
|
||||
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
|
||||
$("#moreProject_<%=user_activity_id %>").show();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -136,7 +136,7 @@
|
|||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.author == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
@ -177,6 +177,4 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -86,7 +86,7 @@
|
|||
<%= format_time(comment.created_on) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.author == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
@ -120,7 +120,4 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
</div>
|
|
@ -55,6 +55,3 @@
|
|||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth lh18" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<%= content.to_s.html_safe%>
|
||||
</div>
|
||||
|
@ -8,5 +8,6 @@
|
|||
var postContent = $("#intro_content_<%= user_activity_id%>").html();
|
||||
postContent = postContent.replace(/ /g," ");
|
||||
$("#intro_content_<%= user_activity_id%>").html(postContent);
|
||||
description_show_hide(<%=user_activity_id %>);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,19 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||
<% end %>
|
||||
|
||||
<%= error_messages_for 'message' %>
|
||||
<li>
|
||||
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<%= f.kindeditor :content, :editor_id => 'jour_content_editor',
|
||||
:width => '99.7%',
|
||||
:height => 40,
|
||||
:minHeight=>40,
|
||||
:input_html => { :id => 'jour_content',
|
||||
:class => 'talk_text fl',
|
||||
:maxlength => 5000 }%>
|
||||
<div class="cl"></div>
|
||||
<p id="jour_content_span"></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
|
@ -19,13 +19,9 @@
|
|||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl">
|
||||
<div class="homepagePostDate">
|
||||
创建时间:<%= format_time(project.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='ProjectCreateInfo' and forge_act_id =#{project.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -109,7 +109,7 @@
|
|||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.user == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
@ -151,6 +151,3 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -131,7 +131,7 @@
|
|||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.author == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
@ -167,6 +167,3 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
</script>
|
||||
|
|
|
@ -46,10 +46,16 @@
|
|||
</div>
|
||||
<% count=activity.children.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
|
||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">
|
||||
回复(<%= count %>)
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<%if count>3 %>
|
||||
|
@ -84,6 +90,13 @@
|
|||
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(comment.created_on) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.author == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.content.html_safe %></div>
|
||||
|
@ -122,5 +135,13 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(description_show_hide(<%=user_activity_id %>));
|
||||
$("#moreProject_<%=user_activity_id %>").click(function(){
|
||||
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
|
||||
$("#relatePWrap_<%=user_activity_id %>").css("height","auto");
|
||||
$(this).hide();
|
||||
});
|
||||
$("#hideProject_<%=user_activity_id %>").click(function(){
|
||||
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
|
||||
$("#moreProject_<%=user_activity_id %>").show();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1,314 +1,351 @@
|
|||
<% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %>
|
||||
<div class="HomeWork mb10" id="homework_common_<%= homework_common.id %>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%=link_to image_tag(url_to_avatar(homework_common.user),width:"50px", height: "50px"), user_activities_path(homework_common.user.id)%>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo mt-4">
|
||||
<%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%>
|
||||
TO
|
||||
<%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<span class="homepagePostTitle hidden fl m_w505">
|
||||
<%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
|
||||
</span>
|
||||
|
||||
<% if homework_common.homework_detail_manual%>
|
||||
<% if homework_common.homework_detail_manual.comment_status == 0 %>
|
||||
<span class="grey_homework_btn_cir ml5">未发布</span>
|
||||
<% elsif homework_common.homework_detail_manual.comment_status == 1%>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<span class="grey_homework_btn_cir ml5">未开启匿评</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<% if Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
|
||||
<span class="green_homework_btn_cir ml5">作品提交中</span>
|
||||
<% elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
|
||||
<span class="red_homework_btn_cir ml5">作品补交中</span>
|
||||
<% end %>
|
||||
<% elsif homework_common.homework_detail_manual.comment_status == 2%>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<span class="green_homework_btn_cir ml5">匿评中</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
||||
<% elsif homework_common.homework_detail_manual.comment_status == 3%>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已结束</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
||||
<% end%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1%>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<% elsif homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 0%>
|
||||
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
|
||||
<% end %>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<% if homework_common.homework_type == 3 && !is_teacher && homework_common.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(homework_common.course) %>
|
||||
<% projects = cur_user_projects_for_homework homework_common %>
|
||||
<% works = cur_user_works_for_homework homework_common %>
|
||||
<% if works.nil? && projects.nil? %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => homework_common.id,:is_in_course=>is_in_course,:user_activity_id=>-1,:course_activity=>-1),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
|
||||
<%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %>
|
||||
</div>
|
||||
<% elsif works.nil? %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => homework_common.id,:is_in_course=>is_in_course,:user_activity_id=>-1,:course_activity=>-1), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%= user_for_homework_common homework_common,is_teacher %>
|
||||
</div>
|
||||
<% if homework_common.homework_type == 2 && is_teacher%>
|
||||
<div class="homepagePostSubmit">
|
||||
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: homework_common.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if homework_common.homework_type == 2%>
|
||||
<div class="homepagePostDeadline mr15">
|
||||
语言:
|
||||
<%= homework_common.language_name%>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group%>
|
||||
<div class="homepagePostDeadline mr15">
|
||||
分组人数:<%=homework_common.homework_detail_group.min_num %>-<%=homework_common.homework_detail_group.max_num %> 人
|
||||
</div>
|
||||
<% end %>
|
||||
<% if homework_common.homework_detail_manual && homework_common.homework_detail_manual.comment_status < 2 %>
|
||||
<div class="homepagePostDeadline">提交截止时间:<%= homework_common.end_time.to_s %> 23:59</div>
|
||||
<% elsif homework_common.homework_detail_manual && homework_common.homework_detail_manual.comment_status >= 2 %>
|
||||
<div class="homepagePostDeadline">匿评截止时间:<%= homework_common.homework_detail_manual.evaluation_end.to_s %> 23:59</div>
|
||||
<% end %>
|
||||
<% if homework_common.homework_detail_manual.comment_status == 0 %>
|
||||
<div class="homepagePostDeadline ml15">
|
||||
<%= l(:label_publish_time)%>:<%= homework_common.publish_time%> 00:00
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>homework_common.id, :content=>homework_common.description} %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => homework_common} %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<div class="homepagePostDeadline">
|
||||
迟交扣分:<%= homework_common.late_penalty%>分
|
||||
</div>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=homework_common.id %>">
|
||||
匿评开启时间:<%= homework_common.homework_detail_manual.evaluation_start%> 00:00
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="homepagePostDeadline">
|
||||
缺评扣分:<%= homework_common.homework_detail_manual.absence_penalty%>分/作品
|
||||
</div>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=homework_common.id %>">
|
||||
匿评关闭时间:<%= homework_common.homework_detail_manual.evaluation_end%> 23:59
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if homework_common.student_works.count != 0 %>
|
||||
<% sw = homework_common.student_works.reorder("created_at desc").first %>
|
||||
<div class="mt10 homepagePostDeadline">
|
||||
<%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if homework_common.student_works.count != 0 %>
|
||||
<% sw_id = "("+homework_common.student_works.map{|sw| sw.id}.join(",")+")" %>
|
||||
<% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
||||
<% unless student_work_scores.empty? %>
|
||||
<% last_score = student_work_scores.first %>
|
||||
<div class="mt5 homepagePostDeadline">
|
||||
<%=time_from_now last_score.created_at %><%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
|
||||
<div class="mt10">
|
||||
<% projects = homework_common.student_work_projects.where("is_leader = 1") %>
|
||||
<div class="fl mr20 fontGrey3">
|
||||
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% projects.each do |pro| %>
|
||||
<% project = Project.find pro.project_id %>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#project_img_<%=project.id %>_<%=homework_common.id %>").mouseover(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=homework_common.id %>").css("display","block");
|
||||
}).mouseout(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=homework_common.id %>").css("display","none");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="mr20 mb10 mt10 fl w110 fontGrey3" style="text-align: center;">
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像" %>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像") %>
|
||||
<% end %>
|
||||
<% time=project.updated_on %>
|
||||
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<p><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
|
||||
<p><%=time_from_now time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>">
|
||||
项目名称:<%=project.name %><br />
|
||||
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
|
||||
更新时间:<%=time_from_now time %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if is_teacher%>
|
||||
<% comment_status = homework_common.homework_detail_manual.comment_status%>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to l(:button_edit),edit_homework_common_path(homework_common,:is_in_course => is_in_course,:course_activity=>-1), :class => "postOptionLink"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => is_in_course,:course_activity=>-1),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to("评分设置", score_rule_set_homework_common_path(homework_common, :is_in_course => is_in_course,:course_activity=>-1),:class => "postOptionLink", :remote => true) %>
|
||||
</li>
|
||||
<% if homework_common.anonymous_comment == 0 &&(comment_status == 0 || comment_status == 1)%>
|
||||
<li>
|
||||
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common, :is_in_course => is_in_course,:course_activity=>-1),:class => "postOptionLink", :remote => true)%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<li>
|
||||
<%= homework_anonymous_comment(homework_common, is_in_course) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if homework_common.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
||||
<li>
|
||||
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(homework_common,:is_in_course => is_in_course),:class => "postOptionLink", :remote => true)%>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% count=homework_common.journals_for_messages.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=homework_common.id %>">
|
||||
<% if homework_common.user == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(homework_common) > 0 ? "(#{get_praise_num(homework_common)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>homework_common, :user_activity_id=>homework_common.id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"></div>
|
||||
<%if count>3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%=homework_common.id%>" onclick="expand_reply('#reply_div_<%= homework_common.id %> li','#reply_btn_<%=homework_common.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= homework_common.id %>">
|
||||
<ul>
|
||||
<% homework_common.journals_for_messages.reorder("created_on desc").each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#message_edit_<%= comment.id%>').show();" onmouseout="$('#message_edit_<%= comment.id%>').hide();" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if comment.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(comment.created_on) %><span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.user == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
<div id="message_edit_<%=comment.id %>" style="display: none" class="mr10 fr">
|
||||
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
|
||||
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course,:course_activity=>-1},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "replyGrey fr ml10", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.notes.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= homework_common.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= homework_common.id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => homework_common.id},:method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'homework_common_id',params[:homework_common_id],:value =>homework_common.id %>
|
||||
<%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= homework_common.id%>' name="homework_message"></textarea>
|
||||
<div nhname='toolbar_container_<%= homework_common.id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= homework_common.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= homework_common.id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!----HomeWork end-->
|
||||
<script type="text/javascript">
|
||||
$(homework_description_show_hide(<%=homework_common.id %>));
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %>
|
||||
<div class="HomeWork mb10" id="homework_common_<%= homework_common.id %>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%=link_to image_tag(url_to_avatar(homework_common.user),width:"50px", height: "50px"), user_activities_path(homework_common.user.id)%>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo mt-4">
|
||||
<%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%>
|
||||
TO
|
||||
<%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<span class="homepagePostTitle hidden fl m_w505">
|
||||
<%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
|
||||
</span>
|
||||
|
||||
<% if homework_common.homework_detail_manual%>
|
||||
<% if homework_common.homework_detail_manual.comment_status == 0 %>
|
||||
<span class="grey_homework_btn_cir ml5">未发布</span>
|
||||
<% elsif homework_common.homework_detail_manual.comment_status == 1%>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<span class="grey_homework_btn_cir ml5">未开启匿评</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<% if Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
|
||||
<span class="green_homework_btn_cir ml5">作品提交中</span>
|
||||
<% elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
|
||||
<span class="red_homework_btn_cir ml5">作品补交中</span>
|
||||
<% end %>
|
||||
<% elsif homework_common.homework_detail_manual.comment_status == 2%>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<span class="green_homework_btn_cir ml5">匿评中</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
||||
<% elsif homework_common.homework_detail_manual.comment_status == 3%>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已结束</span>
|
||||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
||||
<% end%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1%>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<% elsif homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 0%>
|
||||
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
|
||||
<% end %>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<% if homework_common.homework_type == 3 && !is_teacher && homework_common.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(homework_common.course) %>
|
||||
<% projects = cur_user_projects_for_homework homework_common %>
|
||||
<% works = cur_user_works_for_homework homework_common %>
|
||||
<% if works.nil? && projects.nil? %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => homework_common.id,:is_in_course=>is_in_course,:user_activity_id=>-1,:course_activity=>-1),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
|
||||
<%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %>
|
||||
</div>
|
||||
<% elsif works.nil? %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => homework_common.id,:is_in_course=>is_in_course,:user_activity_id=>-1,:course_activity=>-1), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="homepagePostSubmit">
|
||||
<%= user_for_homework_common homework_common,is_teacher %>
|
||||
</div>
|
||||
<% if homework_common.homework_type == 2 && is_teacher%>
|
||||
<div class="homepagePostSubmit">
|
||||
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: homework_common.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if homework_common.homework_type == 2%>
|
||||
<div class="homepagePostDeadline mr15">
|
||||
语言:
|
||||
<%= homework_common.language_name%>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group%>
|
||||
<div class="homepagePostDeadline mr15">
|
||||
分组人数:<%=homework_common.homework_detail_group.min_num %>-<%=homework_common.homework_detail_group.max_num %> 人
|
||||
</div>
|
||||
<% end %>
|
||||
<% if homework_common.homework_detail_manual && homework_common.homework_detail_manual.comment_status < 2 %>
|
||||
<div class="homepagePostDeadline">提交截止时间:<%= homework_common.end_time.to_s %> 23:59</div>
|
||||
<% elsif homework_common.homework_detail_manual && homework_common.homework_detail_manual.comment_status >= 2 %>
|
||||
<div class="homepagePostDeadline">匿评截止时间:<%= homework_common.homework_detail_manual.evaluation_end.to_s %> 23:59</div>
|
||||
<% end %>
|
||||
<% if homework_common.homework_detail_manual.comment_status == 0 %>
|
||||
<div class="homepagePostDeadline ml15">
|
||||
<%= l(:label_publish_time)%>:<%= homework_common.publish_time%> 00:00
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>homework_common.id, :content=>homework_common.description} %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => homework_common} %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<div class="homepagePostDeadline">
|
||||
迟交扣分:<%= homework_common.late_penalty%>分
|
||||
</div>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=homework_common.id %>">
|
||||
匿评开启时间:<%= homework_common.homework_detail_manual.evaluation_start%> 00:00
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="homepagePostDeadline">
|
||||
缺评扣分:<%= homework_common.homework_detail_manual.absence_penalty%>分/作品
|
||||
</div>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=homework_common.id %>">
|
||||
匿评关闭时间:<%= homework_common.homework_detail_manual.evaluation_end%> 23:59
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if homework_common.student_works.count != 0 %>
|
||||
<% sw = homework_common.student_works.reorder("created_at desc").first %>
|
||||
<div class="mt10 homepagePostDeadline">
|
||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if homework_common.student_works.count != 0 %>
|
||||
<% sw_id = "("+homework_common.student_works.map{|sw| sw.id}.join(",")+")" %>
|
||||
<% student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %>
|
||||
<%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
||||
<% unless student_work_scores.empty? %>
|
||||
<% last_score = student_work_scores.first %>
|
||||
<div class="mt10">
|
||||
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
||||
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||
</p>
|
||||
<% ids = '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
||||
<% student_works = homework_common.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||
<% student_works.each_with_index do |sw, i| %>
|
||||
<div class="fl mr10 w100" style="text-align:center;">
|
||||
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => homework_common.id), :alt => "学生头像" %>
|
||||
<p class="w100 hidden"><%= link_to sw.user.show_name, student_work_index_path(:homework => homework_common.id)%></p>
|
||||
</a>
|
||||
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
|
||||
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score<0 ? 0 : score) %>分</span></p>
|
||||
</div>
|
||||
<% if i == 4 %>
|
||||
<% break %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= link_to "更多>>", student_work_index_path(:homework => homework_common.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
|
||||
<% projects = homework_common.student_work_projects.where("is_leader = 1") %>
|
||||
<% unless projects.empty? %>
|
||||
<% sort_projects = project_sort_update projects %>
|
||||
<div class="mt10 relatePWrap" id="relatePWrap_<%=homework_common.id %>">
|
||||
<div class="mr5 fontGrey2">
|
||||
# <%=time_from_now sort_projects.first.updated_at %><%= link_to User.find(sort_projects.first.user_id).show_name, user_activities_path(sort_projects.first.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% sort_projects.each_with_index do |pro, i| %>
|
||||
<% project = Project.find pro.project_id %>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#project_img_<%=project.id %>_<%=homework_common.id %>").mouseover(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=homework_common.id %>").css("display","block");
|
||||
}).mouseout(function(){
|
||||
$("#relatePInfo_<%=project.id %>_<%=homework_common.id %>").css("display","none");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像" %>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像") %>
|
||||
<% end %>
|
||||
<% time=project.updated_on %>
|
||||
<% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<p class="mh18"><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
|
||||
<p class="mh18"><%=time_from_now time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>">
|
||||
项目名称:<%=project.name %><br />
|
||||
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
|
||||
更新时间:<%=time_from_now time %>
|
||||
</div>
|
||||
</div>
|
||||
<% if i == 9 && projects.count > 10 %>
|
||||
<a href="javascript:void(0);" class="linkGrey2 fl ml50" style="margin-top:68px;" id="moreProject_<%=homework_common.id %>">更多>></a>
|
||||
<% end %>
|
||||
<% if i > 9 && i == (projects.count - 1) %>
|
||||
<a href="javascript:void(0);" class="linkGrey2 fr mr10" style="margin-top:68px;" id="hideProject_<%=homework_common.id %>">收回<<</a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if is_teacher%>
|
||||
<% comment_status = homework_common.homework_detail_manual.comment_status%>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to l(:button_edit),edit_homework_common_path(homework_common,:is_in_course => is_in_course,:course_activity=>-1), :class => "postOptionLink"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => is_in_course,:course_activity=>-1),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to("评分设置", score_rule_set_homework_common_path(homework_common, :is_in_course => is_in_course,:course_activity=>-1),:class => "postOptionLink", :remote => true) %>
|
||||
</li>
|
||||
<% if homework_common.anonymous_comment == 0 &&(comment_status == 0 || comment_status == 1)%>
|
||||
<li>
|
||||
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common, :is_in_course => is_in_course,:course_activity=>-1),:class => "postOptionLink", :remote => true)%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<li>
|
||||
<%= homework_anonymous_comment(homework_common, is_in_course) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if homework_common.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
||||
<li>
|
||||
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(homework_common,:is_in_course => is_in_course),:class => "postOptionLink", :remote => true)%>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% count=homework_common.journals_for_messages.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=homework_common.id %>">
|
||||
<% if homework_common.user == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(homework_common) > 0 ? "(#{get_praise_num(homework_common)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>homework_common, :user_activity_id=>homework_common.id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"></div>
|
||||
<%if count>3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%=homework_common.id%>" onclick="expand_reply('#reply_div_<%= homework_common.id %> li','#reply_btn_<%=homework_common.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= homework_common.id %>">
|
||||
<ul>
|
||||
<% homework_common.journals_for_messages.reorder("created_on desc").each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#message_edit_<%= comment.id%>').show();" onmouseout="$('#message_edit_<%= comment.id%>').hide();" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if comment.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(comment.created_on) %><span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.user == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
<div id="message_edit_<%=comment.id %>" style="display: none" class="mr10 fr">
|
||||
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
|
||||
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course,:course_activity=>-1},
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "replyGrey fr ml10", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.notes.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= homework_common.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= homework_common.id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => homework_common.id},:method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'homework_common_id',params[:homework_common_id],:value =>homework_common.id %>
|
||||
<%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= homework_common.id%>' name="homework_message"></textarea>
|
||||
<div nhname='toolbar_container_<%= homework_common.id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= homework_common.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= homework_common.id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!----HomeWork end-->
|
||||
<script type="text/javascript">
|
||||
$("#moreProject_<%=homework_common.id %>").click(function(){
|
||||
$("#relatePWrap_<%=homework_common.id %>").toggleClass('relatePWrap');
|
||||
$("#relatePWrap_<%=homework_common.id %>").css("height","auto");
|
||||
$(this).hide();
|
||||
});
|
||||
$("#hideProject_<%=homework_common.id %>").click(function(){
|
||||
$("#relatePWrap_<%=homework_common.id %>").toggleClass('relatePWrap');
|
||||
$("#moreProject_<%=homework_common.id %>").show();
|
||||
});
|
||||
</script>
|
|
@ -25,6 +25,7 @@
|
|||
<% end %>
|
||||
|
||||
<div class="HomeWorkCon">
|
||||
<a id="submit_homework"></a>
|
||||
<div>
|
||||
<input type="text" name="homework_common[name]" id="homework_name" class="InputBox w701" maxlength="255" onfocus="$('#homework_editor').show()" onkeyup="regex_homework_name();" placeholder="发布作业,请先输入作业标题" value="<%= homework.name%>" >
|
||||
<p id="homework_name_span" class="c_red mt5"></p>
|
||||
|
@ -32,7 +33,7 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<div class=" mt10">
|
||||
<%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%>
|
||||
<%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业(将于2016年春上线)") unless edit_mode%>
|
||||
<% if edit_mode %>
|
||||
<label class="fl c_grey f14" style="margin-top: 4px;">截止日期:</label>
|
||||
<% end %>
|
||||
|
@ -131,10 +132,10 @@
|
|||
</div>
|
||||
</script>
|
||||
|
||||
<div class="BluePopupBox" id="BluePopupBox" style="display:none">
|
||||
<div class="BluePopupBox" id="BluePopupBox" style="display:none;">
|
||||
<%= render :partial => 'users/user_programing_attr', :locals => {:edit_mode => edit_mode, :homework=>homework} %>
|
||||
</div><!----BluePopupBox end-->
|
||||
|
||||
<div class="BluePopupBox" style="display:none" id="GroupPopupBox">
|
||||
<div class="BluePopupBox" style="display:none;" id="GroupPopupBox">
|
||||
<%= render :partial => 'users/user_group_attr', :locals => {:edit_mode => edit_mode, :homework=>homework}%>
|
||||
</div>
|
|
@ -40,7 +40,7 @@
|
|||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.user == User.current %>
|
||||
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
|
@ -76,7 +76,7 @@
|
|||
<%= format_time(comment.created_on) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.user == User.current %>
|
||||
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||
<%#= javascript_include_tag "init_KindEditor","user" %>
|
||||
<% end %>
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
||||
.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}
|
||||
.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}
|
||||
.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}
|
||||
.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
|
||||
.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
|
||||
.homepagePostReplyInputContainer .ke-outline {border: none;}
|
||||
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
|
||||
.homepagePostReplyInputContainer .ke-container {float: left;}
|
||||
</style>
|
||||
<%if jours %>
|
||||
<% jours.each do |jour|%>
|
||||
<% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id)) %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
init_activity_KindEditor_data(<%= jour.id%>, null, "87%", "<%=jour.class.to_s%>");
|
||||
});
|
||||
</script>
|
||||
<%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id} %>
|
||||
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
|
||||
<% end %>
|
||||
<%end%>
|
||||
<% end%>
|
||||
<% if (jours.count + page * 10) < count %>
|
||||
<%= link_to "点击展开更多",feedback_path(@user.id, :type => type, :page => page),:id => "show_more_jours",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end %>
|
|
@ -1,44 +1,46 @@
|
|||
<a href="javascript:void(0);" class="CloseBtn" title="关闭弹框"></a>
|
||||
<h2 class="BluePopuph2 fl">编程作业的测试集设置</h2>
|
||||
<div class="cl"></div>
|
||||
<div class="HomeWorkCon">
|
||||
<div class="mt15">
|
||||
<select class="InputBox W120 language_type" >
|
||||
<%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3, "Java"=>4}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
|
||||
</select>
|
||||
</div>
|
||||
<% if edit_mode && homework.is_program_homework? %>
|
||||
<% homework.homework_tests.each_with_index do |test, index| %>
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" id="textarea_input_test"><%= test.input %></textarea>
|
||||
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" id="textarea_output_test"><%= test.output %></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<% if index != 0 %>
|
||||
<a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" id="textarea_input_test"></textarea>
|
||||
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" id="textarea_output_test"></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="mt10">
|
||||
<span class="f12 c_red db mt5 fl">温馨提示:您可以在发布作业后,在作业“模拟答题”中进行标准代码的检测。</span>
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fr">确 定</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div><!----HomeWorkCon end-->
|
||||
|
||||
<script>
|
||||
var text = document.getElementById("textarea_input_test");
|
||||
var text2 = document.getElementById("textarea_output_test");
|
||||
autoTextarea2(text,text2);
|
||||
autoTextarea2(text2,text);
|
||||
<a href="javascript:void(0);" class="CloseBtn" title="关闭弹框"></a>
|
||||
<h2 class="BluePopuph2 fl">编程作业的测试集设置</h2>
|
||||
<div class="cl"></div>
|
||||
<div class="HomeWorkCon">
|
||||
<div class="mt15">
|
||||
<select class="InputBox W120 language_type" >
|
||||
<%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3, "Java"=>4}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
|
||||
</select>
|
||||
</div>
|
||||
<div style="max-height: 320px; overflow-y:auto; width:730px;">
|
||||
<% if edit_mode && homework.is_program_homework? %>
|
||||
<% homework.homework_tests.each_with_index do |test, index| %>
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" id="textarea_input_test"><%= test.input %></textarea>
|
||||
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" id="textarea_output_test"><%= test.output %></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<% if index != 0 %>
|
||||
<a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" id="textarea_input_test"></textarea>
|
||||
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" id="textarea_output_test"></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="mt10">
|
||||
<span class="f12 c_red db mt5 fl">温馨提示:您可以在发布作业后,在作业“模拟答题”中进行标准代码的检测。</span>
|
||||
<a href="#submit_homework" class="BlueCirBtn fr">确 定</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div><!----HomeWorkCon end-->
|
||||
|
||||
<script>
|
||||
var text = document.getElementById("textarea_input_test");
|
||||
var text2 = document.getElementById("textarea_output_test");
|
||||
autoTextarea2(text,text2);
|
||||
autoTextarea2(text2,text);
|
||||
</script>
|
|
@ -1,9 +1,9 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_new_score') %>');
|
||||
showModal('ajax-modal', '400px');
|
||||
$('#ajax-modal').css('height','auto');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||
"<a href='javascript:void(0)' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
//$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","35%");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_new_score') %>');
|
||||
showModal('ajax-modal', '400px');
|
||||
$('#ajax-modal').css('height','auto');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||
"<a href='javascript:void(0)' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
//$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","35%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("alert_box");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_homeworks') %>');
|
||||
showModal('ajax-modal', '580px');
|
||||
$('#ajax-modal').css('height','300px').css("width","580px");
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||
"<a href='javascript:void(0)' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","20%").css("left","25%").css("position","fixed");
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_homeworks') %>');
|
||||
showModal('ajax-modal', '580px');
|
||||
$('#ajax-modal').css('height','300px').css("width","580px");
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
|
||||
"<a href='javascript:void(0)' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","20%").css("left","25%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
|
|
|
@ -1,68 +1,40 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||
<%= javascript_include_tag "init_KindEditor","user" %>
|
||||
<% end %>
|
||||
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
||||
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
||||
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
||||
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
||||
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||
div.ke-toolbar .ke-outline{border:none;}
|
||||
/*.ke-container{height: 80px !important;}*/
|
||||
</style>
|
||||
<div >
|
||||
<div>
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="NewsBannerName">留言</div>
|
||||
</div>
|
||||
|
||||
<div class="NewsBannerName pr"><span id="mesLabel">留言</span></div>
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="mesType">
|
||||
<li><%= link_to "全部", {:controller => "users", :action => "user_newfeedback", :type => nil}, :class =>"resourcesTypeAll resourcesGrey"%></li>
|
||||
<li><%= link_to "留言", {:controller => "users", :action => "user_newfeedback", :type => "public"}, :class => "mesIcon resourcesGrey"%></li>
|
||||
<li><%= link_to "私信", {:controller => "users", :action => "user_newfeedback", :type => "private"}, :class => "personalIcon resourcesGrey"%></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="message_box mb10" id="users_setting" style="min-height:192px;">
|
||||
<div nhname='new_message' style="display:none;">
|
||||
<%= form_for('new_form',:url => leave_user_message_path(@user.id), :html =>{:id => "user_feedback_new"}, :method => "post") do |f|%>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea' name="new_form[user_message]"></textarea>
|
||||
<p nhname='contentmsg'></p>
|
||||
<input id="private_flag" name="private" type="hidden" value="0"/>
|
||||
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
|
||||
<!--<a id="new_message_cancel_btn" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:6px;">取消</a>-->
|
||||
<a href="javascript:void(0);" class="blue_n_btn fr" id="submit_feedback_user" style="margin-top:6px;" >留言</a>
|
||||
<a href="javascript:void(0);" class="greyBtn2 postReplySubmit mt5 mr15" id="private_submit_feedback_user">私信</a> </div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="message_list_box " id="user_jour_list" style="padding: <%= @jour && @jour.count > 0 ? '10' : '0'%>px;">
|
||||
<%if @jour%>
|
||||
<% @jour.each do |jour|%>
|
||||
<% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id)) %>
|
||||
<%= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
|
||||
<% end %>
|
||||
<%end%>
|
||||
<% end%>
|
||||
|
||||
<ul class="wlist" style=" border:none;">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div id="messageContent">
|
||||
<div class="resources"><%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %>
|
||||
<div class="fl" style="width:658px;">
|
||||
<%= form_for('new_form',:url => leave_user_message_path(@user.id), :html =>{:id => "user_feedback_new"}, :method => "post") do |f|%>
|
||||
<%=render :partial => "jour_form", :locals => {:f => f} %>
|
||||
<input id="private_flag" name="private" type="hidden" value="0"/>
|
||||
<a href="javascript:void(0);" class="blue_n_btn fr" id="submit_feedback_user" style="margin-top:6px;" >留言</a>
|
||||
<a href="javascript:void(0);" class="greyBtn2 postReplySubmit mt5 mr15" id="private_submit_feedback_user">私信</a>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%=render :partial => "users/user_jours_list", :locals => {:jours =>@jour, :page => 0, :type => @type, :count => @jour_count} %>
|
||||
<div class="cl"></div>
|
||||
</div><!--message_box end-->
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#submit_feedback_user").one('click',function() {
|
||||
$("#private_flag").val("0");
|
||||
$("#submit_feedback_user").submit();
|
||||
jour_submit();
|
||||
});
|
||||
$("#private_submit_feedback_user").one('click',function() {
|
||||
$("#private_flag").val("1");
|
||||
$("#submit_feedback_user").submit();
|
||||
private_jour_submit();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
$("#show_more_jours").replaceWith("<%= escape_javascript( render :partial => 'users/user_jours_list',:locals => {:jours => @jour, :page => @page,:type => @type, :count => @jour_count} )%>");
|
|
@ -1213,6 +1213,7 @@ ActiveRecord::Schema.define(:version => 20160115125217) do
|
|||
create_table "org_members", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "organization_id"
|
||||
t.string "role"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
|
@ -23,23 +23,6 @@ function description_show_hide(id){
|
|||
});
|
||||
}
|
||||
|
||||
function homework_description_show_hide(id){
|
||||
showNormalImage('homework_description_'+id);
|
||||
if($("#intro_content_"+id).height() > 810) {
|
||||
$("#intro_content_show_"+id).show();
|
||||
}
|
||||
$("#intro_content_show_"+id).click(function(){
|
||||
$("#homework_description_"+id).toggleClass("maxh360");
|
||||
$("#intro_content_show_"+id).hide();
|
||||
$("#intro_content_hide_"+id).show();
|
||||
});
|
||||
$("#intro_content_hide_"+id).click(function(){
|
||||
$("#homework_description_"+id).toggleClass("maxh360");
|
||||
$("#intro_content_hide_"+id).hide();
|
||||
$("#intro_content_show_"+id).show();
|
||||
});
|
||||
}
|
||||
|
||||
function cleanArray (actual){
|
||||
var newArray = new Array();
|
||||
for (var i = 0; i< actual.length; i++){
|
||||
|
|
|
@ -1,365 +1,371 @@
|
|||
$(function(){
|
||||
//提交作业
|
||||
|
||||
var bt=baidu.template;
|
||||
bt.LEFT_DELIMITER='<!';
|
||||
bt.RIGHT_DELIMITER='!>';
|
||||
|
||||
var tested = false;
|
||||
var valid_form = function() {
|
||||
var src = $('#program-src').val();
|
||||
var title = $('#program-title').val();
|
||||
|
||||
if (!src) {
|
||||
alert('请输入正确的代码');
|
||||
return false;
|
||||
}
|
||||
if (!title) {
|
||||
alert('请输入标题');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
var test_program = function(cb){
|
||||
var homework_id = $('#test-program-btn').attr('data-homework-id');
|
||||
var student_work_id = $('#test-program-btn').attr('data-student-work-id');
|
||||
var src = $('#program-src').val();
|
||||
var title = $('#program-title').val();
|
||||
var is_test = $('input[name=is_test]').val();
|
||||
|
||||
if(!valid_form()){
|
||||
return;
|
||||
}
|
||||
|
||||
$.post(
|
||||
'/student_work/program_test',
|
||||
{homework: homework_id, student_work_id: student_work_id, src: src, title: title, is_test: is_test},
|
||||
function(data,status){
|
||||
tested = true;
|
||||
console.log(data);
|
||||
if(data.index <=0){
|
||||
data.index = $('.ProResultTop').length+1;
|
||||
}
|
||||
|
||||
if (typeof cb == 'function') {cb(data); return;}
|
||||
|
||||
|
||||
var html=bt('t:result-list',data);
|
||||
$('.ProResult').prepend(html);
|
||||
|
||||
if (data.status==0 && is_test != 'true') {
|
||||
var r=confirm("答题正确,是否立刻提交?");
|
||||
if (r) {
|
||||
$(".HomeWorkCon form").submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
$('#test-program-btn').on('click', test_program);
|
||||
|
||||
|
||||
$('#commit-program-work-btn').on('click', function(){
|
||||
if(!valid_form()){
|
||||
return;
|
||||
}
|
||||
if($('.ProResult .ProResultTop').length<=0){
|
||||
var r=confirm("测试后才能提交,是否立刻测试?");
|
||||
if (r) {
|
||||
test_program();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!tested) {
|
||||
test_program(function(data){
|
||||
if (data.status!=0) {
|
||||
var r=confirm("测试不通过,是否强制提交?");
|
||||
if (!r) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
$(".HomeWorkCon form").submit();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
$(".HomeWorkCon form").submit();
|
||||
});
|
||||
|
||||
$('form.edit_student_work').on('keydown', '#program-src', function(){
|
||||
tested = false;
|
||||
});
|
||||
|
||||
//发布作业
|
||||
|
||||
$('#program-src').focus(function(){
|
||||
$(this).css('height', '100px');
|
||||
});
|
||||
|
||||
var datepickerOptions={dateFormat:'yy-mm-dd',firstDay:0,showWeek:true,showOtherMonths:true,selectOtherMonths:true};
|
||||
|
||||
$('input.date-input').datepicker(datepickerOptions);
|
||||
|
||||
$('a.pic_date').on('click', function(){
|
||||
$(this).parent().prev().first().focus();
|
||||
})
|
||||
|
||||
|
||||
$("#BluePopupBox").dialog({
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
dialogClass: 'BluePopupBox',
|
||||
minWidth: 753
|
||||
});
|
||||
|
||||
$('a.ProBtn').live('click', function(){
|
||||
$("#BluePopupBox").dialog("open");
|
||||
$(".ui-dialog-titlebar").hide();
|
||||
$("a.CloseBtn").on('click', function(){
|
||||
$("#BluePopupBox" ).dialog("close");
|
||||
});
|
||||
$('#textarea_input_test').focus();
|
||||
});
|
||||
|
||||
var saveProgramAnswers = function() {
|
||||
var test_numbers = 0;
|
||||
var valid = true;
|
||||
var input = null;
|
||||
var output = null;
|
||||
var input_groups = [];
|
||||
$.each($('#BluePopupBox textarea.InputBox'), function(i, val){
|
||||
if ($(val).val().length<=0) {
|
||||
$(val)[0].focus();
|
||||
valid =false;
|
||||
return false;
|
||||
}
|
||||
if (test_numbers %2==0) {
|
||||
input = $(val).val();
|
||||
} else {
|
||||
output = $(val).val();
|
||||
input_groups.push({input: input, output: output});
|
||||
}
|
||||
test_numbers += 1;
|
||||
});
|
||||
|
||||
var language = '';
|
||||
if($('select.language_type').val() == 1){
|
||||
language = 'C';
|
||||
}else if($('select.language_type').val() == 2){
|
||||
language = 'C++';
|
||||
}else if($('select.language_type').val() == 3){
|
||||
language = 'Python';
|
||||
}else if($('select.language_type').val() == 4){
|
||||
language = 'Java';
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
$("input[name=homework_type]").val(2);
|
||||
$('span.program_detail_info').text('('+language+','+test_numbers/2+'组测试)');
|
||||
//保存js值
|
||||
var data = {
|
||||
language_type: $('select.language_type').val(),
|
||||
input_groups: input_groups
|
||||
};
|
||||
//构建到form中
|
||||
$('.program-input').remove();
|
||||
var html=bt('t:program-input-list',data);
|
||||
$("input[name=homework_type]").after(html);
|
||||
}
|
||||
return valid;
|
||||
};
|
||||
|
||||
$("#BluePopupBox a.BlueCirBtn").live('click', function(){
|
||||
if(saveProgramAnswers()){
|
||||
if($( "#BluePopupBox" ).dialog( "isOpen" )){
|
||||
$("#BluePopupBox").dialog( "close" );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#BluePopupBox").on('click', 'a.icon_add', function(){
|
||||
var html = bt('t:test-answer-list', null);
|
||||
$(this).parent('.mt10').after(html);
|
||||
var inputs = document.getElementsByName("program[input][]");
|
||||
var outputs = document.getElementsByName("program[output][]");
|
||||
if (inputs.length == outputs.length) {
|
||||
for (var i=0; i<inputs.length; i++) {
|
||||
autoTextarea2(inputs[i], outputs[i]);
|
||||
autoTextarea2(outputs[i], inputs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$("#BluePopupBox").on('click', 'a.icon_remove', function(){
|
||||
$(this).parent('.mt10').remove();
|
||||
});
|
||||
|
||||
//分组作业
|
||||
$("#GroupPopupBox").dialog({
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
dialogClass: 'BluePopupBox',
|
||||
minWidth: 290
|
||||
});
|
||||
|
||||
$('a.groupBtn').live('click', function(){
|
||||
$("#GroupPopupBox").dialog("open");
|
||||
$(".ui-dialog-titlebar").hide();
|
||||
$("a.popClose").on('click', function(){
|
||||
$("#GroupPopupBox" ).dialog("close");
|
||||
});
|
||||
$("#cancel_group").on('click', function(){
|
||||
$("#GroupPopupBox" ).dialog("close");
|
||||
});
|
||||
$('#min_num').focus();
|
||||
});
|
||||
|
||||
var saveGroupAttr = function() {
|
||||
var valid = true;
|
||||
var base_on_project = 0;
|
||||
var min = $.trim($("#min_num").val());
|
||||
var max = $.trim($("#max_num").val());
|
||||
if(min.length <= 0) {
|
||||
$("#min_num").focus();
|
||||
valid = false;
|
||||
return false;
|
||||
}
|
||||
if(max.length <= 0) {
|
||||
$("#max_num").focus();
|
||||
valid = false;
|
||||
return false;
|
||||
}
|
||||
if ($("#base_on_project").is(":checked")) {
|
||||
base_on_project = 1;
|
||||
}
|
||||
if (valid) {
|
||||
$("input[name=homework_type]").val(3);
|
||||
$('span.group_detail_info').text('分组人数:'+min+'-'+max+' 人');
|
||||
//保存js值
|
||||
var data = {
|
||||
base_on_project: base_on_project,
|
||||
min_num: min,
|
||||
max_num: max
|
||||
};
|
||||
//构建到form中
|
||||
$('.group-input').remove();
|
||||
var html=bt('t:group-input-list',data);
|
||||
$("input[name=homework_type]").after(html);
|
||||
}
|
||||
return valid;
|
||||
};
|
||||
|
||||
$("#GroupPopupBox a.group_btn").live('click', function(){
|
||||
if(saveGroupAttr()){
|
||||
if($( "#GroupPopupBox" ).dialog( "isOpen" )){
|
||||
$("#GroupPopupBox").dialog( "close" );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//代码编辑器
|
||||
if (typeof CodeMirror != "undefined") {
|
||||
var program_name = "text/x-csrc";
|
||||
var language = $('#data-language').attr('data-language');
|
||||
if (language == 1) {
|
||||
program_name = 'text/x-csrc';
|
||||
} else if(language==2){
|
||||
program_name = 'text/x-c++src';
|
||||
}else if(language==3){
|
||||
program_name = 'text/x-cython';
|
||||
} else if(language==4){
|
||||
program_name = 'text/x-java';
|
||||
}
|
||||
|
||||
if ($('#program-src').val().length<=0) {
|
||||
var src = '';
|
||||
if(language==4){
|
||||
src = '\
|
||||
import java.io.*;\n\
|
||||
import java.util.*;\n\
|
||||
\n\
|
||||
//请一定不要修改类名\n\
|
||||
class Main\n\
|
||||
{\n\
|
||||
public static void main (String args[])\n\
|
||||
{\n\
|
||||
//获取参数方式\n\
|
||||
//Scanner in = new Scanner(System.in);\n\
|
||||
//int a = in.nextInt();\n\
|
||||
//int b = in.nextInt();\n\
|
||||
\n\
|
||||
//您的代码\n\
|
||||
}\n\
|
||||
}\n\
|
||||
';
|
||||
}
|
||||
else if(language==1){
|
||||
src = '#include <stdio.h>\n\
|
||||
\n\
|
||||
int main()\n\
|
||||
{\n\
|
||||
//获取参数方式 scanf\n\
|
||||
//int x =0;\n\
|
||||
//int y = 0;\n\
|
||||
//scanf("%d", &x);\n\
|
||||
\n\
|
||||
//结果输出使用prinf\n\
|
||||
//printf("%d",x);\n\
|
||||
\n\
|
||||
return 0;\n\
|
||||
}\n\
|
||||
';
|
||||
} else if(language==2){
|
||||
src = '\
|
||||
#include <iostream>\n\
|
||||
using namespace std;\n\
|
||||
\n\
|
||||
int main()\n\
|
||||
{\n\
|
||||
//获取参数方式 cin\n\
|
||||
//int x =0;\n\
|
||||
//cin >> x;\n\
|
||||
\n\
|
||||
//结果输出使用 cout\n\
|
||||
//cout<<"1";\n\
|
||||
\n\
|
||||
return 0;\n\
|
||||
}\n\
|
||||
';
|
||||
} else if(language==3){
|
||||
src = '\
|
||||
import sys \n\
|
||||
\n\
|
||||
#获取参数方式,使用raw_input\n\
|
||||
#input = raw_input()\n\
|
||||
#a, b = input.split()\n\
|
||||
\n\
|
||||
#结果输出使用 print \n\
|
||||
#print (str(int(a)+int(b)))\n\
|
||||
';
|
||||
}
|
||||
|
||||
$('#program-src').val(src);
|
||||
};
|
||||
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("program-src"), {
|
||||
mode: {name: program_name,
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 2,
|
||||
matchBrackets: true
|
||||
});
|
||||
|
||||
editor.on('change',function(cMirror){
|
||||
// get value right from instance
|
||||
$('#program-src').val(cMirror.getValue());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(function(){
|
||||
//提交作业
|
||||
|
||||
var bt=baidu.template;
|
||||
bt.LEFT_DELIMITER='<!';
|
||||
bt.RIGHT_DELIMITER='!>';
|
||||
|
||||
var tested = false;
|
||||
var valid_form = function() {
|
||||
var src = $('#program-src').val();
|
||||
var title = $('#program-title').val();
|
||||
|
||||
if (!src) {
|
||||
alert('请输入正确的代码');
|
||||
return false;
|
||||
}
|
||||
if (!title) {
|
||||
alert('请输入标题');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
var test_program = function(cb){
|
||||
var homework_id = $('#test-program-btn').attr('data-homework-id');
|
||||
var student_work_id = $('#test-program-btn').attr('data-student-work-id');
|
||||
var src = $('#program-src').val();
|
||||
var title = $('#program-title').val();
|
||||
var is_test = $('input[name=is_test]').val();
|
||||
|
||||
if(!valid_form()){
|
||||
return;
|
||||
}
|
||||
|
||||
$.post(
|
||||
'/student_work/program_test',
|
||||
{homework: homework_id, student_work_id: student_work_id, src: src, title: title, is_test: is_test},
|
||||
function(data,status){
|
||||
tested = true;
|
||||
console.log(data);
|
||||
if(data.index <=0){
|
||||
data.index = $('.ProResultTop').length+1;
|
||||
}
|
||||
|
||||
if (typeof cb == 'function') {cb(data); return;}
|
||||
|
||||
|
||||
var html=bt('t:result-list',data);
|
||||
$('.ProResult').prepend(html);
|
||||
|
||||
if (data.status==0 && is_test != 'true') {
|
||||
var r=confirm("答题正确,是否立刻提交?");
|
||||
if (r) {
|
||||
$(".HomeWorkCon form").submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
$('#test-program-btn').on('click', test_program);
|
||||
|
||||
|
||||
$('#commit-program-work-btn').on('click', function(){
|
||||
if(!valid_form()){
|
||||
return;
|
||||
}
|
||||
if($('.ProResult .ProResultTop').length<=0){
|
||||
var r=confirm("测试后才能提交,是否立刻测试?");
|
||||
if (r) {
|
||||
test_program();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!tested) {
|
||||
test_program(function(data){
|
||||
if (data.status!=0) {
|
||||
var r=confirm("测试不通过,是否强制提交?");
|
||||
if (!r) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
$(".HomeWorkCon form").submit();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
$(".HomeWorkCon form").submit();
|
||||
});
|
||||
|
||||
$('form.edit_student_work').on('keydown', '#program-src', function(){
|
||||
tested = false;
|
||||
});
|
||||
|
||||
//发布作业
|
||||
|
||||
$('#program-src').focus(function(){
|
||||
$(this).css('height', '100px');
|
||||
});
|
||||
|
||||
var datepickerOptions={dateFormat:'yy-mm-dd',firstDay:0,showWeek:true,showOtherMonths:true,selectOtherMonths:true};
|
||||
|
||||
$('input.date-input').datepicker(datepickerOptions);
|
||||
|
||||
$('a.pic_date').on('click', function(){
|
||||
$(this).parent().prev().first().focus();
|
||||
})
|
||||
|
||||
|
||||
$("#BluePopupBox").dialog({
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
dialogClass: 'BluePopupBox',
|
||||
minWidth: 753
|
||||
});
|
||||
$('#BluePopupBox').parent().resizable("disable");
|
||||
$('#BluePopupBox').parent().removeClass("ui-state-disabled");
|
||||
$('#BluePopupBox').parent().css("border","3px solid #269ac9").css("padding","10px");
|
||||
|
||||
$('a.ProBtn').live('click', function(){
|
||||
$("#BluePopupBox").dialog("open");
|
||||
$(".ui-dialog-titlebar").hide();
|
||||
$("a.CloseBtn").on('click', function(){
|
||||
$("#BluePopupBox" ).dialog("close");
|
||||
});
|
||||
$('#textarea_input_test').focus();
|
||||
});
|
||||
|
||||
var saveProgramAnswers = function() {
|
||||
var test_numbers = 0;
|
||||
var valid = true;
|
||||
var input = null;
|
||||
var output = null;
|
||||
var input_groups = [];
|
||||
$.each($('#BluePopupBox textarea.InputBox'), function(i, val){
|
||||
if ($(val).val().length<=0) {
|
||||
$(val)[0].focus();
|
||||
valid =false;
|
||||
return false;
|
||||
}
|
||||
if (test_numbers %2==0) {
|
||||
input = $(val).val();
|
||||
} else {
|
||||
output = $(val).val();
|
||||
input_groups.push({input: input, output: output});
|
||||
}
|
||||
test_numbers += 1;
|
||||
});
|
||||
|
||||
var language = '';
|
||||
if($('select.language_type').val() == 1){
|
||||
language = 'C';
|
||||
}else if($('select.language_type').val() == 2){
|
||||
language = 'C++';
|
||||
}else if($('select.language_type').val() == 3){
|
||||
language = 'Python';
|
||||
}else if($('select.language_type').val() == 4){
|
||||
language = 'Java';
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
$("input[name=homework_type]").val(2);
|
||||
$('span.program_detail_info').text('('+language+','+test_numbers/2+'组测试)');
|
||||
//保存js值
|
||||
var data = {
|
||||
language_type: $('select.language_type').val(),
|
||||
input_groups: input_groups
|
||||
};
|
||||
//构建到form中
|
||||
$('.program-input').remove();
|
||||
var html=bt('t:program-input-list',data);
|
||||
$("input[name=homework_type]").after(html);
|
||||
}
|
||||
return valid;
|
||||
};
|
||||
|
||||
$("#BluePopupBox a.BlueCirBtn").live('click', function(){
|
||||
if(saveProgramAnswers()){
|
||||
if($( "#BluePopupBox" ).dialog( "isOpen" )){
|
||||
$("#BluePopupBox").dialog( "close" );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#BluePopupBox").on('click', 'a.icon_add', function(){
|
||||
var html = bt('t:test-answer-list', null);
|
||||
$(this).parent('.mt10').after(html);
|
||||
var inputs = document.getElementsByName("program[input][]");
|
||||
var outputs = document.getElementsByName("program[output][]");
|
||||
if (inputs.length == outputs.length) {
|
||||
for (var i=0; i<inputs.length; i++) {
|
||||
autoTextarea2(inputs[i], outputs[i]);
|
||||
autoTextarea2(outputs[i], inputs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$("#BluePopupBox").on('click', 'a.icon_remove', function(){
|
||||
$(this).parent('.mt10').remove();
|
||||
});
|
||||
|
||||
//分组作业
|
||||
$("#GroupPopupBox").dialog({
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
dialogClass: 'BluePopupBox',
|
||||
minWidth: 290
|
||||
});
|
||||
$('#GroupPopupBox').parent().resizable("disable");
|
||||
$('#GroupPopupBox').parent().removeClass("ui-state-disabled");
|
||||
$('#GroupPopupBox').parent().css("border","3px solid #269ac9").css("padding","10px");
|
||||
|
||||
$('a.groupBtn').live('click', function(){
|
||||
$("#GroupPopupBox").dialog("open");
|
||||
$(".ui-dialog-titlebar").hide();
|
||||
$("a.popClose").on('click', function(){
|
||||
$("#GroupPopupBox" ).dialog("close");
|
||||
});
|
||||
$("#cancel_group").on('click', function(){
|
||||
$("#GroupPopupBox" ).dialog("close");
|
||||
});
|
||||
$('#min_num').focus();
|
||||
});
|
||||
|
||||
var saveGroupAttr = function() {
|
||||
var valid = true;
|
||||
var base_on_project = 0;
|
||||
var min = $.trim($("#min_num").val());
|
||||
var max = $.trim($("#max_num").val());
|
||||
if(min.length <= 0) {
|
||||
$("#min_num").focus();
|
||||
valid = false;
|
||||
return false;
|
||||
}
|
||||
if(max.length <= 0) {
|
||||
$("#max_num").focus();
|
||||
valid = false;
|
||||
return false;
|
||||
}
|
||||
if ($("#base_on_project").is(":checked")) {
|
||||
base_on_project = 1;
|
||||
}
|
||||
if (valid) {
|
||||
$("input[name=homework_type]").val(3);
|
||||
$('span.group_detail_info').text('分组人数:'+min+'-'+max+' 人');
|
||||
//保存js值
|
||||
var data = {
|
||||
base_on_project: base_on_project,
|
||||
min_num: min,
|
||||
max_num: max
|
||||
};
|
||||
//构建到form中
|
||||
$('.group-input').remove();
|
||||
var html=bt('t:group-input-list',data);
|
||||
$("input[name=homework_type]").after(html);
|
||||
}
|
||||
return valid;
|
||||
};
|
||||
|
||||
$("#GroupPopupBox a.group_btn").live('click', function(){
|
||||
if(saveGroupAttr()){
|
||||
if($( "#GroupPopupBox" ).dialog( "isOpen" )){
|
||||
$("#GroupPopupBox").dialog( "close" );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//代码编辑器
|
||||
if (typeof CodeMirror != "undefined") {
|
||||
var program_name = "text/x-csrc";
|
||||
var language = $('#data-language').attr('data-language');
|
||||
if (language == 1) {
|
||||
program_name = 'text/x-csrc';
|
||||
} else if(language==2){
|
||||
program_name = 'text/x-c++src';
|
||||
}else if(language==3){
|
||||
program_name = 'text/x-cython';
|
||||
} else if(language==4){
|
||||
program_name = 'text/x-java';
|
||||
}
|
||||
|
||||
if ($('#program-src').val().length<=0) {
|
||||
var src = '';
|
||||
if(language==4){
|
||||
src = '\
|
||||
import java.io.*;\n\
|
||||
import java.util.*;\n\
|
||||
\n\
|
||||
//请一定不要修改类名\n\
|
||||
class Main\n\
|
||||
{\n\
|
||||
public static void main (String args[])\n\
|
||||
{\n\
|
||||
//获取参数方式\n\
|
||||
//Scanner in = new Scanner(System.in);\n\
|
||||
//int a = in.nextInt();\n\
|
||||
//int b = in.nextInt();\n\
|
||||
\n\
|
||||
//您的代码\n\
|
||||
}\n\
|
||||
}\n\
|
||||
';
|
||||
}
|
||||
else if(language==1){
|
||||
src = '#include <stdio.h>\n\
|
||||
\n\
|
||||
int main()\n\
|
||||
{\n\
|
||||
//获取参数方式 scanf\n\
|
||||
//int x =0;\n\
|
||||
//int y = 0;\n\
|
||||
//scanf("%d", &x);\n\
|
||||
\n\
|
||||
//结果输出使用prinf\n\
|
||||
//printf("%d",x);\n\
|
||||
\n\
|
||||
return 0;\n\
|
||||
}\n\
|
||||
';
|
||||
} else if(language==2){
|
||||
src = '\
|
||||
#include <iostream>\n\
|
||||
using namespace std;\n\
|
||||
\n\
|
||||
int main()\n\
|
||||
{\n\
|
||||
//获取参数方式 cin\n\
|
||||
//int x =0;\n\
|
||||
//cin >> x;\n\
|
||||
\n\
|
||||
//结果输出使用 cout\n\
|
||||
//cout<<"1";\n\
|
||||
\n\
|
||||
return 0;\n\
|
||||
}\n\
|
||||
';
|
||||
} else if(language==3){
|
||||
src = '\
|
||||
import sys \n\
|
||||
\n\
|
||||
#获取参数方式,使用raw_input\n\
|
||||
#input = raw_input()\n\
|
||||
#a, b = input.split()\n\
|
||||
\n\
|
||||
#结果输出使用 print \n\
|
||||
#print (str(int(a)+int(b)))\n\
|
||||
';
|
||||
}
|
||||
|
||||
$('#program-src').val(src);
|
||||
};
|
||||
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("program-src"), {
|
||||
mode: {name: program_name,
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 2,
|
||||
matchBrackets: true
|
||||
});
|
||||
|
||||
editor.on('change',function(cMirror){
|
||||
// get value right from instance
|
||||
$('#program-src').val(cMirror.getValue());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
|
@ -55,6 +55,43 @@ function show_more_project(url){
|
|||
);
|
||||
}
|
||||
|
||||
//个人留言
|
||||
function jour_submit(){
|
||||
if(jourReplyVerify()){
|
||||
$("#private_flag").val("0");
|
||||
jour_content_editor.sync();//提交内容之前要sync,不然服务器端取不到值
|
||||
$("#user_feedback_new").submit();
|
||||
}
|
||||
}
|
||||
|
||||
function private_jour_submit(){
|
||||
if(jourReplyVerify()){
|
||||
$("#private_flag").val("1");
|
||||
jour_content_editor.sync();//提交内容之前要sync,不然服务器端取不到值
|
||||
$("#user_feedback_new").submit();
|
||||
}
|
||||
}
|
||||
|
||||
function jourReplyVerify() {
|
||||
var content = jour_content_editor.html();//$.trim($("#message_content").val());
|
||||
if (jour_content_editor.isEmpty()) {
|
||||
$("#jour_content_span").text("回复不能为空");
|
||||
$("#jour_content_span").css('color', '#ff0000');
|
||||
$("#submit_feedback_user").one('click',function() {
|
||||
jour_submit();
|
||||
});
|
||||
$("#private_submit_feedback_user").one('click',function() {
|
||||
private_jour_submit();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$("#jour_content_span").text("填写正确");
|
||||
$("#jour_content_span").css('color', '#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//老师提交 新建/修改 作业
|
||||
function submit_homework(id){
|
||||
if(!regex_homework_name()){
|
||||
|
|
|
@ -1099,7 +1099,7 @@ a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; c
|
|||
.postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;}
|
||||
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
|
||||
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
|
||||
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important;}
|
||||
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;}
|
||||
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
|
||||
.postDetailDate {color:#888888; font-size:12px; float:left;}
|
||||
.postDetailReply { margin-top:28px; color:#888888; float:right;}
|
||||
|
@ -1221,7 +1221,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
|
|||
.hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;}
|
||||
.mr150 {margin-right:150px;}
|
||||
.relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;}
|
||||
.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;}
|
||||
.captainName {max-width:75px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;}
|
||||
|
||||
/*上传资源弹窗*/
|
||||
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
|
||||
|
@ -1257,3 +1257,6 @@ div.disable_link {background-color: #c1c1c1 !important;}
|
|||
|
||||
.fn {font-weight:normal}
|
||||
.boutiqueP {position:absolute; left:0px; top:0px;}
|
||||
|
||||
.mh18 {max-height: 18px;}
|
||||
.relatePWrap{max-height: 210px;overflow:hidden;}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
/* CSS Document */
|
||||
/* 2015-06-26 */
|
||||
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
|
||||
|
@ -77,6 +78,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
|
|||
.ml36{ margin-left:36px; }
|
||||
.ml40{ margin-left:40px;}
|
||||
.ml45{ margin-left:45px;}
|
||||
.ml50{ margin-left: 50px;}
|
||||
.ml55{ margin-left:55px;}
|
||||
.ml30{ margin-left:30px;}
|
||||
.ml60{ margin-left:60px;}
|
||||
|
@ -95,7 +97,9 @@ a.linkGrey6:hover {color:#ffffff !important;}
|
|||
.mr20{ margin-right:20px;}
|
||||
.mr30{ margin-right:30px !important;}
|
||||
.mr40{ margin-right:40px !important;}
|
||||
.mr65 {margin-right: 65px;}
|
||||
.mw20{ margin: 0 20px;}
|
||||
.mw400 {max-width: 400px !important;}
|
||||
.mt-20 {margin-top:-20px;}
|
||||
.mt-4 {margin-top: -4px;}
|
||||
.mt0 {margin-top: 0px !important;}
|
||||
|
@ -121,6 +125,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
|
|||
.w70{ width:70px;}
|
||||
.w80{ width:80px;}
|
||||
.w90{ width:90px;}
|
||||
.w100 {width: 100px;}
|
||||
.w110{width:110px;}
|
||||
.w210{ width:210px;}
|
||||
.w150{ width:150px;}
|
||||
|
@ -552,7 +557,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
|
|||
/*.navHomepageProfile ul li ul {display:none;}
|
||||
.navHomepageProfile ul li:hover ul {display:block;}*/
|
||||
.homepageLeft {width:240px; float:left; margin-right:10px; margin-bottom:10px;}
|
||||
.homepageRight {width:750px; float:left; margin-top:10px; margin-bottom:10px;}
|
||||
.homepageRight {width:750px; float:left; margin-top:10px; margin-bottom:10px; margin-top:10px;}
|
||||
.homepagePortraitContainer {width:208px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px; padding:15px;}
|
||||
.homepagePortraitImage {width:78px; height:78px; position:relative; border:1px solid #cbcbcb; padding: 2px;}
|
||||
.homepagePortraitImage:hover {border:1px solid #269ac9;}
|
||||
|
@ -836,7 +841,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re
|
|||
.postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;}
|
||||
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
|
||||
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
|
||||
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important;}
|
||||
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;}
|
||||
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
|
||||
.postDetailDate {color:#888888; font-size:12px; float:left;}
|
||||
.postDetailReply { margin-top:28px; color:#888888; float:right;display: inline}
|
||||
|
@ -1416,3 +1421,4 @@ span.at a{color:#269ac9;text-decoration: none;}
|
|||
.orgDirection {width:392px; background-color:#f1f1f1; height:30px; vertical-align:middle; line-height:30px; color:#585858; padding-left:10px;}
|
||||
.orgSendSearch {border:1px solid #dddddd; outline:none; width:262px; height:22px; padding-left:10px; float:left;}
|
||||
|
||||
.relatePWrap{max-height: 210px;overflow:hidden;}
|
||||
|
|
|
@ -1109,7 +1109,7 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;}
|
|||
.postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;}
|
||||
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
|
||||
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
|
||||
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important;}
|
||||
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;}
|
||||
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
|
||||
.postDetailDate {color:#888888; font-size:12px; float:left;}
|
||||
.postDetailReply { margin-top:28px; color:#888888; float:right;}
|
||||
|
|
|
@ -71,6 +71,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.ml40{ margin-left:40px;}
|
||||
.ml45{ margin-left:45px;}
|
||||
.ml48{ margin-left:48px;}
|
||||
.ml50{ margin-left: 50px;}
|
||||
.ml53{margin-left:53px;}
|
||||
.ml55{ margin-left:55px;}
|
||||
.ml58{margin-left:58px;}
|
||||
|
@ -102,6 +103,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.mr50{margin-right: 50px;}
|
||||
.mr55{margin-right: 55px;}
|
||||
.mr60 {margin-right:60px;}
|
||||
.mr65 {margin-right:65px;}
|
||||
.mr70{margin-right: 70px;}
|
||||
.mw15{margin:0 15px;}
|
||||
.mr90 {margin-right:90px;}
|
||||
|
@ -113,6 +115,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.mt5{ margin-top:5px;}
|
||||
.mt8{ margin-top:8px;}
|
||||
.mt10{ margin-top:10px !important;}
|
||||
.mt20{margin-top: 20px;}
|
||||
.mt30{ margin-top: 30px;}
|
||||
.mt40{ margin-top: 40px;}
|
||||
.mt12 { margin-top:12px !important;}
|
||||
|
@ -167,7 +170,8 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.h70{ height:70px;}
|
||||
.h150{ height:150px;}
|
||||
.p10 {padding-left:10px; padding-right:10px;}
|
||||
.mw400 {max-width: 400px;}
|
||||
.mw400 {max-width: 400px !important;}
|
||||
.mh18 {max-height: 18px;}
|
||||
|
||||
/* Font & background Color */
|
||||
a.b_grey{ background: #F5F5F5;}
|
||||
|
@ -302,7 +306,7 @@ a:hover.bgreen_n_btn{background:#08a384;}
|
|||
.blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;}
|
||||
.orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;}
|
||||
.bgreen_btn_cir{ background:#1abc9c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;}
|
||||
.grey_border{border:1px solid #dddddd !important; }
|
||||
.grey_border{border:1px solid #dddddd !important;}
|
||||
/* commonpic */
|
||||
.pic_date{ display:block; background:url(../images/new_project/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; float:left;}
|
||||
.pic_add{ display:block; background:url(../images/new_project/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; float:left;}
|
||||
|
@ -1004,3 +1008,5 @@ a:hover.userCancel{border:1px solid #888888; }
|
|||
.userCard em {display:block; border-width:8px; position:absolute; bottom:-17px; left:110px; border-style:solid dashed dashed dashed; border-color:#eaeaea transparent transparent transparent; font-size:0; line-height:0;}
|
||||
.userCardM {width:201px; height:20px; border:1px solid #dddddd; resize:none;}
|
||||
.resourceCopy {padding:0px; margin:0px; width:12px; height:12px; display:inline-block;}
|
||||
|
||||
.relatePWrap{max-height: 210px;overflow:hidden;}
|
||||
|
|
|
@ -35,7 +35,7 @@ ul.subNavArrow:hover li ul {display:block;}
|
|||
a.mesIcon {background:url(../images/mes_icon.png) -5px -73px no-repeat; padding-left:23px;}
|
||||
a.personalIcon {background:url(../images/mes_icon.png) -6px -16px no-repeat; padding-left:23px;}
|
||||
.mesType {background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 15px; left:-50px; font-size:12px; color:#888888; display:none; line-height:2; z-index:999; white-space:nowrap;}
|
||||
a.greyBtn2 {float:right; text-align:center; font-size:12px; color:#ffffff; background-color:#cecece; padding:3px 10px;}
|
||||
a.greyBtn2 {float:right; text-align:center; font-size:12px; color:#ffffff; background-color:#aaaaaa; padding:3px 10px;}
|
||||
.PMTag {padding:0px 5px; background-color:#555555; border-radius:3px; color:#ffffff;}
|
||||
.upload_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;}
|
||||
.upload_box{ width:430px; margin:15px auto;}
|
||||
|
|
Loading…
Reference in New Issue