This commit is contained in:
Tim 2015-09-29 15:24:30 +08:00
commit a0f4cabcf2
14 changed files with 79 additions and 92 deletions

View File

@ -89,7 +89,7 @@ class Mailer < ActionMailer::Base
recipients ||= [] recipients ||= []
# 只给该课程的老师发送邮件提醒 # 只给该课程的老师发送邮件提醒
course.members.each do |member| course.members.each do |member|
if m.user.allowed_to?(:as_teacher,course) if member.user.allowed_to?(:as_teacher,course)
user = User.find(member.user_id) user = User.find(member.user_id)
#@subject = "[#{l(:mail_homework)} #{homework_common.name}] #{l(:mail_anonymous_comment_failed)}" #@subject = "[#{l(:mail_homework)} #{homework_common.name}] #{l(:mail_anonymous_comment_failed)}"
@token = Token.get_token_from_user(user, 'autologin') @token = Token.get_token_from_user(user, 'autologin')

View File

@ -73,6 +73,25 @@
$(function () { $(function () {
init_activity_KindEditor_data(<%= activity.id%>, null, "87%"); init_activity_KindEditor_data(<%= activity.id%>, null, "87%");
var description_images=$("div#activity_description_<%= activity.id %>").find("img");
if (description_images.length>0) {
for (var i=0; i<description_images.length; i++){
var image=$(description_images[i]);
var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element);
}
}
$('#activity_description_<%= activity.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
var reply_images=$("div#reply_content_<%= activity.id %>").find("img");
if (reply_images.length>0) {
for (var i=0; i<reply_images.length; i++){
var image=$(reply_images[i]);
var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element);
}
}
$('#reply_content_<%= activity.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
}); });
</script> </script>
<% if activity %> <% if activity %>

View File

@ -19,7 +19,7 @@
<%= yield :header_tags -%> <%= yield :header_tags -%>
<%= stylesheet_link_tag 'base','header', :media => 'all'%> <%= stylesheet_link_tag 'base','header', :media => 'all'%>
</head> </head>
<body class="<%=h body_css_classes %>"> <body class="<%=h body_css_classes %>" onload="prettyPrint();">
<div class="cl"></div> <div class="cl"></div>
<div class="navContainer mb10"> <div class="navContainer mb10">

View File

@ -23,7 +23,7 @@
<%= yield :header_tags -%> <%= yield :header_tags -%>
</head> </head>
<!--add by huang--> <!--add by huang-->
<body> <body onload="prettyPrint();">
<div class="navContainer mb10"> <div class="navContainer mb10">
<% if User.current.logged? %> <% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %> <%= render :partial => 'layouts/logined_header' %>

View File

@ -130,7 +130,7 @@
} }
</script> </script>
</head> </head>
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>" onload="prettyPrint();">
<div class="cl"></div> <div class="cl"></div>
<div class="navContainer"> <div class="navContainer">

View File

@ -21,7 +21,7 @@
</head> </head>
<!--add by huang--> <!--add by huang-->
<body onload=" "> <body onload="prettyPrint();">
<div class="navContainer mb10"> <div class="navContainer mb10">
<% if User.current.logged? %> <% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %> <%= render :partial => 'layouts/logined_header' %>

View File

@ -25,7 +25,7 @@
</head> </head>
<body> <body onload="prettyPrint();">
<div id="Container"> <div id="Container">
<%= render :partial => 'layouts/base_header_new'%> <%= render :partial => 'layouts/base_header_new'%>
<div id="TopBar"> <div id="TopBar">

View File

@ -19,7 +19,7 @@
<%= yield :header_tags -%> <%= yield :header_tags -%>
</head> </head>
<!--add by huang--> <!--add by huang-->
<body> <body onload="prettyPrint();">
<div class="navContainer mb10"> <div class="navContainer mb10">
<% if User.current.logged? %> <% if User.current.logged? %>

View File

@ -16,7 +16,7 @@
<%= yield :header_tags -%> <%= yield :header_tags -%>
</head> </head>
<body> <body onload="prettyPrint();">
<div class="navContainer"> <div class="navContainer">
<% is_current_user = User.current.logged? && User.current == @user%> <% is_current_user = User.current.logged? && User.current == @user%>
<% if User.current.logged? %> <% if User.current.logged? %>

View File

@ -18,7 +18,7 @@
<%= yield :header_tags -%> <%= yield :header_tags -%>
<%= stylesheet_link_tag 'base','header','new_user' ,:media => 'all'%> <%= stylesheet_link_tag 'base','header','new_user' ,:media => 'all'%>
</head> </head>
<body> <body onload="prettyPrint();">
<div class="cl"></div> <div class="cl"></div>
<div class="navContainer mb10"> <div class="navContainer mb10">
<% if User.current.logged? %> <% if User.current.logged? %>

View File

@ -23,15 +23,15 @@
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了通知:</span></li> <li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了通知:</span></li>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id }, <%= link_to ma.course_message.commented.title, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)", :onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %></li> :onmouseout => "message_titile_hide($(this))" %></li>
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p><strong>标题</strong><%= ma.course_message.commented.title %></p> <p><strong>评论对象</strong><%= ma.course_message.commented.title %></p>
<% unless ma.course_message.comments.nil? %> <% unless ma.course_message.comments.nil? %>
<div class="fl"><strong>内容:</strong></div> <div class="fl"><strong>评论内容:</strong></div>
<div class="ml36"><%= ma.course_message.comments.html_safe %></div> <div class="ml60"><%= ma.course_message.comments.html_safe %></div>
<% end %> <% end %>
</div> </div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
@ -138,7 +138,7 @@
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p> <p>
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师' : '同学' %>您好! <%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师' : '同学' %>您好!
<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师开启了匿评,作业详情如下: <%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>开启了匿评,作业详情如下:
</p> </p>
<p>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p> <p>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p>
<p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p> <p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p>
@ -164,7 +164,7 @@
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p> <p>
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师':'同学'%>您好! <%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师':'同学'%>您好!
<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师关闭了匿评,作业详情如下: <%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>关闭了匿评,作业详情如下:
</p> </p>
<p>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p> <p>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p>
<p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p> <p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p>

View File

@ -264,7 +264,7 @@ K.options = {
minHeight : 100, minHeight : 100,
minChangeSize : 50, minChangeSize : 50,
zIndex : 811213, zIndex : 811213,
items : ['emoticons','fontname', items : ['code','emoticons','fontname',
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|', 'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'formatblock', 'fontsize', '|','indent', 'outdent', 'formatblock', 'fontsize', '|','indent', 'outdent',
'|','imagedirectupload','table', 'media', 'preview',"more" '|','imagedirectupload','table', 'media', 'preview',"more"
@ -4986,7 +4986,7 @@ KEditor.prototype = {
htmlList.unshift('<div style="display:block" id="define"/>') htmlList.unshift('<div style="display:block" id="define"/>')
htmlList.push('</div>') htmlList.push('</div>')
var htmlListFull = []; var htmlListFull = [];
var fullItems = ['emoticons','fontname', var fullItems = ['code','emoticons','fontname',
'forecolor', 'hilitecolor', 'bold','|', 'justifyleft', 'justifycenter', 'insertorderedlist', 'insertunorderedlist', '|', 'forecolor', 'hilitecolor', 'bold','|', 'justifyleft', 'justifycenter', 'insertorderedlist', 'insertunorderedlist', '|',
'formatblock', 'fontsize', '|', 'indent', 'outdent', 'formatblock', 'fontsize', '|', 'indent', 'outdent',
'|','imagedirectupload','table', 'media', 'preview', "less", '|','imagedirectupload','table', 'media', 'preview', "less",
@ -5068,7 +5068,7 @@ KEditor.prototype = {
} }
self.updateState(); self.updateState();
self.addBookmark(); self.addBookmark();
prettyPrint("",self.edit.doc.body); //prettyPrint("",self.edit.doc.body);
if (self.options.afterChange) { if (self.options.afterChange) {
self.options.afterChange.call(self); self.options.afterChange.call(self);
} }

View File

@ -1,79 +1,47 @@
/* Pretty printing styles. Used with prettify.js. */ .ke-content {
font-size: 10pt;
/* SPAN elements with the classes below are added by prettyprint. */ }
.pln { color: #000 } /* plain text */ .ke-content pre {
font-size:9pt;
@media screen { font-family:Courier New,Arial;
.str { color: #080 } /* string content */ border:1px solid #ddd;
.kwd { color: #008 } /* a keyword */ border-left:5px solid #6CE26C;
.com { color: #800 } /* a comment */ background:#f6f6f6;
.typ { color: #606 } /* a type name */ padding:5px;
.lit { color: #066 } /* a literal value */
/* punctuation, lisp open bracket, lisp close bracket */
.pun, .opn, .clo { color: #660 }
.tag { color: #008 } /* a markup tag name */
.atn { color: #606 } /* a markup attribute name */
.atv { color: #080 } /* a markup attribute value */
.dec, .var { color: #606 } /* a declaration; a variable name */
.fun { color: red } /* a function name */
} }
/* Use higher contrast and text-weight for printable form. */ .ke-content code {
@media print, projection { margin: 0 2px;
.str { color: #060 } padding: 0 5px;
.kwd { color: #006; font-weight: bold } white-space: nowrap;
.com { color: #600; font-style: italic } border: 1px solid #DDD;
.typ { color: #404; font-weight: bold } background-color: #F6F6F6;
.lit { color: #044 } border-radius: 3px;
.pun, .opn, .clo { color: #440 }
.tag { color: #006; font-weight: bold }
.atn { color: #404 }
.atv { color: #060 }
} }
/* Put a border around prettyprinted code snippets. */ .ke-content pre>code {
pre.prettyprint { padding: 2px; margin: 0;
border-left:1px solid #ccc; padding: 0;
border-bottom: 1px solid #ccc; white-space: pre;
border-right: 1px solid #ccc, border: none;
border-top: 1px solid #ccc } background: transparent;
pre li,ol li {
list-style-type: decimal;
} }
ul li{
list-style-type: disc;
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 { list-style-type: decimal }
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 { background: #eee }
.prettyprint *{font-family:'courier new',monospace;} .ke-content pre code {
/*.prettyprint .com { color: #93a1a1; }*/ background-color: transparent;
/*.prettyprint .lit { color: #AE81FF; }*/ border: none;
/*.prettyprint .pun,*/ }
/*.prettyprint .opn,*/
/*.prettyprint .clo { color: #F8F8F2; }*/ .ke-content p {
/*.prettyprint .fun { color: #dc322f; }*/ margin: 0 0 15px 0;
/*.prettyprint .str,*/ margin-bottom:15pt;
/*.prettyprint .atv { color: #E6DB74; }*/ line-height:1.5;
/*.prettyprint .kwd,*/ letter-spacing: 1px;
/*.prettyprint .tag { color: #F92659; }*/ }
/*.prettyprint .typ,*/
/*.prettyprint .atn,*/ .ke-content div.ref {border:1px solid #ddd;margin:0 0 10px 0;padding:2px;font-size:9pt;background:#ffe;}
/*.prettyprint .dec,*/ .ke-content div.ref h4 {margin:0;padding:1px 3px;background:#CC9966;color:#fff;font-size:9pt;font-weight:normal;}
/*.prettyprint .var { color: #A6E22E; }*/ .ke-content div.ref .ref_body {margin:0;padding:2px;line-height:20px;color:#666;font-size:9pt;}
/*.prettyprint .pln { color: #66D9EF; }*/
.ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;background:#f4f5f7 url('../img/blockquote.gif') no-repeat left top;color:#060;font-size:9pt;}

View File

@ -43,7 +43,7 @@ pre li,ul,ol {
} }
/* Specify class=linenums on a pre to get line numbering */ /* Specify class=linenums on a pre to get line numbering */
ol.linenums { margin-top: 0; margin-bottom: 0;line-height: 3px } /* IE indents via margin-left */ ol.linenums { margin-top: 0; margin-bottom: 0;line-height: 15px } /* IE indents via margin-left */
li.L0, li.L0,
li.L1, li.L1,
li.L2, li.L2,