Conflicts:
	app/views/users/_course_message.html.erb
	app/views/users/_course_news.html.erb
	app/views/users/_project_issue.html.erb
	app/views/users/_project_message.html.erb
This commit is contained in:
sw 2015-09-01 15:28:03 +08:00
commit 5f42ce4c80
26 changed files with 294 additions and 121 deletions

View File

@ -381,14 +381,107 @@ class UsersController < ApplicationController
#用户从资源库导入资源到作业
def user_import_resource
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@user = User.current
user_course_ids = @user.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc")
@type = params[:type]
@homework_id = params[:homework_id]
@limit = 7
@is_remote = true
@atta_count = @attachments.count
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
@offset ||= @atta_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,7
respond_to do |format|
format.js
end
end
#引入资源列表根据类型过滤
def user_resource_type
if User.current.id.to_i != params[:id].to_i
render_403
return
end
if(params[:type].blank? || params[:type] == "1") #全部
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc")
elsif params[:type] == "2" #课程资源
user_course_ids = User.current.courses.map { |c| c.id}
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) ").order("created_on desc")
elsif params[:type] == "3" #项目资源
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project'").order("created_on desc")
elsif params[:type] == "4" #附件
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
elsif params[:type] == "5" #用户资源
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal'").order("created_on desc")
end
@type = params[:type]
@limit = 7
@is_remote = true
@atta_count = @attachments.count
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
@offset ||= @atta_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,7
respond_to do |format|
format.js
end
end
#引入资源列表根据关键词过滤
def user_ref_resource_search
search = params[:search].to_s.strip.downcase
if(params[:type].blank? || params[:type] == "1") #全部
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 取交集并查询
@attachments = Attachment.where("((author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
" or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))) and (filename like '%#{search}%') ").order("created_on desc")
elsif params[:type] == "2" #课程资源
user_course_ids = User.current.courses.map { |c| c.id}
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like '%#{search}%') ").order("created_on desc")
elsif params[:type] == "3" #项目资源
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like '%#{search}%')").order("created_on desc")
elsif params[:type] == "4" #附件
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like '%#{search}%')").order("created_on desc")
elsif params[:type] == "5" #用户资源
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like '%#{search}%')").order("created_on desc")
end
@type = params[:type]
@limit = 7
@is_remote = true
@atta_count = @attachments.count
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
@offset ||= @atta_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,7
respond_to do |format|
format.js
end
end
#将资源批量引入
def import_resources_to_homework
@attachments = []
unless params[:checkbox1].nil? || params[:checkbox1].blank?
params[:checkbox1].each do |id|
atta = Attachment.find(id)
att_copy = atta.copy
att_copy.container_id = nil
att_copy.container_type = nil
att_copy.copy_from = atta.id
att_copy.save
@attachments << att_copy
end
end
respond_to do |format|
format.js
end
end
include CoursesHelper
def user_courses
@ -972,7 +1065,7 @@ class UsersController < ApplicationController
#@user.save_attachments(params[:attachments],User.current)
# Container_type为Principal
Attachment.attach_filesex(@user, params[:attachments], params[:attachment_type])
if(params[:type].nil? || params[:type] == "1") #全部
if(params[:type].blank?|| params[:type] == "1") #全部
if User.current.id.to_i == params[:id].to_i
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
@ -1034,7 +1127,7 @@ class UsersController < ApplicationController
end
end
if(params[:type].nil? || params[:type] == "1") #全部
if(params[:type].blank? || params[:type] == "1") #全部
if User.current.id.to_i == params[:id].to_i
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
@ -1173,6 +1266,18 @@ class UsersController < ApplicationController
else
@flag = false
end
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc")
@type = params[:type]
@limit = 25
@user = User.current
@is_remote = true
@atta_count = @attachments.count
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
@offset ||= @atta_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,25
respond_to do |format|
format.js
end
@ -1229,7 +1334,18 @@ class UsersController < ApplicationController
else
@flag=true
end
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc")
@type = params[:type]
@limit = 25
@user = User.current
@is_remote = true
@atta_count = @attachments.count
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
@offset ||= @atta_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,25
respond_to do |format|
format.js
end
@ -1444,7 +1560,7 @@ class UsersController < ApplicationController
render_403
return
end
if(params[:type].nil? || params[:type] == "1") #全部
if(params[:type].blank? || params[:type] == "1") #全部
if User.current.id.to_i == params[:id].to_i
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+

View File

@ -20,12 +20,12 @@
<% end %>
<% end %>
</td>
<td rowspan="2" >
<!--<td rowspan="2" >
<div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<%#= text_field_tag 'name', params[:name], :size => 30 %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
</div>
</td>
</td>-->
</tr>
<tr>
<td >

View File

@ -1,4 +1,4 @@
<div id="Footer">
<div id="Footer" class="f12">
<div class="footerAboutContainer">
<ul class="footerAbout">
<li class="fl"><span class="f_grey mw20" title="暂未开放"><%= l(:label_about_us)%></span>|</li>

View File

@ -1,6 +1,6 @@
<% courses.each do |course|%>
<li class="homepageLeftMenuCoursesLine">
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}", :title => course.name%>
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}", :title => course.name+""+course.time.to_s+course.term+""%>
</li>
<% 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 image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting fr"), new_course_path%>
<%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting fr",title: "新建课程"), new_course_path%>
<% else%>
<%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting fr"), join_private_courses_courses_path ,:remote => true%>
<%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting fr", title:"加入课程"), join_private_courses_courses_path ,:remote => true%>
<% end%>
<% end%>
</div>
@ -117,7 +117,7 @@
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuForge').slideToggle();">项目</a>
<% if is_current_user%>
<%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting fr"), new_project_path%>
<%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting fr",title:"新建项目"), new_project_path%>
<% end%>
</div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuForge">

View File

@ -17,13 +17,13 @@
<% end %>
<% end %>
</td>
<td rowspan="2" >
<!--<td rowspan="2" >
<div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<%#= text_field_tag 'name', params[:name], :size => 30 %>
<%#= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
</div>
</td>
</td>-->
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to request.host() + "/projects", :controller => 'projects', :action => 'course', :project_type => 1 %> </a></td>
@ -44,14 +44,14 @@
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
<% end %>
</td>
<td rowspan="2" >
<!--<td rowspan="2" >
<script type="text/javascript">
function regexName()
{
var name = $.trim($("#name").val());
if(name.length == 0)
{
$("#project_name_span").text("<%= l(:label_search_conditions_not_null) %>");
$("#project_name_span").text("<%#= l(:label_search_conditions_not_null) %>");
$("#project_name_span").css('color','#ff0000');
$("#project_name_span").focus();
return false;
@ -69,16 +69,16 @@
}
</script>
<div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => "regexName();" %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <!--修改项目搜索按钮的样式 -->
<!-- <a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a> -->
<%#= text_field_tag 'name', params[:name], :size => 30, :onkeyup => "regexName();" %>
<%#= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %> &lt;!&ndash;修改项目搜索按钮的样式 &ndash;&gt;
&lt;!&ndash; <a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%#= l(:label_search)%>
</a> &ndash;&gt;
<br />
<span id="project_name_span" style="float: left"></span>
</div>
</td>
</td>-->
</tr>
<tr>
<td style="padding-left: 8px">

View File

@ -90,7 +90,7 @@
<ul>
<% activity.children.reorder("created_on desc").each do |reply|%>
<% replies_all_i=replies_all_i+1 %>
<li nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => "45", :height => "45"), user_path(reply.author_id), :alt => "用户头像" %>
</div>

View File

@ -64,7 +64,7 @@
<ul>
<% activity.comments.reorder("created_on desc").each do |comment| %>
<% replies_all_i=replies_all_i+1 %>
<li nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "45", :height => "45"), user_path(comment.author_id), :alt => "用户头像" %>
</div>

View File

@ -102,7 +102,7 @@
<ul>
<% activity.journals.reorder("created_on desc").each do |reply| %>
<% replies_all_i=replies_all_i+1 %>
<li nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.user), :width => "45", :height => "45"), user_path(reply.user_id), :alt => "用户头像" %>
</div>

View File

@ -86,7 +86,7 @@
<ul>
<% activity.children.reorder("created_on desc").each do |reply| %>
<% replies_all_i=replies_all_i+1 %>
<li nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => "45", :height => "45"), user_path(reply.author_id), :alt => "用户头像" %>
</div>

View File

@ -1,5 +1,8 @@
<% if attachments.nil? || attachments.empty? %>
<!--<p class="nodata">-->
<!--<%#= l(:label_no_data) %>-->
<!--</p>-->
<% else %>
<% attachments.each do |attach| %>
<ul class="resourcesList">

View File

@ -1,26 +1,67 @@
<div class="coursesChoosePopup" id="coursesChoosePopup">
<div>
<div class="sendText">资源库</div>
</div>
<script>
// $(document).ready(function(){
//// var popupHeight = $(".referenceResourcesPopup").outerHeight(true);
//// $(".referenceResourcesPopup").css("marginTop",-popupHeight/2);
//
//
// $(".resourcePopupClose").click(function(){
// $(".referenceResourcesPopup").css("display","none");
// });
// });
<div >
<form class="coursesSearchBox">
<input type="text" name="homework_name" placeholder="输入资源名称进行搜索" class="searchCoursesPopup" id="search_homework_name"/>
<a href="javascript:void(0);" class="searchIconPopup" onclick="search_homework_by_name('<%= user_search_homeworks_user_path(User.current.id)%>');"></a>
</form>
$(document).ready(function(){
$(".referenceTypeBlock").click(function(){
var activeBlock = $(".referenceResourceType").children(".referenceTypeActive");
activeBlock.removeClass("referenceTypeActive");
$(this).addClass("referenceTypeActive");
});
});
</script>
<!--<div class="referenceResourcesPopup">-->
<div>
<div class="referenceText">引用资源库资源</div>
</div>
<div>
<div class="referenceResourceType fl">
<a href="<%= user_resource_type_user_path(user)%>" class="referenceTypeBlock referenceTypeActive" data-remote="true" >资源库</a>
<a href="<%= user_resource_type_user_path(user,:type=>'2')%>" class="referenceTypeBlock" data-remote="true">课程资源</a>
<a href="<%= user_resource_type_user_path(user,:type=>'3')%>" class="referenceTypeBlock" data-remote="true">项目资源</a>
<a href="<%= user_resource_type_user_path(user,:type=>'5')%>" class="referenceTypeBlock" data-remote="true">用户资源</a>
<a href="<%= user_resource_type_user_path(user,:type=>'4')%>" class="referenceTypeBlock" data-remote="true">附件</a> </div>
<div class="fr">
<!--<form class="referenceSearchBox">-->
<%= form_tag(user_ref_resource_search_user_path(user),:method => 'get',:remote=>'true',:class=>'referenceSearchBox') do%>
<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="searchReferencePopup" />
<a href="javascript:void(0);" onclick="$(this).parent().submit();" class="referenceSearchIcon"></a>
<% end %>
<!--</form>-->
</div>
<div class="cl"></div>
</div>
<div class="resourcesListBanner">
<ul class="resourcesListTab">
<li class="resourcesListCheckbox fl"> </li>
<li class="resourcesListName fl">资源名称</li>
<li class="resourcesListSize fl">大小</li>
<li class="resourcesListType fl">类别</li>
<li class="resourcesListUploader fl">上传者</li>
<li class="resourcesListTime fl">上传时间</li>
</ul>
</div>
<%= form_tag(import_resources_to_homework_user_path(user),:method => 'post',:remote=>'true') do %>
<input type="hidden" name="homework_id" value="<%= homework_id%>"/>
<div style="height: 300px" id="user_ref_resources">
<%= render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments} %>
</div>
<div >
<ul class="wlist" id="resource_ref_pages" style="margin-top: 5px;">
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
</div>
<div>
<div class="courseSendSubmit"><a href="javascript:void(0);" onclick="$(this).parent().parent().parent().submit();" class="sendSourceText">确定</a></div>
<div class="courseSendCancel"><a href="javascript:void(0);" onclick="hideModal();" class="sendSourceText">取消</a></div>
</div>
<%= form_tag(user_select_homework_users_path, :multipart => true,:remote => true,:name=>"select_homework_form",:id=>'select_homework_form') do %>
<div class="homeworkListForm mb10 " id="homework_list_form_show">
<%= render :partial => 'users/show_user_homework_form', :locals => {:user_homeworks => @user_homeworks}%>
</div>
<div>
<div class="courseSendSubmit">
<a href="javascript:void(0);" class="sendSourceText" onclick="$('#select_homework_form').submit();">确定</a>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" class="sendSourceText" onclick="hideModal('#coursesChoosePopup')">取消</a>
</div>
</div>
<% end%>
<div class="cl"></div>
</div>
<% end %>
<!--</div>-->

View File

@ -46,8 +46,9 @@
<div class="cl"></div>
<div class="mt5 fl">
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
<a href="javascript:void(0);" class="AnnexBtn fl mt3" onclick="$('#_file').click();">上传附件</a>
<%#= link_to "资源库", user_import_resource_user_path(User.current.id),:class => "FilesBtn fl mr15 mt3",:remote => true%>
<%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mr15 mt3",:remote => true%>
</div>
<% content_for :header_tags do %>

View File

@ -1,14 +1,13 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<div class="HomeWorkCon">
<div>
<input type="text" name="homework_common[name]" id="homework_name" class="InputBox W700" maxlength="255" onfocus="$('#homework_editor').show()" onkeyup="regex_homework_name();" placeholder="请输入作业标题" value="<%= homework.name%>" >
<input type="text" name="homework_common[name]" id="homework_name" class="InputBox w712" maxlength="255" onfocus="$('#homework_editor').show()" onkeyup="regex_homework_name();" placeholder="请输入作业标题" value="<%= homework.name%>" >
<p id="homework_name_span" class="c_red mt5"></p>
</div>
<div class="cl"></div>
<div class=" mt10">
<%= link_to "导入作业", user_import_homeworks_user_path(User.current.id),:class => "BlueCirBtn fl mr10",:remote => true%>
<span class="fl mt5 ml10">截止日期:</span>
<div class="calendar_div fl">
<input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" >
<%= calendar_for('homework_end_time')%>
@ -28,7 +27,7 @@
<div class="mt10">
<!--<input type="text" class="InputBox W700 SearchIcon" placeholder="发送到课程" />-->
<%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w708"} %>
<%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w720",:value => "请选择发布作业的课程"} %>
</div>
<div class="cl"></div>

View File

@ -1,4 +1,9 @@
<% if @flag == true%>
$("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form',:locals => {:user=>@user,:type=>@type} ) %>');
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
$("#res_count").html(0);
$("#checkboxAll").attr('checked',false);
$("#res_all_count").html(<%= @atta_count%>);
closePopUp();
<% else%>
<% end %>

View File

@ -1,4 +1,9 @@
<% if @flag == true%>
$("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form',:locals => {:user=>@user,:type=>@type} ) %>');
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
$("#res_count").html(0);
$("#checkboxAll").attr('checked',false);
$("#res_all_count").html(<%= @atta_count%>);
closePopUp();
<% else%>
<% end %>

View File

@ -0,0 +1,16 @@
<% unless @attachments.empty?%>
<% @attachments.each_with_index do |attachment, i| %>
$("#attachments_fields").append(
'<span id="attachments_p<%= i %>">'+
'<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => "filename link_file", :readonly=>"readonly")%>'+
'<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => "description", :style=>"display: inline-block;") %>'+
'<span class="ispublic-label"><%= l(:field_is_public)%>:</span>'+
'<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => "is_public")%>'+
'<%= link_to("&nbsp;".html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => "js"), :method => "delete", :remote => true, :class => "remove-upload") unless attachment.id.nil? %>'+
'<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>'+
'</span>'+
'<div class="cl"></div>')
<% end %>
hideModal();
<% end %>

View File

@ -19,6 +19,10 @@
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new })%>");
homework_description_editor.html("");
}
function checkAllBox(doc){
}
</script>
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>

View File

@ -1,7 +1,8 @@
$('#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').html('<%= escape_javascript(render :partial => 'users/show_user_resource',:locals => {:user => @user,:homework_id=>@homework_id}) %>');
showModal('ajax-modal', '730px');
$('#ajax-modal').css('height','500px').css("width","730px");
$('#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').before("<div class='resourcePopupClose mt5 mr-5'>" +
"<a href='javascript:void(0)' class='resourceClose' onclick='hideModal();'></a></div>");
$('#ajax-modal').parent().css("top","").css("left","").css("position","fixed").css("padding-left","16px").css("padding-bottom","16px").css("padding-right","16px");
$('#ajax-modal').parent().addClass("popbox").addClass("referenceResourcesPopup");

View File

@ -0,0 +1,2 @@
$("#user_ref_resources").html('<%= escape_javascript(render :partial => 'resources_list',:locals=>{:attachments => @attachments})%>');
$("#resource_ref_pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');

View File

@ -146,7 +146,7 @@
var id; //资源id
var sendType; //发送到课程 1 发送到项目 2
var lastSendType; //保存上次发送的发送类型
$(".resourcesList").mousedown(function(e) {
$("#resources_list").mousedown(function(e) {
//如果是右键的话
if (3 == e.which) {
document.oncontextmenu = function() {return false;}
@ -160,6 +160,7 @@ $(".resourcesList").mousedown(function(e) {
+ "px; width: 80px;");
$("#contextMenu").show();
//当前光标所在的对象
var ele = document.elementFromPoint(pageX,pageY);
//转换为jquery对象
line = $(ele).parent();
@ -208,7 +209,7 @@ $(document.body).click(function(e) {
}
//如果当前对象在表格里,将当前行改变为白色,这里主要是防止点击页面的其他链接的时候,那个链接背景色变白了
if( contains($(".resourcesList").get(0),line.get(0))){
if( contains($("#resources_list").get(0),line.get(0))){
line.children().css("background-color", 'white');
}

View File

@ -0,0 +1,2 @@
$("#user_ref_resources").html('<%= escape_javascript(render :partial => 'resources_list',:locals=>{:attachments => @attachments})%>');
$("#resource_ref_pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');

View File

@ -2075,7 +2075,8 @@ zh:
label_contact_us: 联系我们
label_recruitment_information: 招聘信息
label_surpport_group: 帮助中心
label_forums: 论坛反馈
#label_forums: 论坛反馈
label_forums: 贴吧交流
label_language: 语言
label_license: 湘ICP备09019772

View File

@ -365,6 +365,9 @@ RedmineApp::Application.routes.draw do
get 'resource_preview'
post 'rename_resource'
get 'search_user_project'
get 'user_resource_type'
get 'user_ref_resource_search'
post 'import_resources_to_homework'
# end
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -31,7 +31,7 @@ table{ background:#fff;}
.min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 135px -193px no-repeat; cursor:pointer;}
.db {display:block;}
/* font & color */
h2{ font-size:18px; color:#15bccf;}
h2{ font-size:18px; color:#269ac9;}
h3{ font-size:14px; color:#e8770d;}
h4{ font-size:14px; color:#3b3b3b;}
.f12{font-size:12px; font-weight:normal;}
@ -136,7 +136,7 @@ a.c_lorange{color:#ff9900;}
a:hover.c_lorange{color:#fff;}
a.c_blue{ color:#269ac9;}
a.c_dblue{ color:#09658c;}
a:hover.c_dblue{ color:#15bccf;}
a:hover.c_dblue{ color:#297fb8;}
a.c_white{ color:#fff;}
input.c_white { color:#fff}
a.c_dorange{ color:#fd6e2a;}
@ -160,7 +160,7 @@ a.c_green{ color:#28be6c;}
.c_dark{ color:#2d2d2d;}
.c_lorange{ color:#ff9900;}
.c_purple{color: #6883b6;}
.c_blue{ color:#15bccf;}
.c_blue{ color:#269ac9;}
.c_red{ color:#F00;}
.c_green{ color:#28be6c;}
.c_dblue{ color:#09658c;}
@ -247,36 +247,6 @@ a:hover.bgreen_n_btn{background:#08a384;}
/*框架主类容*/
#Container{ width:1000px; margin:0 auto; }
/*头部导航*/
#Header{ margin:10px 0; background:#269ac9; height:40px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; position: relative;}
.logo{ margin:5px 10px; }
#TopNav{}
#TopNav ul li{ margin-top:8px;}
.topnav_a a{ font-size:14px; font-weight:bold; color:#fff; margin-right:10px;}
.topnav_a a:hover{color: #a1ebff;}
#userInfo {float:right; display:inline-block; width:130px; padding-top:5px;}
.userInfoRow2 {margin-top:-5px;}
.myPractice {display:inline-block;}
a.parent {background: url(../images/arrowList.png) -30px 3px no-repeat; width:95px; padding-right:50px;}
a.parent:hover {background: url(../images/arrowList.png) -30px -14px no-repeat; width:95px; padding-right:50px; color:#fe7d68;}
a.linkToOrange:hover {color:#fe7d68;}
#userInfo ul li {positon: relative;}
#userInfo ul li ul {display:none;}
#userInfo ul li:hover ul {display:block; position:absolute;}
#userInfo ul li:hover ul li ul {display:none;}
#userInfo ul li:hover ul li:hover ul {display:block; position:absolute; left:110px; top:6px; width:148px; border:1px solid #15bccf; background-color:#ffffff; padding:5px 0px;}
#userInfo ul li:hover ul li:hover ul li {max-width:148px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block; padding: 0 10px; line-height:1.5; color:#15bccf;}
#TopUser{}
#TopUser ul li{ margin-top:8px;}
.topuser_a a{ font-size:14px; font-weight:bold; color:#fff; margin-right:10px;}
.topuser_a a:hover{color: #a1ebff;}
#TopUser02{ }
#TopUser02 li{ float: left;}
#TopUser02 li a{ margin-right:10px;color: #FFF;text-align: center;}
#TopUser02 li a:hover{color: #a1ebff;}
#TopUser02 div{ position: absolute;visibility: hidden;background:#fff;border: 1px solid #15bccf;}
#TopUser02 div a{position: relative;display: block;white-space: nowrap;text-align: left; line-height:1.9; margin-left:5px;background: #fff;color:#15bccf; font-weight:normal;}
#TopUser02 div a:hover{ color:#e8770d; font-weight: bold;}
/*myctrip*/
.userImage{position:absolute; right:140px; top:5px; width:30px;height:30px; background: url(../images/item.png) 2px 4px no-repeat; line-height:1.4;}
@ -305,9 +275,9 @@ a.topnav_login_box:hover {color:#a1ebff;}
.search{ margin-top:8px; margin-left:71px;}
.search_form{margin-top:8px;margin-left:72px;}
.topbar_info{ width:350px; color:#5c5c5c; font-size:16px; margin-right:50px; line-height:1.3; padding-left:100px;}
a.search_btn{ display:block; background:#15bccf; color:#fff; width:60px; height:24px; text-align:center; padding-top:3px;}
a.search_btn{ display:block; background:#269ac9; color:#fff; width:60px; height:24px; text-align:center; padding-top:3px;}
a:hover.search_btn{ background: #0fa9bb;}
.search_text{ border:1px solid #15bccf; background:#fff; width:220px; height:25px; padding-left:5px; }
.search_text{ border:1px solid #269ac9; background:#fff; width:220px; height:25px; padding-left:5px; }
/*资源库*/
@ -528,7 +498,8 @@ a.coursesLineGrey:hover {color:#ffffff;}
.homepageLeftMenuMore {height:18px;}
.homepageLeftMenuMore:hover {background-color:#269ac9;}
.homepageLeftMenuMoreIcon {background:url(../images/homepage_icon.png) -74px -240px no-repeat; display:block; height:18px;}
.homepageMenuSetting {display:inline-block; margin-right: 17px; margin-top: 18px;}
.homepageMenuSetting {display:inline-block; margin-left:155px;background:url(../images/homepage_icon.png) -190px -365px no-repeat; width:15px; height:15px;}
.homepageMenuSetting:hover {background:url(../images/homepage_icon.png) -190px -407px no-repeat;}
a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
.homepageLeftLabelContainer {width:238px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px;}
.homepageLabelText {color:#484848; font-size:16px; margin-left:10px; margin-bottom:12px; display:block;}
@ -599,7 +570,7 @@ a.postReplyCancel {color:#888888; display:block;}
a.postReplyCancel:hover {color:#ffffff;}
.homepagePostReplyInputContainer2 {width:595px; margin:0px auto;}
.homepagePostReplyInput2 {width:588px; height:45px; max-width:588px; max-height:45px; border:1px solid #d9d9d9; outline:none; margin:0px auto 10px auto;}
.homepagePostReplyContainer {border-bottom:1px solid #e3e3e3; width:670px; margin:0px auto; margin-top:15px; min-height:65px;}
.homepagePostReplyContainer {border-bottom:1px solid #e3e3e3; width:680px; margin:0px auto; margin-top:15px; min-height:65px;}
.homepagePostSetting {position:absolute; width:20px; height:20px; right:0px; top:0px;}
.homepagePostSettingIcon {background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px;}
.homepagePostSettiongText {width:85px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-68px; top:20px; padding:5px 0px; display:none;}
@ -677,13 +648,13 @@ ul.list_watch{
.w450{width: 450px;}
/*引用资源库弹窗*/
.referenceResourcesPopup {width:710px; height:auto; border:3px solid #269ac9; padding-left:20px; padding-right:20px; padding-bottom:35px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;}
.referenceResourcesPopup {width:710px; height:500px !important; border:3px solid #269ac9 !important; padding-left:20px; padding-right:20px; padding-bottom:35px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;}
.referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;}
.referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
.searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;}
.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -170px -135px no-repeat; display:inline-block; float:left;}
.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -170px -190px no-repeat;}
.referenceResourceType {font-size:14px; width:355px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;}
.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -180px -270px no-repeat; display:inline-block; float:left;}
.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -180px -311px no-repeat;}
.referenceResourceType {font-size:14px; width:475px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;}
.referenceTypeActive {background-color:#269ac9; color:#ffffff !important;}
a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}
@ -852,17 +823,17 @@ div.flash.warning, .conflict {
/*弹出框*/
.black_overlay{display:none;position:fixed;top:0px;left:0px;width:100%;height:100%;background-color:black;z-index:1001;-moz-opacity:0.8;opacity:.80;filter:alpha(opacity=80);}
.white_content{display:none;position:fixed;top:15%;left:30%;width:420px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.white_content02{display:none;position:fixed;top:15%;left:30%;width:200px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.newhwork_content{ display:none;position:fixed;top:15%;left:30%;width:600px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.floatbox{ width:420px; border:3px solid #15bccf; background:#fff; padding:5px;}
.white_content{display:none;position:fixed;top:15%;left:30%;width:420px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #269ac9;background-color:white;z-index:1002;overflow:auto;}
.white_content02{display:none;position:fixed;top:15%;left:30%;width:200px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #269ac9;background-color:white;z-index:1002;overflow:auto;}
.newhwork_content{ display:none;position:fixed;top:15%;left:30%;width:600px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #269ac9;background-color:white;z-index:1002;overflow:auto;}
.floatbox{ width:420px; border:3px solid #269ac9; background:#fff; padding:5px;}
a.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;}
a:hover.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
/*个人主页头像*/
.white_content_users{display:none;position:fixed;top:45%;left:45%;width:210px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.white_content_users{display:none;position:fixed;top:45%;left:45%;width:210px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #269ac9;background-color:white;z-index:1002;overflow:auto;}
a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
.box_h3{ color:#15bccf; font-size:16px;}
.box_h3{ color:#269ac9; font-size:16px;}
.uppicBox{ width:265px; height:265px; background:#f2f2f5; float:left; color:#666; text-align:center;}
.showpicBox{width:133px; height:250px; background:#f2f2f5; float:left; margin-left:20px; text-align:center; padding-top:15px; color:#666;}
.mr15{ margin-right:15px;}
@ -873,18 +844,20 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
.HomeWork {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;}
.RightBanner {width:708px; height:34px; border-bottom:1px solid #e9e9e9;}
select.InputBox,input.InputBox,textarea.InputBox{ border:1px solid #d9d9d9; color:#888888; height:28px; line-height:28px; padding-left:5px; font-size:14px;}
a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #15bccf; color:#15bccf; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
a:hover.BlueCirBtn{ background:#15bccf; color:#fff;}
a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #269ac9; color:#269ac9; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
a:hover.BlueCirBtn{ background:#269ac9; color:#fff;}
.W440{ width:440px;}
.W120{ width:110px;}
.W700{ width:700px;max-width: 700px;min-width: 700px;}
.w708{width: 708px;}
.w712{width:712px;max-width:712px;min-width: 712px;}
.w720{width:721px;}
a.AnnexBtn{ background: url(../images/homepage_icon2.png) 0px -343px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
a:hover.AnnexBtn{background: url(../images/homepage_icon2.png) -90px -343px no-repeat; color:#15bccf;}
a:hover.AnnexBtn{background: url(../images/homepage_icon2.png) -90px -343px no-repeat; color:#269ac9;}
a.FilesBtn{ background: url(../images/homepage_icon2.png) 0px -373px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
a:hover.FilesBtn{background: url(../images/homepage_icon2.png) -89px -372px no-repeat; color:#15bccf;}
a.BlueCirBtnMini{ display:block;width:40px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #15bccf; color:#15bccf; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
a:hover.BlueCirBtnMini{ background:#15bccf; color:#fff;}
a:hover.FilesBtn{background: url(../images/homepage_icon2.png) -89px -372px no-repeat; color:#269ac9;}
a.BlueCirBtnMini{ display:block;width:40px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #269ac9; color:#269ac9; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;}
a.DropBtn{background: url(../images/homepage_icon2.png) -125px -339px no-repeat; width:85px; height:20px; display:block; color:#888888; font-size:14px;}
a:hover.DropBtn{background: url(../images/homepage_icon2.png) -125px -370px no-repeat;}
.DropLine{border-top:1px solid #d9d9d9; float:left; width:623px; height:10px; margin-top:10px;}