9e7323539f923b5387b9ec9239b5aeb, reversing
changes made to da9c374ed9.

Conflicts:
	app/views/users/_user_homework_form.html.erb
This commit is contained in:
sw 2015-09-01 17:24:17 +08:00
commit dd3fe5915e
16 changed files with 939 additions and 934 deletions

View File

@ -223,7 +223,7 @@ class UsersController < ApplicationController
end
# end
##added by fq
##added by fq
def watch_bids
# cond = 'bids.reward_type <> 1'
# @bids = Bid.watched_by(@user).where('reward_type = ?', 1) # added by huang

View File

@ -546,7 +546,7 @@ module UsersHelper
type = []
user.courses.select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
option = []
option << course.name
option << course.name+""+course.time.to_s+course.term+""
option << course.id
type << option
end

View File

@ -101,9 +101,9 @@
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
<% if is_current_user%>
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
<%=link_to "", new_course_path, :class => "homepageMenuSetting fr"%>
<%=link_to "", new_course_path, :class => "homepageMenuSetting fr", :title => "新建课程"%>
<% else%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:remote => true%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:remote => true, :title => "加入课程"%>
<% end%>
<% end%>
</div>
@ -117,7 +117,7 @@
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuForge').slideToggle();">项目</a>
<% if is_current_user%>
<%=link_to "", new_project_path, :class => "homepageMenuSetting fr"%>
<%=link_to "", new_project_path, :class => "homepageMenuSetting fr", :title => "新建项目"%>
<% end%>
</div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuForge">

View File

@ -1,4 +1,4 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
@ -121,4 +121,4 @@
</div>
<% end %>
</div>
</div>
</div>

View File

@ -34,7 +34,7 @@
<li class="fl">
<input name="projects_ids[]" type="checkbox" value="<%= project.id %>" class="courseSendCheckbox"/>
</li>
<li class="sendCourseName fl"><%= truncate( project.name,:length=>18)%></li>
<li class="sendCourseName fl"><%= project.name%></li>
</ul>
<% end %>
</div>

View File

@ -34,7 +34,7 @@
<li class="fl">
<input name="course_ids[]" type="checkbox" value="<%= course.id %>" class="courseSendCheckbox"/>
</li>
<li class="sendCourseName fl"><%= truncate(course.name,:length=>18)%></li>
<li class="sendCourseName fl"><%= course.name%></li>
</ul>
<% end %>
</div>

View File

@ -74,7 +74,11 @@
</div>
</div>
<div class="cl"></div>
<script type="text/javascript">
$(function (){
$("#course_id").append("<option value='-1' id='option_select' hidden selected>请选择发布作业的课程</option>");
});
</script>
<script id="t:test-answer-list" type="text/html">
<div class="mt10">

View File

@ -1,10 +1,11 @@
<script type="text/javascript">
function reset_homework(){
$("#homework_name").val("");
$("#homework_end_time").val("<%= (Time.now + 3600 * 24).strftime('%Y-%m-%d')%>");
$("#course_id").val("");
$("#homework_end_time").val("");
$("#course_id").val($("#option_select").val());
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new })%>");
homework_description_editor.html("");
$("#homework_editor").toggle();
}
function checkAllBox(doc){

View File

@ -4,9 +4,9 @@
<%= stylesheet_link_tag 'leftside' %>
<%= javascript_include_tag 'attachments'%>
<!--<script type="text/css">-->
<!--html,body{ overflow-y:scroll;}-->
<!--html,body{ overflow:scroll; min-height:101%;}-->
<!--html{ overflow:-moz-scrollbars-vertical;}-->
<!--html,body{ overflow-y:scroll;}-->
<!--html,body{ overflow:scroll; min-height:101%;}-->
<!--html{ overflow:-moz-scrollbars-vertical;}-->
<!--</script>-->
<script>
function remote_get_resources(user_id,type){
@ -67,7 +67,7 @@
</li>
</ul>
</div>
</div>
</div>
<div class="resources mt10" id="users_setting">
<div class="resourcesSearchBanner mt10">
<div class="resourcesUploadBox">
@ -122,7 +122,7 @@
<div class="cl"></div>
<!--<div id="upload_box" style="display: none">-->
<!--<%#= render :partial => 'upload_resource' ,:locals => {:user=>@user}%>-->
<!--<%#= render :partial => 'upload_resource' ,:locals => {:user=>@user}%>-->
<!--</div>-->
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu" id="contextMenu">
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)preview();" onfocus="this.blur()">预览</a></li>
@ -146,7 +146,7 @@
var id; //资源id
var sendType; //发送到课程 1 发送到项目 2
var lastSendType; //保存上次发送的发送类型
$("#resources_list").mousedown(function(e) {
$("#resources_list").mousedown(function(e) {
//如果是右键的话
if (3 == e.which) {
document.oncontextmenu = function() {return false;}
@ -179,7 +179,7 @@ $("#resources_list").mousedown(function(e) {
//将当前元素赋给 上一个对象 保存起来。
last_line = line;
}
});
});
//元素包含关系计算
var contains = function(root, el) {
if (root.compareDocumentPosition)
@ -191,7 +191,7 @@ $("#resources_list").mousedown(function(e) {
if (el === root) return true;
return false;
}
$(document.body).click(function(e) {
$(document.body).click(function(e) {
//在列表上的任何单击事件都要恢复原来的样子
//隐藏右键菜单
//e.preventDefault();
@ -218,7 +218,7 @@ $(document.body).click(function(e) {
restore();
}
line = null;
});
});
//只要有一个选中了就是true
function checkboxSelected(){
selected = false;
@ -477,54 +477,54 @@ $(document.body).click(function(e) {
lastSendType = sendType;
}
// var iWidth = document.documentElement.clientWidth;
// var iHeight = document.documentElement.clientHeight;
// var moveX = 0;
// var moveY = 0;
// var moveTop = 0;
// var moveLeft = 0;
// var moveable = false;
// var docMouseMoveEvent = document.onmousemove;
// var docMouseUpEvent = document.onmouseup;
// $("#upload_box").mousedown(function() {
// var evt = getEvent();
// moveable = true;
// moveX = evt.clientX;
// moveY = evt.clientY;
//
// moveTop = parseInt($("#upload_box").css('top'));
// moveLeft = parseInt($("#upload_box").css('left'));
//
// $(document).mousemove( function() {
// if (moveable) {
// var evt = getEvent();
// var x = moveLeft + evt.clientX - moveX;
// var y = moveTop + evt.clientY - moveY;
// if ( x > 0 &&( x + 322 < iWidth) && y > 0 && (y + 257 < iHeight) ) {
// $("#upload_box").css('left', x + "px");
// $("#upload_box").css('top', y + "px");
// console.log( moveX)
// console.log( moveY)
// }
// }
// });
// $(document).mouseup (function () {
// if (moveable) {
// document.onmousemove = docMouseMoveEvent;
// document.onmouseup = docMouseUpEvent;
// moveable = false;
// moveX = 0;
// moveY = 0;
// moveTop = 0;
// moveLeft = 0;
// }
// });
// });
//
// // 获得事件Event对象用于兼容IE和FireFox
// function getEvent() {
// return window.event || arguments.callee.caller.arguments[0];
// }
// var iWidth = document.documentElement.clientWidth;
// var iHeight = document.documentElement.clientHeight;
// var moveX = 0;
// var moveY = 0;
// var moveTop = 0;
// var moveLeft = 0;
// var moveable = false;
// var docMouseMoveEvent = document.onmousemove;
// var docMouseUpEvent = document.onmouseup;
// $("#upload_box").mousedown(function() {
// var evt = getEvent();
// moveable = true;
// moveX = evt.clientX;
// moveY = evt.clientY;
//
// moveTop = parseInt($("#upload_box").css('top'));
// moveLeft = parseInt($("#upload_box").css('left'));
//
// $(document).mousemove( function() {
// if (moveable) {
// var evt = getEvent();
// var x = moveLeft + evt.clientX - moveX;
// var y = moveTop + evt.clientY - moveY;
// if ( x > 0 &&( x + 322 < iWidth) && y > 0 && (y + 257 < iHeight) ) {
// $("#upload_box").css('left', x + "px");
// $("#upload_box").css('top', y + "px");
// console.log( moveX)
// console.log( moveY)
// }
// }
// });
// $(document).mouseup (function () {
// if (moveable) {
// document.onmousemove = docMouseMoveEvent;
// document.onmouseup = docMouseUpEvent;
// moveable = false;
// moveX = 0;
// moveY = 0;
// moveTop = 0;
// moveLeft = 0;
// }
// });
// });
//
// // 获得事件Event对象用于兼容IE和FireFox
// function getEvent() {
// return window.event || arguments.callee.caller.arguments[0];
// }
</script>

View File

@ -675,7 +675,7 @@ a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}
/*底部*/
#Footer{background-color:#ffffff; padding-bottom:15px; color:#666666;} /*margin-bottom:10px;*/
.footerAboutContainer {width:auto; border-bottom:1px solid #efefef;}
.footerAbout{ width:455px; margin:0 auto;height:35px; line-height:35px; padding-top: 10px; }
.footerAbout{ width:365px; margin:0 auto;height:35px; line-height:35px; padding-top: 10px; }
.languageBox {width:55px; height:20px; margin-left:5px; outline:none; color:#666666; border:1px solid #d9d9d9;}
.departments{ width:890px; margin:5px auto 0 auto;height:30px;line-height:30px;}
.copyright{ width:375px; margin:0 auto;height:20px;line-height:20px;}