From 63785564e8df5bcaca36c35e3d330d94d2b75d78 Mon Sep 17 00:00:00 2001
From: yutao <283765470@qq.com>
Date: Tue, 9 Jun 2015 16:06:26 +0800
Subject: [PATCH 01/21] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9B=BE=E7=89=87?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=B8=8D=E6=94=AF=E6=8C=81=E5=A4=9A=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=E5=99=A8=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/assets/kindeditor/kindeditor.js | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js
index 176e00ec8..d9b51648c 100644
--- a/public/assets/kindeditor/kindeditor.js
+++ b/public/assets/kindeditor/kindeditor.js
@@ -1,3 +1,10 @@
+//function dump_obj(myObject) {
+// var s = "";
+// for (var property in myObject) {
+// s = s + "\n "+property +": " + myObject[property] ;
+// }
+// alert(s);
+//}
/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2013 kindsoft.net
@@ -4150,6 +4157,7 @@ function KUploadButton(options) {
}
_extend(KUploadButton, {
init : function(options) {
+ //dump_obj(options);
var self = this,
button = K(options.button),
fieldName = options.fieldName || 'file',
@@ -4180,6 +4188,7 @@ _extend(KUploadButton, {
button.hide();
button.before(div);
self.div = div;
+ options.ops.up_file_div = div;//options.ops是KindEditor.create()的options参数
self.button = button;
self.iframe = options.target ? K('iframe[name="' + target + '"]') : K('iframe', div);
self.form = options.form ? K(options.form) : K('form', div);
@@ -5602,8 +5611,11 @@ _plugin('core', function(K) {
inputObj.setAttribute('type', 'button');
inputObj.setAttribute('style', 'visibility:hidden');
document.body.appendChild(inputObj);
- window.uploadButton = K.uploadbutton({
- button: inputObj,
+
+ //window.uploadButton = K.uploadbutton({
+ self.uploadButton = K.uploadbutton({
+ ops:self, //self 是KindEditor.create()的options参数
+ button: inputObj,
fieldName:'imgFile',
url:K.addParam('/kindeditor/upload', 'dir=image'),
afterUpload : function(data) {
@@ -5625,8 +5637,8 @@ _plugin('core', function(K) {
alert('error: ' + str);
}
});
- uploadButton.fileBox.change(function(e) {
- uploadButton.submit();
+ self.uploadButton.fileBox.change(function(e) {
+ self.uploadButton.submit();
});
if (self.fullscreenShortcut) {
@@ -5663,7 +5675,7 @@ _plugin('core', function(K) {
});
});
self.clickToolbar('imagedirectupload', function() {
- $('.ke-upload-file').focus().trigger('click');
+ $('.ke-upload-file',this.up_file_div).trigger('click');
});
self.clickToolbar('formatblock', function() {
From 4ed4d3fa44169a3a45199105b5fdfea470351ce6 Mon Sep 17 00:00:00 2001
From: yutao <283765470@qq.com>
Date: Tue, 9 Jun 2015 16:21:19 +0800
Subject: [PATCH 02/21] ...
---
public/assets/kindeditor/kindeditor.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js
index d9b51648c..b019bccf1 100644
--- a/public/assets/kindeditor/kindeditor.js
+++ b/public/assets/kindeditor/kindeditor.js
@@ -4188,7 +4188,7 @@ _extend(KUploadButton, {
button.hide();
button.before(div);
self.div = div;
- options.ops.up_file_div = div;//options.ops是KindEditor.create()的options参数
+ if(options.ops!=undefined)options.ops.up_file_div = div;//options.ops是KindEditor.create()的options参数
self.button = button;
self.iframe = options.target ? K('iframe[name="' + target + '"]') : K('iframe', div);
self.form = options.form ? K(options.form) : K('form', div);
@@ -4990,13 +4990,13 @@ KEditor.prototype = {
'emoticons',
'source','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', '|',
'formatblock', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
- 'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'link', "less",
+ 'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'media', "less",
'/',
'undo', 'redo', '|', 'preview', 'print', 'template',
'justifyfull', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
- 'superscript', 'clearhtml', 'quickformat', 'selectall', 'fontname',
+ 'superscript', 'clearhtml', 'quickformat', /* 'selectall',*/ 'fontname',
'strikethrough', 'lineheight', 'hr', 'pagebreak',
- 'anchor' , 'unlink'
+ 'anchor' , 'link','unlink'
]
K.each(fullItems, function(i, name) {
if (name == '|') {
From 857d3d5f623eb918b3ab6b15078c1b1f7f08b7a4 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 9 Jun 2015 17:03:28 +0800
Subject: [PATCH 03/21] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5?=
=?UTF-8?q?=E7=BB=93=E6=9E=9C=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/poll_controller.rb | 52 ++++++++++++++++++++++++++++--
app/views/poll/_poll.html.erb | 2 ++
config/locales/zh.yml | 1 +
config/routes.rb | 1 +
4 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index 32ec3dad2..73650a782 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -1,8 +1,8 @@
class PollController < ApplicationController
- before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll]
+ before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll]
before_filter :find_container, :only => [:new,:create, :index]
before_filter :is_member_of_course, :only => [:index,:show,:poll_result]
- before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll]
+ before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll]
include PollHelper
def index
if @course
@@ -360,6 +360,17 @@ class PollController < ApplicationController
end
end
+ #导出问卷
+ def export_poll
+ poll_questions = @poll.poll_questions
+ respond_to do |format|
+ format.xls {
+ send_data(poll_to_xls(poll_questions), :type => "text/excel;charset=utf-8; header=present",
+ :filename => "#{@poll.polls_name}.xls")
+ }
+ end
+ end
+
private
def find_poll_and_course
@poll = Poll.find params[:id]
@@ -438,4 +449,41 @@ class PollController < ApplicationController
end
pu
end
+
+ #将poll中题目转换为Excel
+ def poll_to_xls poll_questions
+ xls_report = StringIO.new
+ book = Spreadsheet::Workbook.new
+ sheet1 = book.create_worksheet :name => "poll"
+ blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
+ count_row = 0
+ poll_questions.each do |poll_question|
+ if poll_question.question_type == 1 || poll_question.question_type == 2
+ sheet1.row(count_row).default_format = blue
+ sheet1[count_row,0]= l(:label_poll_question_num,:num => poll_question.question_number)
+ sheet1[count_row + 1,0] = l(:label_poll_subtotal)
+ sheet1[count_row + 2,0] = l(:label_poll_proportion)
+ poll_question.poll_answers.each_with_index do |poll_answer,i|
+ sheet1[count_row, i + 1] = poll_answer.answer_text
+ sheet1[count_row + 1, i + 1] = poll_answer.poll_votes.count
+ sheet1[count_row + 2, i + 1] = statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)).to_s + "%"
+ end
+ sheet1[count_row + 3,0] = l(:label_poll_valid_commit)
+ sheet1[count_row + 3,1] = total_answer(poll_question.id)
+ count_row += 5
+ else
+ sheet1.row(count_row).default_format = blue
+ sheet1[count_row,0] = l(:label_poll_question_num,:num => poll_question.question_number)
+ sheet1[count_row,1] = poll_question.question_title
+ count_row += 1
+ poll_question.poll_votes.each do |poll_vote|
+ sheet1[count_row,0] = poll_vote.vote_text
+ count_row += 1
+ end
+ count_row += 1
+ end
+ end
+ book.write xls_report
+ xls_report.string
+ end
end
\ No newline at end of file
diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb
index 3c4426696..14f351182 100644
--- a/app/views/poll/_poll.html.erb
+++ b/app/views/poll/_poll.html.erb
@@ -25,6 +25,8 @@
<%= link_to(l(:button_delete), poll,:method => :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml5 mr10") %>
+
<%= link_to "导出", export_poll_poll_path(poll.id,:format => "xls"), :class => "polls_de fr ml5"%>
+
<% if poll.polls_status == 1 %>
<%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml5"%>
<% else%>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 7653a0c4e..8434843d6 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -1936,6 +1936,7 @@ zh:
label_poll_description: 问卷描述
label_poll_options: 选项
label_poll_subtotal: 小计
+ label_poll_question_num: "第%{num}题"
label_poll_proportion: 比例
label_poll_valid_commit: 本题有效填写人次
label_poll_result: 问卷调查_问卷统计
diff --git a/config/routes.rb b/config/routes.rb
index d2c21f6ea..c92c732d2 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -70,6 +70,7 @@ RedmineApp::Application.routes.draw do
get 'republish_poll'
get 'poll_result'
get 'close_poll'
+ get 'export_poll'
end
collection do
delete 'delete_poll_question'
From 4c5d2d50559d05df48abac44e6bad426497c8482 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 9 Jun 2015 17:08:00 +0800
Subject: [PATCH 04/21] =?UTF-8?q?poll=E5=88=97=E8=A1=A8=E7=95=8C=E9=9D=A2?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4=EF=BC=8C=E5=AF=BC=E5=87=BA?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=9D=83=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/poll/_poll.html.erb | 9 +++++++--
public/stylesheets/polls.css | 2 +-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb
index 14f351182..180fed0f0 100644
--- a/app/views/poll/_poll.html.erb
+++ b/app/views/poll/_poll.html.erb
@@ -25,8 +25,6 @@
<%= link_to(l(:button_delete), poll,:method => :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml5 mr10") %>
- <%= link_to "导出", export_poll_poll_path(poll.id,:format => "xls"), :class => "polls_de fr ml5"%>
-
<% if poll.polls_status == 1 %>
<%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml5"%>
<% else%>
@@ -39,6 +37,13 @@
关闭
<% end%>
+ <% if poll.polls_status == 1%>
+ 导出
+ <% elsif poll.polls_status == 2 || poll.polls_status == 3 %>
+ <%= link_to "导出", export_poll_poll_path(poll.id,:format => "xls"), :class => "polls_de fr ml5"%>
+ <% end%>
+
+
<%= format_date poll.created_at.to_date%>
<% else%>
<% if poll.polls_status == 2%>
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index f1b5023bd..353ec3937 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -127,7 +127,7 @@ a:hover.btn_de{ background:#ff5d31;}
a.btn_pu{ border:1px solid #3cb761; color:#3cb761; }
a:hover.btn_pu{ background:#3cb761;}
.pollsbtn_grey{ border:1px solid #b1b1b1; color:#b1b1b1; padding:0px 9px; height:19px; padding-top:3px; }
-.polls_title_w { width:330px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
+.polls_title_w { width:300px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
.polls_title_st { max-width:530px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
.polls_de_grey{ color:#b1b1b1; margin-top:3px;}
.ml5{ margin-left:5px;}
From f3dd7c11b6bb44865ff3fee6fd37e2aced0d8bb0 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 9 Jun 2015 17:11:54 +0800
Subject: [PATCH 05/21] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=97=AE=E5=8D=B7?=
=?UTF-8?q?=E7=AD=94=E6=A1=88=E6=97=B6=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/poll/commit_poll.js.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/poll/commit_poll.js.erb b/app/views/poll/commit_poll.js.erb
index 8f68dae68..76e5e53df 100644
--- a/app/views/poll/commit_poll.js.erb
+++ b/app/views/poll/commit_poll.js.erb
@@ -1,6 +1,6 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status}) %>');
-showModal('ajax-modal', '250px');
-$('#ajax-modal').css('height','100px');
+showModal('ajax-modal', '270px');
+$('#ajax-modal').css('height','110px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("" +
" ");
From 918d03d4ddda6602f018e5d6853ff2fbf2d90ce5 Mon Sep 17 00:00:00 2001
From: yutao <283765470@qq.com>
Date: Wed, 10 Jun 2015 10:29:17 +0800
Subject: [PATCH 06/21] ...
---
app/views/boards/show.html.erb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb
index bf276925a..2a280fe03 100644
--- a/app/views/boards/show.html.erb
+++ b/app/views/boards/show.html.erb
@@ -104,7 +104,8 @@ function nh_check_field(params){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
- params.textarea.html(params.content.html());
+// params.textarea.html(params.content.html()); //用这个ie11提交到服务器居然木有值 真特么旧梦已尘风
+ params.content.sync(); //但是这个貌似编辑器没内容时不会同步到textarea中 新愁不言中...
if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空');
params.contentmsg.css({color:'#ff0000'});
From 0d9bdae5b074f1683db15cb7726eb05af0c3a2f5 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 10 Jun 2015 15:02:44 +0800
Subject: [PATCH 07/21] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E6=8C=89=E5=A4=A9?=
=?UTF-8?q?=E5=8F=91=E9=80=81=E6=96=B0=E7=95=8C=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/mailer.rb | 1 -
.../mailer/send_for_user_activities.html.erb | 215 +++++++++---------
config/locales/zh.yml | 1 +
3 files changed, 107 insertions(+), 110 deletions(-)
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 7411dd30f..b3aff41d2 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -107,7 +107,6 @@ class Mailer < ActionMailer::Base
and (i.created_on between '#{date_from}' and '#{date_to}') order by i.created_on desc"
@issues = Issue.find_by_sql(sql)
-
# @bids 查询课程作业,包括老师发布的作业,以及user提交作业
# @attachments查询课程课件更新
@attachments ||= []
diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb
index 54d2db43c..38805d837 100644
--- a/app/views/mailer/send_for_user_activities.html.erb
+++ b/app/views/mailer/send_for_user_activities.html.erb
@@ -5,61 +5,62 @@
<% if @attachments.first || @course_news.first || @bids.first ||
@course_journal_messages.first|| @course_messages.first %>
-
<%= l(:label_course_overview)%>
+
<%= l(:label_course_overview)%>
<% unless @course_news.first.nil? %>
-
-
+
+
<%= l(:label_course_news) %>
- (<%= @course_news.count %>)
-
+
+
<% @course_news.each do |course_new|%>
▪
- [
-
+ [
<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value),
:class=> "wmail_column",
- :style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
- ]
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ ]
<%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value), :class => "wmail_name",
- :style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
- <%= l(:label_project_notice) %>
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_project_notice) %>
<%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value),
:class => 'wmail_info',
- :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<%= format_time(course_new.created_on) %>
<% end %>
-
<% end %>
<% unless @bids.empty? %>
-
- <%= l(:label_homework_overview) %>(<%= @bids.count %>)
+
+
+ <%= l(:label_homework_overview) %>
+
+
<% unless @bids.first.nil?%>
<% @bids.each do |bid| %>
▪
- [
+ [
<%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course, :token => @token.value),
:class=> "wmail_column",
- :style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
- ]
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ ]
<%= link_to bid.user, user_activities_url(bid.user,:token => @token.value), :class => "wmail_name",
- :style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
- <%= l(:label_course_homework) %>
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_course_homework) %>
<%= link_to truncate(bid.name,length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value),
:class => 'wmail_info',
- :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<%= format_time(bid.created_at) %>
@@ -72,29 +73,29 @@
<% unless @course_journal_messages.first.nil? %>
-
-
+
+
<%= l(:view_course_journals_for_messages) %>
- (<%= @course_journal_messages.count %>)
-
+
+
<% @course_journal_messages.each do |course_journal_message|%>
▪
- [
+ [
<%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value),
:class=> "wmail_column",
- :style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
- ]
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ ]
<%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value), :class => "wmail_name",
- :style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
- <%= l(:label_send_course_journals_for_messages) %>
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_send_course_journals_for_messages) %>
<%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value),
:class => 'wmail_info',
- :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<%= format_time(course_journal_message.created_on) %>
@@ -105,25 +106,25 @@
<% unless @course_messages.first.nil? %>
-
-
+
+
<%= l(:view_borad_course) %>
- (<%= @course_messages.count %>)
-
+
+
<% @course_messages.each do |course_message|%>
▪
- [
+ [
<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course.id, :token => @token.value),
:class=> "wmail_column",
- :style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
- ]
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ ]
<%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value), :class => "wmail_name",
- :style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
- <%= l(:label_send_course_messages) %>
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_send_course_messages) %>
<%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value),
:class => 'wmail_info',
- :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<%= format_time(course_message.created_on) %>
<% end %>
@@ -133,28 +134,28 @@
<% unless @attachments.first.nil? %>
-
-
+
+
<%= l(:label_course_attendingcontestwork_download) %>
- (<%= @attachments.count %>)
-
+
+
<% @attachments.each do |attachment|%>
▪
- [
+ [
<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value),
:class=> "wmail_column",
- :style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
- ]
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ ]
<%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value), :class => "wmail_name",
- :style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
- <%= l(:label_course_file_upload) %>
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_course_file_upload) %>
<%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value),
:class => 'wmail_info',
- :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<%= format_time(attachment.created_on) %>
@@ -165,32 +166,29 @@
<% end %>
-
-
<% if @issues.first || @project_messages.first %>
-
<%= l(:label_project_overview_new)%>
+
<%= l(:label_project_overview_new)%>
<% unless @issues.first.nil? %>
-
-
+
+
<%= l(:label_issue_tracking) %>
- (<%= @issues.count %>)
-
+
+
<% @issues.each do |issue|%>
▪
- [
+ [
<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value),
:class=> "wmail_column",
- :style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
- ]
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ ]
<%= link_to issue.author, user_activities_url(issue.author,:token => @token.value), :class => "wmail_name",
- :style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
- <%= l(:label_project_issue) %>
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_project_issue) %>
<%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value),
- :class => 'wmail_info',
- :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<%= format_time(issue.created_on) %>
@@ -202,29 +200,28 @@
<% unless @project_messages.first.nil? %>
-
-
+
+
<%= l(:project_moule_boards_show) %>
- (<%= @project_messages.count %>)
-
-
+
+
<% @project_messages.each do |project_message|%>
▪
- [
+ [
<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value),
:class=> "wmail_column",
- :style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
]
<%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value), :class => "wmail_name",
- :style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
- <%= l(:label_send_course_messages) %>
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_send_course_messages) %>
<%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value),
:class => 'wmail_info',
- :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<%= format_time(project_message.created_on) %>
@@ -236,28 +233,27 @@
<% unless @project_news.first.nil? %>
-
-
+
+
<%= l(:label_project_news) %>
- (<%= @project_news.count %>)
-
+
+
<% @project_news.each do |project_new|%>
▪
- [
+ [
<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value),
:class=> "wmail_column",
- :style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
- ]
+ :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ ]
<%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value), :class => "wmail_name",
- :style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
- <%= l(:label_project_notice) %>
+ :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_project_notice) %>
<%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value),
:class => 'wmail_info',
- :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
- %>
+ :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<%= format_time(project_new.created_on) %>
<% end %>
@@ -271,13 +267,13 @@
<% unless @user_journal_messages.first.nil? %>
-
<%= l(:label_activities) %>
+
<%= l(:label_activities) %>
-
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 59431b3ad..4bfc1ef99 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -439,3 +439,4 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
img{max-width: 100%;}
.attachments {clear: both;}
.is_public_checkbox{margin-left: 15px;margin-right: 10px;}
+.author_name{color: #3ca5c6 !important;}
From 57804a118de3259a88ed1be82d38686581943568 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 10 Jun 2015 16:37:18 +0800
Subject: [PATCH 11/21] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E5=B1=95=E5=BC=80=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/homework_common/index.html.erb | 6 +++---
config/locales/commons/zh.yml | 2 +-
public/javascripts/course.js | 9 +++++++++
public/stylesheets/courses.css | 4 ----
4 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb
index 1e8189ddb..3208bb969 100644
--- a/app/views/homework_common/index.html.erb
+++ b/app/views/homework_common/index.html.erb
@@ -41,9 +41,9 @@
<%= homework.description.html_safe %>
-
-
diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb
index d52f7cfe1..9d4eebd6f 100644
--- a/app/views/words/_journal_reply_items.html.erb
+++ b/app/views/words/_journal_reply_items.html.erb
@@ -34,7 +34,7 @@
<% end %>
<% if reply_allow %>
<%= link_to l(:button_reply),'',
- {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
+ {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
<% end %>
diff --git a/app/views/words/_new_respond_course.html.erb b/app/views/words/_new_respond_course.html.erb
index e705b7fd3..5b27fd21f 100644
--- a/app/views/words/_new_respond_course.html.erb
+++ b/app/views/words/_new_respond_course.html.erb
@@ -4,12 +4,14 @@
:placeholder => l(:label_feedback_respond_content),
:maxlength => 250 %>
+
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
+
<%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "reply_btn"%>
-
+
<% end %>
\ No newline at end of file
From a4f1edcdeeb5967f7ab6be84ba9eec94226e1644 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 11 Jun 2015 16:30:14 +0800
Subject: [PATCH 20/21] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9Awiki=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E5=85=B6=E5=AE=83=E6=88=90=E5=91=98=E5=8F=AF=E4=BB=A5?=
=?UTF-8?q?=E6=94=B6=E5=88=B0=EF=BC=9B=20=E9=A1=B9=E7=9B=AE=E3=80=81?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=95=99=E8=A8=80=E5=85=B6=E5=AE=83=E6=88=90?=
=?UTF-8?q?=E5=91=98=E5=8F=AF=E4=BB=A5=E6=94=B6=E5=88=B0=20=E9=82=AE?=
=?UTF-8?q?=E4=BB=B6=E6=98=BE=E7=A4=BA=E9=A1=B5=E9=9D=A2=E5=9B=BD=E9=99=85?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/mailer.rb | 15 ++--
.../mailer/send_for_user_activities.html.erb | 30 +++----
.../mailer/send_for_user_activities.text.erb | 82 ++++++++++++++++---
config/locales/zh.yml | 2 +
4 files changed, 98 insertions(+), 31 deletions(-)
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 610f2b4c6..8488fc1d0 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -103,7 +103,7 @@ class Mailer < ActionMailer::Base
course_ids = courses.map {|course| course.id}.join(",")
# 查询user的缺陷,项目中成员都能收到
- sql = "select * from members m, issues i where i.project_id = m.project_id and m.user_id='#{user.id}'
+ sql = "select DISTINCT * from members m, issues i where i.project_id = m.project_id and m.user_id='#{user.id}'
and (i.created_on between '#{date_from}' and '#{date_to}') order by i.created_on desc"
@issues = Issue.find_by_sql(sql)
@@ -127,7 +127,7 @@ class Mailer < ActionMailer::Base
# 查询user所在项目添加wiki
@wiki_contents = WikiContent.find_by_sql("select DISTINCT wc.* from wikis w, members m, projects p, wiki_pages wp, wiki_contents wc where
- m.user_id = '#{user.id}' and p.user_id = m.user_id and m.project_id=p.id and w.project_id = p.id and w.id = wp.wiki_id and wc.page_id = wp.id and w.project_id>0
+ m.user_id = '#{user.id}' and m.project_id = p.id and w.project_id = p.id and w.id = wp.wiki_id and wc.page_id = wp.id and w.project_id>0
and (wc.updated_on between '#{date_from}' and '#{date_to}') order by updated_on desc")
# 查询user在课程中发布的讨论帖子
@@ -163,13 +163,16 @@ class Mailer < ActionMailer::Base
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc") : []
# 查询user在课程及个人中留言
- @course_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT * from journals_for_messages where
- jour_type='Course' and user_id = #{user.id} and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
+ @course_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT jfm.* from journals_for_messages jfm, members m, courses c
+ where m.user_id = '#{user.id}' and c.id = m.course_id and jfm.jour_id = c.id
+ and jfm.jour_type='Course' and (jfm.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
+
@user_journal_messages = user.journals_for_messages.where("jour_type='Principal' and (created_on between '#{date_from}' and '#{date_to}')").order('created_on DESC')
# 查询user在项目中留言(用户反馈)
- @project_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT * from journals_for_messages where
- jour_type='Project' and user_id = #{user.id} and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
+ @project_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT jfm.* from journals_for_messages jfm, members m, projects p
+ where m.user_id = '#{user.id}' and p.id = m.project_id and jfm.jour_id = p.id
+ and jfm.jour_type='Project' and (jfm.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
# 查询user新建贴吧或发布帖子
@forums = Forum.find_by_sql("select DISTINCT * from forums where creator_id = #{user.id} and (created_at between '#{date_from}' and '#{date_to}') order by created_at desc")
diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb
index 7776a420d..f30c770da 100644
--- a/app/views/mailer/send_for_user_activities.html.erb
+++ b/app/views/mailer/send_for_user_activities.html.erb
@@ -29,7 +29,7 @@
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
- <%= format_time(course_new.created_on) %>
+ <%= format_time(course_new.created_on) %>
<% end %>
@@ -62,7 +62,7 @@
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
- <%= format_time(bid.created_at) %>
+ <%= format_time(bid.created_at) %>
<% end %>
<% end %>
@@ -97,7 +97,7 @@
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
- <%= format_time(course_journal_message.created_on) %>
+ <%= format_time(course_journal_message.created_on) %>
<% end %>
@@ -125,7 +125,7 @@
<%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value),
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
- <%= format_time(course_message.created_on) %>
+ <%= format_time(course_message.created_on) %>
<% end %>
@@ -157,7 +157,7 @@
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
- <%= format_time(attachment.created_on) %>
+ <%= format_time(attachment.created_on) %>
<% end %>
@@ -190,7 +190,7 @@
<%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value),
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
- <%= format_time(issue.created_on) %>
+ <%= format_time(issue.created_on) %>
<% end %>
@@ -223,7 +223,7 @@
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
- <%= format_time(project_message.created_on) %>
+ <%= format_time(project_message.created_on) %>
<% end %>
@@ -250,13 +250,13 @@
]
<%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value), :class => "wmail_name",
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
- <%= l(:label_project_notice) %>
+ <%= l(:label_wiki_mail_notification) %>
<% unless wikicontent.page.nil? %>
<%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki,:token => @token.value),
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<% end %>
- <%= format_time(wikicontent.updated_on) %>
+ <%= format_time(wikicontent.updated_on) %>
<% end %>
@@ -281,12 +281,12 @@
]
<%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value), :class => "wmail_name",
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
- <%= l(:label_project_notice) %>
+ <%= l(:label_project_mail_notice) %>
<%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value),
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
- <%= format_time(project_new.created_on) %>
+ <%= format_time(project_new.created_on) %>
<% end %>
@@ -319,7 +319,7 @@
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
- <%= format_time(project_journal_message.created_on) %>
+ <%= format_time(project_journal_message.created_on) %>
<% end %>
@@ -352,7 +352,7 @@
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
- <%= format_time(user_journal_message.created_on) %>
+ <%= format_time(user_journal_message.created_on) %>
<% end %>
@@ -384,7 +384,7 @@
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
- <%= format_time(forum.created_at) %>
+ <%= format_time(forum.created_at) %>
<% end %>
@@ -411,7 +411,7 @@
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
- <%= format_time(memo.created_at) %>
+ <%= format_time(memo.created_at) %>
<% end %>
diff --git a/app/views/mailer/send_for_user_activities.text.erb b/app/views/mailer/send_for_user_activities.text.erb
index 1bfbca4a1..f09dcb299 100644
--- a/app/views/mailer/send_for_user_activities.text.erb
+++ b/app/views/mailer/send_for_user_activities.text.erb
@@ -4,7 +4,7 @@
<%= l(:label_course_overview)%>
<% unless @course_news.first.nil? %>
<%= l(:label_course_news) %>
- (<%= @course_news.count %>)
+
<% @course_news.each do |course_new|%>
@@ -28,7 +28,7 @@
<% end %>
<% unless @bids.empty? %>
- <%= l(:label_homework_overview) %><%= @bids.count %>
+ <%= l(:label_homework_overview) %>
<% unless @bids.first.nil?%>
<% @bids.each do |bid| %>
▪
@@ -58,7 +58,7 @@
<% unless @course_journal_messages.first.nil? %>
- <%= l(:view_course_journals_for_messages) %> (<%= @course_journal_messages.count %>)
+ <%= l(:view_course_journals_for_messages) %>
<% @course_journal_messages.each do |course_journal_message|%>
@@ -88,7 +88,7 @@
<% unless @course_messages.first.nil? %>
<%= l(:view_borad_course) %>
- (<%= @course_messages.count %>)
+
<% @course_messages.each do |course_message|%>
@@ -119,7 +119,7 @@
<% unless @attachments.first.nil? %>
<%= l(:label_course_attendingcontestwork_download) %>
- (<%= @attachments.count %>)
+
<% @attachments.each do |attachment|%>
@@ -146,12 +146,12 @@
<% end %>
<% end %>
-<% @issues.first || @project_messages.first %>
+<% @issues.first || @project_messages.first || @wiki_contents.first || @project_news.first || @project_journal_messages.first %>
<%= l(:label_project_overview_new)%>
<% unless @issues.first.nil? %>
<%= l(:label_issue_tracking) %>
- (<%= @issues.count %>)
+
<% @issues.each do |issue|%>
▪
@@ -179,7 +179,7 @@
<% unless @project_messages.first.nil? %>
<%= l(:project_moule_boards_show) %>
- (<%= @project_messages.count %>)
+
<% @project_messages.each do |project_message|%>
▪[
@@ -200,6 +200,68 @@
<%= format_time(project_message.created_on) %>
<% end %>
+ <% unless @wiki_contents.first.nil? %>
+
+ <%= l(:label_wiki) %>
+
+ <% @wiki_contents.each do |wikicontent|%>
+ ▪[
+ <% unless wikicontent.page.nil? %>
+ <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value)
+ %>
+ <% end %>
+ ]
+ <%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value) %>
+ <%= l(:label_project_notice) %>
+ <% unless wikicontent.page.nil? %>
+ <%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki,:token => @token.value) %>
+ <% end %>
+ <%= format_time(wikicontent.updated_on) %>
+
+ <% end %>
+ <% end %>
+
+
+ <% unless @project_news.first.nil? %>
+
+ <%= l(:label_project_news) %>
+
+ <% @project_news.each do |project_new|%>
+ ▪[
+
+ <%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value)
+ %>
+ ]
+ <%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value)
+ %>
+ <%= l(:label_project_notice) %>
+
+ <%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value)
+ %>
+ <%= format_time(project_new.created_on) %>
+
+ <% end %>
+ <% end %>
+
+
+ <% unless @project_journal_messages.first.nil? %>
+ <%= l(:label_project_mail_feedback) %>
+
+ <% @project_journal_messages.each do |project_journal_message|%>
+ ▪[
+
+ <%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value)
+ %>
+ ]
+
+ <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value) %>
+ <%= l(:label_send_course_journals_for_messages) %>
+
+ <%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project,:token => @token.value)
+ %>
+ <%= format_time(project_journal_message.created_on) %>
+ <% end %>
+ <% end %>
<% end %>
@@ -234,7 +296,7 @@
<% unless @forums.first.nil? %>
<%= l(:label_user_forum) %>
- (<%= @forums.count %>)
+
<% @forums.each do |forum|%>
▪
@@ -253,7 +315,7 @@
<% unless @memos.first.nil? %>
<%= l(:label_user_message_forum) %>
- (<%= @memos.count %>)
+
<% @memos.each do |memo|%>
▪
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index b2160f7b0..fc0a0e6c6 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -783,6 +783,7 @@ zh:
label_project_newother: "查看其他评论"
label_project_newshare: "分享了"
label_project_notice: "发布了通知:"
+ label_project_mail_notice: "发布了新闻:"
label_project_issue: "发布了问题:"
label_project_newadd: "添加了"
label_project_unadd: "暂无项目,赶快去创建吧!"
@@ -1505,6 +1506,7 @@ zh:
label_news_number: 新闻的数量
label_wiki_number: wiki的数量
+ label_wiki_mail_notification: 发布了wiki
From 2a74509fd9ba54e946a2746c9ff98220f0934103 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 11 Jun 2015 16:33:33 +0800
Subject: [PATCH 21/21] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=A1=B9=E7=9B=AE=E6=8B=AC=E5=8F=B7=E9=A2=9C?=
=?UTF-8?q?=E8=89=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/mailer/send_for_user_activities.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb
index f30c770da..1b4e2c255 100644
--- a/app/views/mailer/send_for_user_activities.html.erb
+++ b/app/views/mailer/send_for_user_activities.html.erb
@@ -213,7 +213,7 @@
<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
- ]
+ ]
<%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value), :class => "wmail_name",
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>