From 2873412d1a120d02530e51bb4d7471b00ea68df5 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 28 Sep 2015 15:06:23 +0800 Subject: [PATCH 01/24] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=82=AE=E4=BB=B6--?= =?UTF-8?q?=E6=AF=8F=E5=A4=A9=E5=8F=91=E9=80=81-=E3=80=8B=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 1 + app/views/mailer/send_for_user_activities.html.erb | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index b820e6d54..3168a4d4d 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -247,6 +247,7 @@ class Mailer < ActionMailer::Base has_content = [@issues,@issues_journals,@course_messages,@project_messages,@course_news,@course_news_comments,@project_news,@project_news_comments,@project_attachments, @course_journal_messages,@user_journal_messages,@project_journal_messages,@forums,@memos,@attachments,@bids,@wiki_contents].any? {|o| !o.empty?} + mylogger.debug "Sent activity mail : #{user.mail} - #{has_content}" #有内容才发,没有不发 mail :to => user.mail,:subject => subject if has_content diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb index 6fc742c99..3f761fbd4 100644 --- a/app/views/mailer/send_for_user_activities.html.erb +++ b/app/views/mailer/send_for_user_activities.html.erb @@ -7,7 +7,7 @@

<%= l(:label_course_overview)%>

- <% unless @course_news.first.nil? || @course_news_comments.first.nil? %> + <% if !@course_news.first.nil? || !@course_news_comments.first.nil? %>
-
<%= reply.content.html_safe %>
+
+ <%= reply.content.html_safe %>
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index ea9c572d9..29752121f 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -37,6 +37,26 @@ $(function() { init_activity_KindEditor_data(<%= user_activity.id%>,null,"87%"); + var description_images=$("div#activity_description_<%= user_activity.id %>").find("img"); + if (description_images.length>0) { + for (var i=0; i").attr("href",image.attr('src')); + image.wrap(element); + } + } + $('#activity_description_<%= user_activity.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false}); + + var reply_images=$("div#reply_content_<%= user_activity.id %>").find("img"); + if (reply_images.length>0) { + for (var i=0; i").attr("href",image.attr('src')); + image.wrap(element); + } + } + $('#reply_content_<%= user_activity.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false}); + }); <% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %> From 8585748a920b13faa5dcd104933264c11bd2e396 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 29 Sep 2015 10:38:14 +0800 Subject: [PATCH 17/24] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=86=85=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E5=88=97=E8=A1=A8=E7=95=8C=E9=9D=A2=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/index.html.erb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 2f6d0bfd9..c725384fd 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -16,6 +16,13 @@
From 61061573a73dd9075d7f9a9de705742e474f4998 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 29 Sep 2015 10:42:17 +0800 Subject: [PATCH 18/24] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93git=E6=93=8D=E4=BD=9C=E6=8C=87=E5=8D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/show.html.erb | 144 +++++++++++++-------------- public/javascripts/project.js | 46 ++++----- 2 files changed, 95 insertions(+), 95 deletions(-) diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 5f279f2c2..cbb899db3 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -29,78 +29,78 @@

- -
-
-
-

git 克隆和提交的用户名和密码为登录用户名和密码

-

项目代码请设置好正确的编码方式(utf-8),否则中文会出现乱码。

-

通过cmd命令提示符进入代码对应文件夹的根目录, - 如果是首次提交代码,执行如下命令:

-
-
-

git init

- -

git add *

- -

git commit -m "first commit"

- -

git remote add origin - <%= @repos_url %> -

- -

git config http.postBuffer 524288000 #设置本地post缓存为500MB

- -

git push -u origin master

-
- -
-

已经有本地库,还没有配置远程地址,打开命令行执行如下:

-
-
-

git remote add origin <%= @repos_url %>

- -

git add .

- -

git commit -m "first commit"

- -

git config http.postBuffer 524288000 #设置本地post缓存为500MB

- -

git push -u origin master

-
- -
-

已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:

-
-
-

git clone <%= @repos_url %>

- -

git push

- -

git checkout -b branch_name

- -

git push origin branch_name

-
- -
-

从网上获取别人的开源版本库,转交到trustie网站上,打开命令行执行如下:

-
-
-

git remote add trustie - <%= @repos_url %> -

- -

git add .

- -

git commit -m "first commit"

- -

git config http.postBuffer 524288000 #设置本地post缓存为500MB

- -

git push -u trustie branch:branch

- -

李海提供

-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% if !@entries.nil? && authorize_for('repositories', 'browse') %> <%= render :partial => 'dir_list' %> diff --git a/public/javascripts/project.js b/public/javascripts/project.js index 3553b4cef..c74ff18bf 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -96,29 +96,29 @@ function show_more_reply1(contentid, id2, id3) { } } //项目版本库git帮助文档显示 -function showhelpAndScrollTo(id) { - $('#' + id).toggle(); - if(cookieget("repositories_visiable") == "true") - { - cookiesave("repositories_visiable", false,'','',''); - } - else - { - cookiesave("repositories_visiable", true,'','',''); - } - var information = $("#showgithelp"); - var val = information.attr("value"); - if(val=="show_help") - { - $("#showgithelp").text("收起Git操作指南"); - information.attr("value", "hide_help"); - } - else - { - $("#showgithelp").text("展开Git操作指南"); - information.attr("value", "show_help"); - } -} +//function showhelpAndScrollTo(id) { +// $('#' + id).toggle(); +// if(cookieget("repositories_visiable") == "true") +// { +// cookiesave("repositories_visiable", false,'','',''); +// } +// else +// { +// cookiesave("repositories_visiable", true,'','',''); +// } +// var information = $("#showgithelp"); +// var val = information.attr("value"); +// if(val=="show_help") +// { +// $("#showgithelp").text("收起Git操作指南"); +// information.attr("value", "hide_help"); +// } +// else +// { +// $("#showgithelp").text("展开Git操作指南"); +// information.attr("value", "show_help"); +// } +//} function showhelpAndScrollToMessage(id, id1, count) { $('#' + id).toggle(); if(cookieget("repositories_visiable") == "true") From f2d3ec980a64c0bbf2f7ac956918c397531ae63e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 29 Sep 2015 10:48:50 +0800 Subject: [PATCH 19/24] =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=EF=BC=8C=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E6=A0=8F=E8=87=AA=E5=8A=A8=E8=8E=B7=E5=BE=97?= =?UTF-8?q?=E7=84=A6=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/index.html.erb | 8 +++++++- app/views/layouts/base_courses.html.erb | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index c725384fd..0c3dd6d8e 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -12,6 +12,12 @@ $("#RSide").removeAttr("id"); $("#Container").css("width","1000px"); }); + + <% if @is_new%> + $(function(){ + $("#homework_name").focus(); + }); + <%end%>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 57dab9933..4dd5b0b27 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -91,9 +91,9 @@ <%= link_to "(#{@course.course_activities.count})", course_path(@course), :class => "subnav_num c_orange"%>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <% if !@entries.nil? && authorize_for('repositories', 'browse') %> <%= render :partial => 'dir_list' %> <% end %> From 7f8acf55b8b1adfc3542749f266108a6b2942ebc Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 29 Sep 2015 11:05:31 +0800 Subject: [PATCH 23/24] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E9=85=8D=E7=BD=AE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E7=9A=84=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_homework.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 8798002c9..868f952fa 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -46,28 +46,28 @@
<%= activity.description.html_safe %>
- <% if is_teacher%> -
+ <%# if is_teacher%> +
From 7057247700de0aad8d8370440a6ef7c84186fc34 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 29 Sep 2015 11:54:43 +0800 Subject: [PATCH 24/24] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=AE=A8=E8=AE=BA=E5=8C=BA=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/comments_controller.rb | 12 ++++++++---- app/controllers/messages_controller.rb | 12 ++++++++---- app/controllers/student_work_controller.rb | 12 ++++++++---- app/controllers/words_controller.rb | 16 ++++++++++------ 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 1efbc9c48..8a64918ae 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -50,11 +50,15 @@ class CommentsController < ApplicationController # # ������ض�̬�ļ�¼add end flash[:notice] = l(:label_comment_added) course_activity = CourseActivity.where("course_act_type='News' and course_act_id =#{@news.id}").first - course_activity.updated_at = Time.now - course_activity.save + if course_activity + course_activity.updated_at = Time.now + course_activity.save + end user_activity = UserActivity.where("act_type='News' and act_id =#{@news.id}").first - user_activity.updated_at = Time.now - user_activity.save + if user_activity + user_activity.updated_at = Time.now + user_activity.save + end end if params[:user_activity_id] diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index c6ac8b906..4f3f3ec0d 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -163,11 +163,15 @@ class MessagesController < ApplicationController # @reply.reply_id = params[:id] @topic.children << @reply course_activity = CourseActivity.where("course_act_type='Message' and course_act_id =#{@topic.id}").first - course_activity.updated_at = Time.now - course_activity.save + if course_activity + course_activity.updated_at = Time.now + course_activity.save + end user_activity = UserActivity.where("act_type='Message' and act_id =#{@topic.id}").first - user_activity.updated_at = Time.now - user_activity.save + if user_activity + user_activity.updated_at = Time.now + user_activity.save + end #@topic.update_attribute(:updated_on, Time.now) if !@reply.new_record? if params[:asset_id] diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index d39d8fe3b..f2858d097 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -174,11 +174,15 @@ class StudentWorkController < ApplicationController if student_work.save course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework.id}").first - course_activity.updated_at = Time.now - course_activity.save + if course_activity + course_activity.updated_at = Time.now + course_activity.save + end user_activity = UserActivity.where("act_type='HomeworkCommon' and act_id =#{@homework.id}").first - user_activity.updated_at = Time.now - user_activity.save + if user_activity + user_activity.updated_at = Time.now + user_activity.save + end respond_to do |format| format.html { flash[:notice] = l(:notice_successful_create) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index a0ce8d18e..a59f507df 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -55,12 +55,16 @@ class WordsController < ApplicationController @jfm = add_reply_adapter options @save_succ = true if @jfm.errors.empty? if @save_succ - course_activity = CourseActivity.where("course_act_type='JournalsForMessage' and course_act_id =#{parent_id}").first - course_activity.updated_at = Time.now - course_activity.save - user_activity = UserActivity.where("act_type='JournalsForMessage' and act_id =#{parent_id}").first - user_activity.updated_at = Time.now - user_activity.save + course_activity = CourseActivity.where("course_act_type='JournalsForMessage' and course_act_id =#{parent_id}").first + if course_activity + course_activity.updated_at = Time.now + course_activity.save + end + user_activity = UserActivity.where("act_type='JournalsForMessage' and act_id =#{parent_id}").first + if user_activity + user_activity.updated_at = Time.now + user_activity.save + end end respond_to do |format| # format.html {