Merge branch 'szzh' into develop
This commit is contained in:
commit
881367a638
|
@ -756,7 +756,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
# Returns a string that can be used as filename value in Content-Disposition header
|
||||
def filename_for_content_disposition(name)
|
||||
request.env['HTTP_USER_AGENT'] =~ %r{MSIE} ? ERB::Util.url_encode(name) : name
|
||||
request.env['HTTP_USER_AGENT'] =~ %r{MSIE|Trident} ? ERB::Util.url_encode(name) : name
|
||||
end
|
||||
|
||||
def api_request?
|
||||
|
|
|
@ -121,7 +121,7 @@ class UsersController < ApplicationController
|
|||
messages = MessageAll.where("user_id =?", @user).order("created_at desc")
|
||||
messages.each do |message_all|
|
||||
# 在点击或者刷新消息列表后未读的消息存放在数组
|
||||
if message_all.message_type != "SystemMessage" && message_all.message.viewed == 0
|
||||
if message_all.message_type != "SystemMessage"&& !message_all.message.nil? && message_all.message.viewed == 0
|
||||
@message_alls << message_all.message
|
||||
end
|
||||
end
|
||||
|
@ -522,6 +522,7 @@ class UsersController < ApplicationController
|
|||
@atta_count = @attachments.count
|
||||
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
|
||||
@offset ||= @atta_pages.offset
|
||||
@seleted_resources = session[:seleted_resource_ids].nil? ? [] : session[:seleted_resource_ids]
|
||||
#@curse_attachments_all = @all_attachments[@offset, @limit]
|
||||
@attachments = paginateHelper @attachments,7
|
||||
respond_to do |format|
|
||||
|
@ -555,6 +556,7 @@ class UsersController < ApplicationController
|
|||
@atta_count = @attachments.count
|
||||
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
|
||||
@offset ||= @atta_pages.offset
|
||||
@seleted_resources = session[:seleted_resource_ids].nil? ? [] : session[:seleted_resource_ids]
|
||||
#@curse_attachments_all = @all_attachments[@offset, @limit]
|
||||
@attachments = paginateHelper @attachments,7
|
||||
respond_to do |format|
|
||||
|
@ -586,6 +588,7 @@ class UsersController < ApplicationController
|
|||
@atta_count = @attachments.count
|
||||
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
|
||||
@offset ||= @atta_pages.offset
|
||||
@seleted_resources = session[:seleted_resource_ids].nil? ? [] : session[:seleted_resource_ids]
|
||||
#@curse_attachments_all = @all_attachments[@offset, @limit]
|
||||
@attachments = paginateHelper @attachments,7
|
||||
respond_to do |format|
|
||||
|
@ -596,8 +599,8 @@ class UsersController < ApplicationController
|
|||
#将资源批量引入
|
||||
def import_resources_to_homework
|
||||
@attachments = []
|
||||
unless params[:checkbox1].nil? || params[:checkbox1].blank?
|
||||
params[:checkbox1].each do |id|
|
||||
unless session[:seleted_resource_ids].nil? || session[:seleted_resource_ids].blank?
|
||||
session[:seleted_resource_ids].each do |id|
|
||||
atta = Attachment.find(id)
|
||||
att_copy = atta.copy
|
||||
att_copy.container_id = nil
|
||||
|
@ -608,11 +611,23 @@ class UsersController < ApplicationController
|
|||
@attachments << att_copy
|
||||
end
|
||||
end
|
||||
session[:seleted_resource_ids] = [] #保存后清空
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# ajax 用session保存选择的资源id
|
||||
def store_selected_resource
|
||||
session[:seleted_resource_ids] = [] if session[:seleted_resource_ids].nil?
|
||||
if params[:save] == 'y'
|
||||
session[:seleted_resource_ids] << params[:res_id]
|
||||
else
|
||||
session[:seleted_resource_ids].delete( params[:res_id])
|
||||
end
|
||||
render :nothing => true
|
||||
end
|
||||
|
||||
|
||||
include CoursesHelper
|
||||
def user_courses
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
$('#reply_content_<%= activity.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
|
||||
});
|
||||
</script>
|
||||
<% if activity %>
|
||||
<% if activity && activity.course_act%>
|
||||
<% act = activity.course_act %>
|
||||
<% case activity.course_act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<% if course %>
|
||||
<% if course && tag_list.empty? == false%>
|
||||
<span class="files_tag_icon" >
|
||||
<a title="双击可编辑"
|
||||
<a title=""
|
||||
onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(course)%>','','<%= @q%>','<%= course.id%>');"
|
||||
>全部</a></span>
|
||||
<% end %>
|
||||
|
|
|
@ -234,21 +234,23 @@
|
|||
//第二种是改变某个tag名称。其他所有的资源如果拥有这个tag。那么对应的tag名也要改掉。
|
||||
//目前这两种依据 的来源就是 是否 传了参数 id。如果有id。就指定了资源id,就是第一种情况。如果没有id。就是第二种情况
|
||||
function rename_tag(domEle,name,id,type){
|
||||
isdb = true; //这是双击
|
||||
//clearTimeout(clickFunction);
|
||||
if(domEle.children().get(0) != undefined ){ //已经是编辑框的情况下不要动
|
||||
return;
|
||||
if(String(id) != '' || '<%=User.current.allowed_to?(:as_teacher,@course)%>' == 'true' ) { //如果有id ,或者是老师就都能编辑,否则,没有id,不是老师就不能编辑
|
||||
isdb = true; //这是双击
|
||||
//clearTimeout(clickFunction);
|
||||
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
|
||||
return;
|
||||
}
|
||||
tagNameHtml = domEle.parent().html()
|
||||
tagName = name;
|
||||
parentCssBorder = domEle.parent().css("border");
|
||||
ele = domEle;
|
||||
tagId = id;
|
||||
taggableType = type;
|
||||
width = parseInt(domEle.css('width').replace('px', '')) >= 100 ? parseInt(domEle.css('width').replace('px', '')) : 100
|
||||
domEle.html('<input name="" id="renameTagName" maxlength="<%=Setting.tags_max_length%>" minlength="<%= Setting.tags_min_length%>" style="width:' + width + 'px;" value="' + name + '"/>');
|
||||
domEle.parent().css("border", "1px solid #ffffff");
|
||||
$("#renameTagName").focus();
|
||||
}
|
||||
tagNameHtml = domEle.parent().html()
|
||||
tagName = name;
|
||||
parentCssBorder = domEle.parent().css("border");
|
||||
ele = domEle;
|
||||
tagId = id;
|
||||
taggableType = type;
|
||||
width = parseInt(domEle.css('width').replace('px','')) >=100 ? parseInt(domEle.css('width').replace('px','')) : 100
|
||||
domEle.html('<input name="" id="renameTagName" maxlength="<%=Setting.tags_max_length%>" minlength="<%= Setting.tags_min_length%>" style="width:'+width +'px;" value="'+name+'"/>');
|
||||
domEle.parent().css("border","1px solid #ffffff");
|
||||
$("#renameTagName").focus();
|
||||
}
|
||||
//监听所有的单击事件
|
||||
$(function(){
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<% forum.tag_list.each do |tag|%>
|
||||
<% forum.reload.tag_list.each do |tag|%>
|
||||
<span class="postlabel mr10">
|
||||
<a href="javascript:void(0);" ondblclick="rename_tag($(this),<%= tag %>,<%= forum.id%>,5);" style="cursor: default" class="fontGrey2 mr5"><%= tag %></a>
|
||||
<a title="双击可编辑" ondblclick="rename_tag($(this),'<%= tag %>',<%= forum.id%>,5);" style="cursor: pointer" class="fontGrey2 mr5"><%= tag %></a>
|
||||
<%if forum.creator.id == User.current.id%>
|
||||
<a href="javascript:void(0);" class="fontGrey2" onclick="delete_forum_tag($(this));">×</a>
|
||||
<% end %>
|
||||
|
|
|
@ -76,10 +76,10 @@
|
|||
$("#error").html("主题 过长(最长为 50 个字符)").show();
|
||||
return false;
|
||||
}
|
||||
if(memo_content.html().trim().length > 5000){
|
||||
$("#error").html("内容 过长(最长为 5000 个字符)").show();
|
||||
return false;
|
||||
}
|
||||
// if(memo_content.html().trim().length > 5000){
|
||||
// $("#error").html("内容 过长(最长为 5000 个字符)").show();
|
||||
// return false;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,13 +98,8 @@
|
|||
domEle.parent().css("border","1px solid #ffffff");
|
||||
$("#renameTagName").focus();
|
||||
}
|
||||
//监听所有的单击事件
|
||||
$(document).click(function(e){
|
||||
node = document.elementFromPoint(e.clientX, e.clientY);
|
||||
if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了
|
||||
return;
|
||||
}
|
||||
if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态
|
||||
$("#renameTagName").live('blur',function(){
|
||||
if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态
|
||||
if($("#renameTagName").val().trim() == tagName){ //如果值一样,则恢复原来的状态
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(tagNameHtml);
|
||||
|
@ -122,6 +117,30 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
//监听所有的单击事件
|
||||
// $(document).click(function(e){
|
||||
// node = document.elementFromPoint(e.clientX, e.clientY);
|
||||
// if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了
|
||||
// return;
|
||||
// }
|
||||
// if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态
|
||||
// if($("#renameTagName").val().trim() == tagName){ //如果值一样,则恢复原来的状态
|
||||
// ele.parent().css("border","");
|
||||
// ele.parent().html(tagNameHtml);
|
||||
//
|
||||
// }else{ //否则就要更新tag名称了
|
||||
// if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){
|
||||
// $.post(
|
||||
// '<%#= update_tag_name_path %>',
|
||||
// {"taggableId": taggableId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim()}
|
||||
// )
|
||||
// }else{
|
||||
// ele.parent().css("border","");
|
||||
// ele.parent().html(tagNameHtml);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
function del_forum_confirm(){
|
||||
if(confirm('您确定要删除么?')){
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
$("#error").html('主题不能超过50个字符').show();
|
||||
return;
|
||||
}
|
||||
if(memo_content.html().trim().length > 5000 ){
|
||||
$("#error").html('内容不能超过5000个字符').show();
|
||||
return;
|
||||
}
|
||||
// if(memo_content.html().trim().length > 5000 ){
|
||||
// $("#error").html('内容不能超过5000个字符').show();
|
||||
// return;
|
||||
// }
|
||||
memo_content.sync();
|
||||
$("#edit_memo").submit();
|
||||
}else if($("textarea[name='memo[subject]']").val().trim() == "" && memo_content.html().trim() != "" ){
|
||||
|
|
|
@ -86,15 +86,15 @@
|
|||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %>)</div>
|
||||
<div class="homepagePostReplyBannerTime"></div>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<% if @reply_count > 2%>
|
||||
<a href="javascript:void(0);" class="replyGrey" id="reply_btn_<%= @memo.id%>" onclick="expand_reply('#reply_div_<%= @memo.id %>','#reply_btn_<%= @memo.id%>')" data-count="<%= @reply_count %>" data-init="0" >点击展开更多回复</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--<div class="homepagePostReplyBannerMore">-->
|
||||
<!--<%# if @reply_count > 2%>-->
|
||||
<!--<a# href="javascript:void(0);" class="replyGrey" id="reply_btn_<%#= @memo.id%>" onclick="expand_reply('#reply_div_<%#= @memo.id %>','#reply_btn_<%#= @memo.id%>')" data-count="<%= @reply_count %>" data-init="0" >点击展开更多回复</a>-->
|
||||
<!--<%# end %>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
<div class="" id="reply_div_<%= @memo.id %>">
|
||||
<% @replies.each_with_index do |reply,i| %>
|
||||
<div class="homepagePostReplyContainer" style="display: <%= i >= 2 ? 'none':''%>">
|
||||
<div class="homepagePostReplyContainer" >
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||
</div>
|
||||
|
|
|
@ -21,6 +21,19 @@
|
|||
"<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()
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="homepageRightBanner mb10">
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
<% if attachments.nil? || attachments.empty? %>
|
||||
<!--<p class="nodata">-->
|
||||
<!--<%#= l(:label_no_data) %>-->
|
||||
<!--</p>-->
|
||||
<% else %>
|
||||
<% attachments.each do |attach| %>
|
||||
<ul class="resourcesList">
|
||||
<li class="resourcesListCheckbox fl">
|
||||
<input name="checkbox1[]" type="checkbox" onclick="store_seleted_resource($(this));" <%=seleted_resources.include?(attach.id.to_s) ? 'checked':'' %> value="<%= attach.id%>" class="resourcesCheckbox" />
|
||||
</li>
|
||||
<li class="resourcesListName fl">
|
||||
<!--<a href="javascript:void(0);" class="resourcesBlack"><%#=truncate(attach.filename,:length=>18)%></a>-->
|
||||
<%= link_to truncate(attach.filename,:length=>30), download_named_attachment_path(attach.id, attach.filename),
|
||||
:title => attach.filename,:class=>'resourcesBlack'%>
|
||||
</li>
|
||||
<li class="resourcesListSize fl"><%= number_to_human_size(attach.filesize) %></li>
|
||||
<li class="resourcesListType fl"><%= get_resource_type(attach.container_type)%></li>
|
||||
<li class="resourcesListUploader fl"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
|
||||
<li style="display: none"><%= attach.author_id %></li>
|
||||
<li class="resourcesListTime fl"><%= format_date(attach.created_on) %></li>
|
||||
<li style="display: none"><%= attach.id %></li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -2,35 +2,39 @@
|
|||
<div class="NewsBannerName"><%= title_for_message(params[:type]) %></div>
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="homepagePostType" style="width:130px; left:-130px;">
|
||||
<ul class="homepagePostType">
|
||||
<li>
|
||||
<ul class="homepagePostTypeHomework fl" style="width:70px;">
|
||||
<li><%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "系统消息", user_system_messages_path(User.current), :class => "resourcesGrey" %></li>
|
||||
|
||||
<li class=""><strong>课程消息</strong></li>
|
||||
<li><%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "课程通知",user_message_path(User.current, :type => 'course_news'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "课程问卷", user_message_path(User.current, :type => 'poll'), :class => "resourcesGrey" %></a></li>
|
||||
<ul class="homepagePostTypeHomework fl">
|
||||
<li class="f14"><strong>课程消息</strong></li>
|
||||
<li><%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "homepagePostTypeAssignment postTypeGrey" %></li>
|
||||
<li><%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "homepagePostTypeForum postTypeGrey" %></li>
|
||||
<li><%= link_to "课程通知",user_message_path(User.current, :type => 'course_news'), :class => "homepagePostTypeNotice postTypeGrey" %></li>
|
||||
<li><%= link_to "课程问卷", user_message_path(User.current, :type => 'poll'), :class => "homepagePostTypeQuiz postTypeGrey" %></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<ul class="homepagePostTypeProject fl" style="width:60px;">
|
||||
<li class=""><strong>项目消息</strong></li>
|
||||
<li><%= link_to "项目任务", user_message_path(User.current, :type => 'issue'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "项目讨论", user_message_path(User.current, :type => 'forge_message'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "项目新闻", user_message_path(User.current, :type => 'forge_news'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %></li>
|
||||
|
||||
<li class=""><strong>其他</strong></li>
|
||||
<li><%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "resourcesGrey" %></li>
|
||||
<%# 系统贴吧 %>
|
||||
<li><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %></li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14"><strong>项目消息</strong></li>
|
||||
<li><%= link_to "项目任务", user_message_path(User.current, :type => 'issue'), :class => "homepageTypePTask postTypeGrey" %></li>
|
||||
<li><%= link_to "项目讨论", user_message_path(User.current, :type => 'forge_message'), :class => "homepagePostTypeForum postTypeGrey" %></li>
|
||||
<li><%= link_to "项目新闻", user_message_path(User.current, :type => 'forge_news'), :class => "homepageTypePNews postTypeGrey" %></li>
|
||||
<li><%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "homepageTypeUApply postTypeGrey" %></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<ul class="homepagePostTypeMore">
|
||||
<li class="f14"><strong>更多</strong></li>
|
||||
<li class="fl w100"><%= link_to "全部",user_message_path(User.current), :class => "resourcesTypeAll postTypeGrey" %></li>
|
||||
<li class="fl"><%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "homepageTypeUnread postTypeGrey" %></li>
|
||||
<li class="fl w100"><%= link_to "系统消息", user_system_messages_path(User.current), :class => "homepageTypeSystem postTypeGrey" %></li>
|
||||
<li class="fl"><%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "homepageTypePost postTypeGrey" %></li>
|
||||
<li class="fl w100"><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "homepageTypeUMessage postTypeGrey" %></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -51,10 +51,10 @@
|
|||
<%= 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} %>
|
||||
<%= render :partial => 'homework_ref_resources_list' ,:locals=>{ :attachments => @attachments,:seleted_resources=>seleted_resources} %>
|
||||
</div>
|
||||
<div >
|
||||
<ul class="wlist" id="resource_ref_pages" style="margin-top: 5px;">
|
||||
<ul class="wlist" id="resource_ref_pages" style="margin-top: 5px;margin-right: 20px">
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -84,7 +84,9 @@
|
|||
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
||||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
|
||||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + '老师',
|
||||
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :title => "#{ma.course_message.user.lastname + ma.course_message.user.firstname}老师" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
|
|
|
@ -7,6 +7,19 @@
|
|||
homework_description_editor.html("");
|
||||
$("#homework_editor").toggle();
|
||||
}
|
||||
|
||||
// 点击 checkbox选中引用的资源的时候,保存该资源的id到session里去
|
||||
function store_seleted_resource(dom){
|
||||
if(dom.attr('checked') == 'checked' ){
|
||||
$.get(
|
||||
'<%= store_selected_resource_user_path %>'+'?save=y&res_id='+dom.val()
|
||||
)
|
||||
}else {
|
||||
$.get(
|
||||
'<%= store_selected_resource_user_path %>'+'?save=n&res_id='+dom.val()
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="NewsBannerName">作业</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_resource',:locals => {:user => @user,:homework_id=>@homework_id}) %>');
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_resource',:locals => {:user => @user,:homework_id=>@homework_id,:seleted_resources=>@seleted_resources}) %>');
|
||||
showModal('ajax-modal', '730px');
|
||||
$('#ajax-modal').css('height','500px').css("width","730px");
|
||||
$('#ajax-modal').siblings().remove();
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
$("#user_ref_resources").html('<%= escape_javascript(render :partial => 'resources_list',:locals=>{:attachments => @attachments})%>');
|
||||
$("#user_ref_resources").html('<%= escape_javascript(render :partial => 'homework_ref_resources_list',:locals=>{:attachments => @attachments,:seleted_resources=>@seleted_resources})%>');
|
||||
$("#resource_ref_pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
|
@ -1,2 +1,2 @@
|
|||
$("#user_ref_resources").html('<%= escape_javascript(render :partial => 'resources_list',:locals=>{:attachments => @attachments})%>');
|
||||
$("#user_ref_resources").html('<%= escape_javascript(render :partial => 'homework_ref_resources_list',:locals=>{:attachments => @attachments,:seleted_resources=>@seleted_resources})%>');
|
||||
$("#resource_ref_pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
|
@ -386,6 +386,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'user_resource_type'
|
||||
get 'user_ref_resource_search'
|
||||
post 'import_resources_to_homework'
|
||||
get 'store_selected_resource'
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 16 KiB |
|
@ -624,6 +624,15 @@ a.homepagePostTypeQuiz {background:url(../images/homepage_icon.png) -90px -124px
|
|||
a.homepagePostTypeQuestion {background:url(../images/homepage_icon.png) -10px -273px no-repeat; padding-left:23px;}
|
||||
a.homepagePostTypeMine {background:url(../images/homepage_icon.png) -187px -277px no-repeat; padding-left:23px;}
|
||||
a.homepagePostTypeAll {background:url(../images/homepage_icon.png) -185px -308px no-repeat; padding-left:23px;}
|
||||
.homepagePostTypeMore {width:180px; border-top:1px dashed #dddddd; margin-top:5px;}
|
||||
.w100 {width:100px;}
|
||||
a.homepageTypeUnread {background:url(../images/homepage_icon.png) -6px -579px no-repeat; padding-left:23px;}
|
||||
a.homepageTypePTask {background:url(../images/homepage_icon.png) -176px -523px no-repeat; padding-left:23px;}
|
||||
a.homepageTypeSystem {background:url(../images/homepage_icon.png) -88px -552px no-repeat; padding-left:23px;}
|
||||
a.homepageTypePNews {background:url(../images/homepage_icon.png) -5px -553px no-repeat; padding-left:23px;}
|
||||
a.homepageTypePost {background:url(../images/homepage_icon.png) -178px -553px no-repeat; padding-left:23px;}
|
||||
a.homepageTypeUMessage {background:url(../images/homepage_icon.png) -4px -519px no-repeat; padding-left:23px;}
|
||||
a.homepageTypeUApply {background:url(../images/homepage_icon.png) -91px -582px no-repeat; padding-left:23px;}
|
||||
a.postTypeGrey {color:#888888;}
|
||||
a.postTypeGrey:hover {color:#269ac9;}
|
||||
.homepagePostBrief {width:710px; margin:0px auto; position:relative;}
|
||||
|
@ -738,8 +747,8 @@ ul.list_watch{
|
|||
.w450{width: 450px;}
|
||||
|
||||
/*引用资源库弹窗*/
|
||||
.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;}
|
||||
.referenceResourcesPopup {width:750px !important; height:500px !important; overflow: hidden !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; 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_icon2.png) -180px -270px no-repeat; display:inline-block; float:left;}
|
||||
|
|
|
@ -724,6 +724,10 @@ div.actions input[type="text"] {
|
|||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.memo-content li {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
|
||||
.memo-timestamp {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
|
|
|
@ -624,8 +624,8 @@ a.loginChooseTab {color:#484848; height:30px; display:block;}
|
|||
|
||||
/*引用资源库弹窗*/
|
||||
.popbox{position:fixed !important;left:50%;top:50%;margin:-100px 0 0 -150px; -moz-border-radius:5px;}
|
||||
.referenceResourcesPopup {width:710px; height:500px !important; border:3px solid #269ac9 !important; padding-left:16px !important; padding-right:16px !important; padding-bottom:16px !important; 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;}
|
||||
.referenceResourcesPopup {width:750px !important; height:500px !important; border:3px solid #269ac9 !important; padding-left:16px !important; padding-right:16px !important; padding-bottom:16px !important; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;}
|
||||
.referenceText {font-size:16px; color:#269ac9; line-height:16px; 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_icon2.png) -180px -270px no-repeat; display:inline-block; float:left;}
|
||||
|
|
Loading…
Reference in New Issue