From bb94a41435db111385804b6786e86d0c00baa7da Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 21 Dec 2015 15:11:41 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E7=BA=A2=E7=82=B9=E4=B8=AD=E5=8C=85?= =?UTF-8?q?=E5=90=ABat=E7=9A=84=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 2714117e9..aa048888c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -344,7 +344,8 @@ class User < Principal user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count system_messages_count = SystemMessage.where("created_at >?", User.current.onclick_time.onclick_time).count - messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count = AtMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count + messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count end # 查询指派给我的缺陷记录 From 8cdd7c58cf945786a367c28cfed01985c94981d7 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 21 Dec 2015 15:14:51 +0800 Subject: [PATCH 02/17] =?UTF-8?q?at=E5=90=8D=E5=8D=95=E5=8A=A0=E5=AE=BD?= =?UTF-8?q?=E4=B8=80=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/at/jquery.atwho.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/kindeditor/at/jquery.atwho.css b/public/assets/kindeditor/at/jquery.atwho.css index 9a4c21d9b..df3ff9d94 100644 --- a/public/assets/kindeditor/at/jquery.atwho.css +++ b/public/assets/kindeditor/at/jquery.atwho.css @@ -9,7 +9,7 @@ border: 1px solid #DDD; border-radius: 3px; box-shadow: 0 0 5px rgba(0,0,0,0.1); - min-width: 120px; + min-width: 200px; max-height: 200px; overflow: auto; z-index: 11110 !important; From b235e8de70a3aded02a09ca1338bb2fdbaf6bfa2 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 21 Dec 2015 15:15:39 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/configuration.yml.example | 73 ++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 22 deletions(-) diff --git a/config/configuration.yml.example b/config/configuration.yml.example index 27eb86f68..880c613e9 100644 --- a/config/configuration.yml.example +++ b/config/configuration.yml.example @@ -23,7 +23,7 @@ # email_delivery: # delivery_method: :smtp # smtp_settings: -# address: "localhost" +# address: smtp.163.com # port: 25 # # ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com @@ -32,12 +32,12 @@ # email_delivery: # delivery_method: :smtp # smtp_settings: -# address: "example.com" -# port: 25 +# address: smtp.gmail.com +# port: 587 # authentication: :login # domain: 'foo.com' -# user_name: 'myaccount' -# password: 'password' +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja # # ==== SMTP server at example.com using PLAIN authentication # @@ -45,12 +45,12 @@ # email_delivery: # delivery_method: :smtp # smtp_settings: -# address: "example.com" -# port: 25 +# address: smtp.gmail.com +# port: 587 # authentication: :plain # domain: 'example.com' -# user_name: 'myaccount' -# password: 'password' +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja # # ==== SMTP server at using TLS (GMail) # @@ -62,12 +62,12 @@ # delivery_method: :smtp # smtp_settings: # enable_starttls_auto: true -# address: "smtp.gmail.com" +# address: smtp.gmail.com # port: 587 # domain: "smtp.gmail.com" # 'your.domain.com' for GoogleApps # authentication: :plain -# user_name: "your_email@gmail.com" -# password: "your_password" +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja # # # === More configuration options @@ -78,18 +78,17 @@ # http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer -# default configuration options for all environments + default: - # Outgoing emails configuration (see examples above) email_delivery: delivery_method: :smtp smtp_settings: - address: smtp.example.net - port: 25 - domain: example.net - authentication: :login - user_name: "redmine@example.net" - password: "redmine" + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" # Absolute path to the directory where attachments are stored. # The default is the 'files' directory in your Redmine instance. @@ -104,7 +103,7 @@ default: # autologin_cookie_name: the name of the cookie (default: autologin) # autologin_cookie_path: the cookie path (default: /) # autologin_cookie_secure: true sets the cookie secure flag (default: false) - autologin_cookie_name: + autologin_cookie_name: "autologin_trustie" autologin_cookie_path: autologin_cookie_secure: @@ -170,7 +169,7 @@ default: # Absolute path (e.g. /usr/bin/convert, c:/im/convert.exe) to # the ImageMagick's `convert` binary. Used to generate attachment thumbnails. - #imagemagick_convert_command: + imagemagick_convert_command: '/home/pdl/redmine-2.3.2-0/common/bin/convert' # Configuration of RMagcik font. # @@ -196,11 +195,41 @@ default: # Maximum number of simultaneous AJAX uploads #max_concurrent_ajax_uploads: 2 + #pic_types: "bmp,jpeg,jpg,png,gif" + + repository_root_path: '/tmp/htdocs' + judge_server: 'http://judge.trustie.net/' + + # Git's url + gitlab_address: 'http://gitfast.trustie.net' # specific configuration options for production environment # that overrides the default ones production: + # CJK support + rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf + judge_server: 'http://192.168.80.21:8080/' + repository_root_path: '/home/pdl/redmine-2.3.2-0/apache2/htdocs' + cookie_domain: ".trustie.net" + email_delivery: + delivery_method: :smtp + smtp_settings: + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" # specific configuration options for development environment # that overrides the default ones development: + email_delivery: + delivery_method: :smtp + smtp_settings: + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" From 4111cb53dcd1fb9a1192c1a6a2234ef202400274 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 21 Dec 2015 17:13:13 +0800 Subject: [PATCH 04/17] =?UTF-8?q?=E8=A7=A3=E5=86=B3fork=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE404=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index e939511b6..1674055ac 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -31,8 +31,8 @@ class RepositoriesController < ApplicationController default_search_scope :changesets before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo] - before_filter :find_repository, :only => [:edit, :update, :destroy, :committers, :forked] - before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo,:to_gitlab] + before_filter :find_repository, :only => [:edit, :update, :destroy, :committers] + before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked] before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue] before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked] accept_rss_auth :revisions @@ -64,6 +64,8 @@ class RepositoriesController < ApplicationController end def forked + @project = Project.find(params[:id]) + @repository = Repository.where("project_id =? and type =?", @project.id, "Repository::Gitlab") # 如果当前用户已经fork过该项目,不会新fork项目,则跳至已fork的项 unless has_forked?(@project, User.current) project = project_from_current_project(@project.id, User.current.id) @@ -76,7 +78,11 @@ class RepositoriesController < ApplicationController else g = Gitlab.client if User.current.gid.nil? - g.sync_user(User.current) + begin + g.sync_user(User.current) + ensure + logger.error "Synv user failed ==>#{User.current.id}" + end end gproject = g.fork(@project.gpid, User.current.gid) if gproject From 0e68266f4915c0ee0826c718849d84121c1b391e Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 22 Dec 2015 10:59:09 +0800 Subject: [PATCH 05/17] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/show.html.erb | 2 +- public/stylesheets/repository.css | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index e5f331d6c..afe4740eb 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -41,7 +41,7 @@
<%= @changesets_latest_coimmit.message %>
<% else %> -
<%=@changesets_latest_coimmit.author_email %>
+
<%=@changesets_latest_coimmit.author_email %>
提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
<%= @changesets_latest_coimmit.message %>
diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css index 2e084d61c..baf57c4b1 100644 --- a/public/stylesheets/repository.css +++ b/public/stylesheets/repository.css @@ -286,4 +286,5 @@ li.commit .commit-row-info .committed_ago { } .rep_history_grey{ color: #7F7F7F; -} \ No newline at end of file +} +.rep_mail_name{max-width: 150px; overflow: hidden; text-overflow: ellipsis;} \ No newline at end of file From 22d8fc9abd7c4d5d3138593ce4bbc851c184ab14 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 22 Dec 2015 15:45:17 +0800 Subject: [PATCH 06/17] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B9=B1=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 21 +++++++++++++++++---- public/javascripts/application.js | 27 ++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 1a01ac97b..2a4430935 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -1,4 +1,8 @@ -require 'zip' +#coding=utf-8 + +require "base64" +require 'zip' + class ZipdownController < ApplicationController #查找项目(课程) before_filter :find_project_by_bid_id, :only => [:assort] @@ -11,7 +15,12 @@ class ZipdownController < ApplicationController def download if User.current.logged? begin - send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file]) + if params[:base64file] + file = Base64.decode64(params[:base64file]) + send_file "#{OUTPUT_FOLDER}/#{file}", :filename => filename_for_content_disposition(file), :type => detect_content_type(file) + else + send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file]) + end rescue => e render file: 'public/no_file_found.html' end @@ -107,7 +116,9 @@ class ZipdownController < ApplicationController bid_homework_path, OUTPUT_FOLDER) } [{files:[out_file.file_path], count: 1, index: 1, - real_file: out_file.file_path, file: File.basename(out_file.file_path), + real_file: out_file.file_path, + file: File.basename(out_file.file_path), + base64file: Base64.encode64(File.basename(out_file.file_path)), size:(out_file.pack_size / 1024.0 / 1024.0).round(2) }] end @@ -129,7 +140,9 @@ class ZipdownController < ApplicationController bid_homework_path, OUTPUT_FOLDER) } [{files:[out_file.file_path], count: 1, index: 1, - real_file: out_file.file_path, file: File.basename(out_file.file_path), + real_file: out_file.file_path, + file: File.basename(out_file.file_path), + base64file: Base64.encode64(File.basename(out_file.file_path)), size:(out_file.pack_size / 1024.0 / 1024.0).round(2) }] end diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 901e302d3..0cbe647d6 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -870,7 +870,10 @@ function redo() { window.location.reload() } -function encodeHomeworkUrl(url){ +function encodeHomeworkUrl(url, is_base64){ + if(typeof is_base64 === 'boolean' && is_base64){ + return '/zipdown/download?base64file='+url; + } var file = encodeURI(url).replace(/\+/g, '%2B'); return '/zipdown/download?file='+file; } @@ -891,7 +894,10 @@ $(function(){ } if(res.length==1){ - location.href = encodeHomeworkUrl(res[0].file);return; + if(res[0].base64file){ + location.href = encodeHomeworkUrl(res[0].base64file, true);return; + } + location.href = encodeHomeworkUrl(res[0].file);return; } document.getElementById('light').style.display='block'; @@ -904,8 +910,12 @@ $(function(){ } else { des = '第'+res[i].index+'个学生的作品下载'; } - $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + if(res[i].base64file){ + $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } else { + $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } } } }); @@ -973,3 +983,14 @@ function showNormalImage(id) { } } + +$(function(){ + //at 加链接 + $("span.at").hover(function(){ + $(this).css('cursor', 'pointer'); + }); + $("span.at").live('click', function(){ + var userId = $(this).attr('data-user-id'); + $(window.location).attr('href', '/users/'+userId); + }); +}); \ No newline at end of file From fd746c25f3acda39f5a73d804b0de4837691beaa Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 22 Dec 2015 16:11:09 +0800 Subject: [PATCH 07/17] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=94=B9=E4=B8=BAbase64=E4=BC=A0=E8=BE=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/application.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 0cbe647d6..3d9fba942 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -931,7 +931,10 @@ $(function(){ else { if(res.length==1){ - location.href = encodeHomeworkUrl(res[0].file);return; + if(res[0].base64file){ + location.href = encodeHomeworkUrl(res[0].base64file, true);return; + } + location.href = encodeHomeworkUrl(res[0].file);return; } document.getElementById('light').style.display='block'; $container = $('#light .upload_box_ul'); @@ -943,7 +946,12 @@ $(function(){ } else { des = '第'+res[i].index+'个学生的作品下载'; } + + if(res[i].base64file){ + $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } else { $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } } } From 2eca28a10de25d8511b5bb784ecebac1e8710e7b Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 23 Dec 2015 10:02:54 +0800 Subject: [PATCH 08/17] =?UTF-8?q?LastName=20=E5=A7=93=20FirstName=20?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 30072777e..56cf4b915 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -18,8 +18,8 @@
  • 登录名 : *
  • 邮箱 : *
  • 身份 : *
  • -
  • 姓(First Name) : *
  • -
  • 名(Last Name) : *
  • +
  • 姓(Last Name) : *
  • +
  • 名(First Name) : *
  • 组织名 : *
  • 性别 : 
  • 工作单位 : 
  • From 7688546e7a00ba9356b45cdc9cbafe4abfb2d296 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 23 Dec 2015 11:12:34 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8E=E6=B2=A1=E6=9C=89=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/edit.html.erb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index c8510c8cf..6806e0996 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -21,10 +21,7 @@ $.ajax({ url:' /forums/'+'<%= @memo.forum_id.to_s %>'+'/memos/<%= @memo.id.to_s%>', type:'put', - data:{ - 'memo[subject]':$("#memo_subject").val(), - 'memo[content]':$("#memo_content").val() - }, + data:$("#edit_memo").serialize(), success:function(data){ }, From e8bf93e4ad3e5f8bea48e935f4fc7ad670db426c Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 23 Dec 2015 11:13:14 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0butto?= =?UTF-8?q?n=E7=9A=84=E8=B7=AF=E5=BE=84=E5=8E=BB=E6=8E=89project=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blog_comments/_blog_attachments.erb | 2 +- app/views/forums/_file_form.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/blog_comments/_blog_attachments.erb b/app/views/blog_comments/_blog_attachments.erb index dd8be659b..86298a330 100644 --- a/app/views/blog_comments/_blog_attachments.erb +++ b/app/views/blog_comments/_blog_attachments.erb @@ -57,7 +57,7 @@ :max_file_size => Setting.attachment_max_size.to_i.kilobytes, :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js', :project => container), + :upload_path => uploads_path(:format => 'js'), :description_placeholder => l(:label_optional_description), :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb index 2510952f1..9bbbc9188 100644 --- a/app/views/forums/_file_form.html.erb +++ b/app/views/forums/_file_form.html.erb @@ -58,7 +58,7 @@ :max_file_size => Setting.attachment_max_size.to_i.kilobytes, :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js', :project => project), + :upload_path => uploads_path(:format => 'js'), :description_placeholder => l(:label_optional_description), :field_is_public => l(:field_is_public), :are_you_sure => l(:text_are_you_sure), From 00711f11006eb79827da014157c83f44a9c732df Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 23 Dec 2015 16:12:23 +0800 Subject: [PATCH 11/17] =?UTF-8?q?issue=E7=BC=96=E8=BE=91=E3=80=81=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=82=AE=E4=BB=B6=E4=B8=AD=E5=8E=BB=E6=8E=89token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/project_score_helper.rb | 6 +++--- app/models/mailer.rb | 12 ++++++------ app/views/mailer/issue_add.html.erb | 2 +- app/views/mailer/issue_add.text.erb | 2 +- app/views/mailer/issue_edit.html.erb | 2 +- app/views/mailer/issue_edit.text.erb | 2 +- config/locales/zh.yml | 1 + 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb index d73e1592e..a41b7d8ed 100644 --- a/app/helpers/project_score_helper.rb +++ b/app/helpers/project_score_helper.rb @@ -22,10 +22,10 @@ module ProjectScoreHelper #代码提交数量 def changesets_num project - g = Gitlab.client - project.gpid.nil? ? 0 : g.commits_total_count(project.gpid).count + # g = Gitlab.client + # project.gpid.nil? ? 0 : g.commits_total_count(project.gpid).count # # commits_total_count(project.gpid) - # project.changesets.count + project.changesets.count end #讨论区帖子数量 diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 551ddd616..1cbe7421c 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -394,7 +394,7 @@ class Mailer < ActionMailer::Base @issue = issue user = User.find_by_mail(recipients) @user = user - @token = Token.get_token_from_user(user, 'autologin') + # @token = Token.get_token_from_user(user, 'autologin') @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id) # edit @@ -436,15 +436,15 @@ class Mailer < ActionMailer::Base user = User.find_by_mail(recipients) @user = user - @token = Token.get_token_from_user(user, 'autologin') + # @token = Token.get_token_from_user(user, 'autologin') # edit - @issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id, :token => @token.value) - @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value) - @user_url = url_for(my_account_url(user,:token => @token.value)) + @issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id) + @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id) + @user_url = url_for(my_account_url(user)) - @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :anchor => "change-#{journal.id}", :token => @token.value) + @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :anchor => "change-#{journal.id}") s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] " s << "(#{issue.status.name}) " if journal.new_value_for('status_id') s << issue.subject diff --git a/app/views/mailer/issue_add.html.erb b/app/views/mailer/issue_add.html.erb index d77149831..0d8bb0007 100644 --- a/app/views/mailer/issue_add.html.erb +++ b/app/views/mailer/issue_add.html.erb @@ -6,7 +6,7 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/mailer/issue_add.text.erb b/app/views/mailer/issue_add.text.erb index cc2eb814f..1793fb22d 100644 --- a/app/views/mailer/issue_add.text.erb +++ b/app/views/mailer/issue_add.text.erb @@ -4,6 +4,6 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/mailer/issue_edit.html.erb b/app/views/mailer/issue_edit.html.erb index a02fe47f5..16e0967c2 100644 --- a/app/views/mailer/issue_edit.html.erb +++ b/app/views/mailer/issue_edit.html.erb @@ -9,7 +9,7 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/mailer/issue_edit.text.erb b/app/views/mailer/issue_edit.text.erb index d1d625cec..8730d8a16 100644 --- a/app/views/mailer/issue_edit.text.erb +++ b/app/views/mailer/issue_edit.text.erb @@ -9,6 +9,6 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 03424bd5a..10241b4b3 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -703,6 +703,7 @@ zh: label_search_by_login: 登录名 label_search_by_name: 名字 label_search_by_email: 邮箱 + label_search_by_occupation: 单位 label_result_plural: 结果 label_all_words: 所有单词 label_wiki: Wiki From 19f84b111b28c1ede77c51e34e11710563085eb0 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 23 Dec 2015 17:16:35 +0800 Subject: [PATCH 12/17] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E6=8C=89=E5=A4=A9?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=8E=BB=E6=8E=89token=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mailer/send_for_user_activities.html.erb | 96 +++++++++--------- .../mailer/send_for_user_activities.text.erb | 98 +++++++++---------- 2 files changed, 97 insertions(+), 97 deletions(-) diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb index ae5604099..7fdd737e3 100644 --- a/app/views/mailer/send_for_user_activities.html.erb +++ b/app/views/mailer/send_for_user_activities.html.erb @@ -16,16 +16,16 @@
  • [ - <%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value), + <%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course), :class=> "wmail_column", :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", + <%= link_to course_new.author, user_activities_url(course_new.author), :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) %> - <%= link_to truncate(course_new.title.html_safe,length: 30,omission: '...'), news_url(course_new,:token => @token.value), + <%= link_to truncate(course_new.title.html_safe,length: 30,omission: '...'), news_url(course_new), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -39,17 +39,17 @@ [ <% unless course_news_comment.commented.nil? %> - <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course, :token => @token.value), + <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> ] - <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author,:token => @token.value), :class => "wmail_name", + <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author), :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_reply) %> - <%= link_to truncate(l(:label_course_notice_point),length: 30,omission: '...'), news_url(course_news_comment.commented,:token => @token.value), + <%= link_to truncate(l(:label_course_notice_point),length: 30,omission: '...'), news_url(course_news_comment.commented), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -72,16 +72,16 @@ [ - <%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course, :token => @token.value), + <%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course), :class=> "wmail_column", :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", + <%= link_to bid.user, user_activities_url(bid.user), :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_course_homework) %> - <%= link_to truncate(bid.name.html_safe,length: 30,omission: '...'), student_work_index_url(:homework => bid.id,:token => @token.value), + <%= link_to truncate(bid.name.html_safe,length: 30,omission: '...'), student_work_index_url(:homework => bid.id), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -105,16 +105,16 @@ [ - <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value), + <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course), :class=> "wmail_column", :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", + <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user), :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_send_course_journals_for_messages) %> - <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value), + <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -135,14 +135,14 @@
  • [ - <%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course.id, :token => @token.value), + <%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course.id), :class=> "wmail_column", :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", + <%= link_to course_message.author, user_activities_url(course_message.author), :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_send_course_messages) %> - <%= link_to truncate(course_message.subject.html_safe,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value), + <%= link_to truncate(course_message.subject.html_safe,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id), :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) %> @@ -163,16 +163,16 @@ [ - <%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value), + <%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course), :class=> "wmail_column", :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", + <%= link_to attachment.author, user_activities_url(attachment.author), :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_course_file_upload) %> - <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value), + <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -199,14 +199,14 @@
  • [ - <%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value), + <%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project), :class=> "wmail_column", :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", + <%= link_to issue.author, user_activities_url(issue.author), :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_issue) %> - <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value), + <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue), :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) %> @@ -217,14 +217,14 @@
  • [ - <%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project, :token => @token.value), + <%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to issues_journal.user, user_activities_url(issues_journal.user,:token => @token.value), :class => "wmail_name", + <%= link_to issues_journal.user, user_activities_url(issues_journal.user), :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_issue_update) %> - <%= link_to truncate(issues_journal.issue.subject, length:30,omission:'...'),issue_url(issues_journal.issue, :token => @token.value), + <%= link_to truncate(issues_journal.issue.subject, length:30,omission:'...'),issue_url(issues_journal.issue), :style => "color:#2E8DD7;float:left;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" @@ -251,16 +251,16 @@ [ - <%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value), + <%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project), :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", + <%= link_to project_message.author, user_activities_url(project_message.author), :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_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), + <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -283,16 +283,16 @@ [ <% unless wikicontent.page.nil? %> - <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value), + <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> ] - <%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value), :class => "wmail_name", + <%= link_to wikicontent.author, user_activities_url(wikicontent.author), :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_wiki_mail_notification) %> <% unless wikicontent.page.nil? %> - <%= link_to wikicontent.text.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_wiki_url(wikicontent.page.wiki,:token => @token.value), + <%= link_to wikicontent.text.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_wiki_url(wikicontent.page.wiki), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; max-width:400px;height:23px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> @@ -314,15 +314,15 @@ [ - <%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value), + <%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project), :class=> "wmail_column", :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", + <%= link_to project_new.author, user_activities_url(project_new.author), :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_mail_notice) %> - <%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value), + <%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new), :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) %> @@ -336,16 +336,16 @@ [ <% unless project_news_comment.commented.nil? %> - <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project, :token => @token.value), + <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> ] - <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author,:token => @token.value), :class => "wmail_name", + <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author), :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(:lable_project_mail_notice_reply) %> - <%= link_to truncate(l(:lable_project_notice_point),length: 30,omission: '...'), news_url(project_news_comment.commented,:token => @token.value), + <%= link_to truncate(l(:lable_project_notice_point),length: 30,omission: '...'), news_url(project_news_comment.commented), :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_news_comment.created_on) %> @@ -366,16 +366,16 @@ [ - <%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project, :token => @token.value), + <%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to project_attachment.author, user_activities_url(project_attachment.author,:token => @token.value), :class => "wmail_name", + <%= link_to project_attachment.author, user_activities_url(project_attachment.author), :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_mail_upload) %> - <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'), project_files_url(project_attachment.project,:token => @token.value), + <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'), project_files_url(project_attachment.project), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -398,16 +398,16 @@ [ - <%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value), + <%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value), :class => "wmail_name", + <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user), :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_send_course_journals_for_messages) %> - <%= link_to project_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_feedback_url(project_journal_message.project,:token => @token.value), + <%= link_to project_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_feedback_url(project_journal_message.project), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; max-width:400px; max-height:30px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -434,12 +434,12 @@
  • - <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value), + <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user), :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_show_your_message) %> - <%= link_to user_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe,feedback_url(@user,:token => @token.value), + <%= link_to user_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe,feedback_url(@user), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; max-width:400px; max-height:30px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -466,12 +466,12 @@
  • - <%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value), + <%= link_to forum.creator, user_activities_url(forum.creator), :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_forum_new) %> - <%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum,:token => @token.value), + <%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -492,7 +492,7 @@
  • - <%= link_to memo.author, user_activities_url(memo.author,:token => @token.value), + <%= link_to memo.author, user_activities_url(memo.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %> @@ -516,7 +516,7 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/mailer/send_for_user_activities.text.erb b/app/views/mailer/send_for_user_activities.text.erb index f86dec62d..f4c354790 100644 --- a/app/views/mailer/send_for_user_activities.text.erb +++ b/app/views/mailer/send_for_user_activities.text.erb @@ -6,11 +6,11 @@ <%= l(:label_course_news) %> <% @course_news.each do |course_new|%> - ▪[<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%> ] + ▪[<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course)%> ] - <%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value) %> + <%= link_to course_new.author, user_activities_url(course_new.author) %> <%= l(:label_project_notice) %> - <%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value) %> + <%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new) %> <%= format_time(course_new.created_on) %> <% end %> <% end %> @@ -19,12 +19,12 @@ <%= l(:label_course_news) %> <% @course_news_comments.each do |course_news_comment|%> ▪[ <% unless course_news_comment.commented.nil? %> - <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course, :token => @token.value) %> + <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course) %> <% end %> ] - <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author,:token => @token.value) %> + <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author) %> <%= l(:label_project_notice_reply) %> - <%= link_to truncate(course_news_comment.comments,length: 30,omission: '...'), news_url(course_news_comment.commented,:token => @token.value) %> + <%= link_to truncate(course_news_comment.comments,length: 30,omission: '...'), news_url(course_news_comment.commented) %> <%= format_time(course_news_comment.created_on) %> <% end %> <% end %> @@ -33,10 +33,10 @@ <%= 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) %>] - <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value) %> + ▪[<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course) %>] + <%= link_to bid.user, user_activities_url(bid.user) %> <%= l(:label_course_homework) %> - <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value) %> + <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id) %> <%= format_time(bid.created_at) %> <% end %> <% end %> @@ -46,10 +46,10 @@ <% unless @course_journal_messages.first.nil? %> <%= l(:view_course_journals_for_messages) %> <% @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) %>] - <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value) %> + [ <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course) %>] + <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user) %> <%= l(:label_send_course_journals_for_messages) %> - <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value) %> + <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course) %> <%= format_time(course_journal_message.created_on) %> <% end %> <% end %> @@ -57,10 +57,10 @@ <% unless @course_messages.first.nil? %> <%= l(:view_borad_course) %> <% @course_messages.each do |course_message|%> - ▪[<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value)%>] - <%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value) %> + ▪[<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course)%>] + <%= link_to course_message.author, user_activities_url(course_message.author) %> <%= 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) %> + <%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id) %> <%= format_time(course_message.created_on) %> <% end %> <% end %> @@ -68,10 +68,10 @@ <% unless @attachments.first.nil? %> <%= l(:label_course_mail_files) %> <% @attachments.each do |attachment|%> - ▪[<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value) %>] - <%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value) %> + ▪[<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course) %>] + <%= link_to attachment.author, user_activities_url(attachment.author) %> <%= l(:label_course_file_upload) %> - <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value) %> + <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course) %> <%= format_time(attachment.created_on) %> <% end %> @@ -86,10 +86,10 @@ <% unless @issues.first.nil? %> <%= l(:label_issue_tracking) %> <% @issues.each do |issue|%> - ▪[<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value) %>] - <%= link_to issue.author, user_activities_url(issue.author,:token => @token.value) %> + ▪[<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project) %>] + <%= link_to issue.author, user_activities_url(issue.author) %> <%= l(:label_project_issue) %> - <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value) %> + <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue) %> <%= format_time(issue.created_on) %> <% end %> @@ -99,13 +99,13 @@ <% unless @issues_journals.first.nil? %> <%= l(:label_issue_tracking) %> <% @issues_journals.each do |issues_journal| %> - ▪[<%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project, :token => @token.value) %>] - <%= link_to issues_journal.user, user_activities_url(issues_journal.user,:token => @token.value) %> + ▪[<%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project) %>] + <%= link_to issues_journal.user, user_activities_url(issues_journal.user) %> <%= l(:label_project_issue_update) %> <% if issues_journal.notes.nil? %> - <%= link_to truncate(issues_journal.issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value) %> + <%= link_to truncate(issues_journal.issue.subject,length: 30,omission: '...'),issue_url(issue) %> <% else %> - <%= link_to truncate(issues_journal.notes.html_safe,length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value) %> + <%= link_to truncate(issues_journal.notes.html_safe,length: 30,omission: '...'),issue_url(issues_journal.issue) %> <% end %> <%= format_time(issues_journal.created_on) %> <% end %> @@ -115,10 +115,10 @@ <% unless @project_messages.first.nil? %> <%= l(:project_moule_boards_show) %> <% @project_messages.each do |project_message|%> - ▪[<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value) %>] - <%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value) %> + ▪[<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project) %>] + <%= link_to project_message.author, user_activities_url(project_message.author) %> <%= 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) %> + <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id) %> <%= format_time(project_message.created_on) %> <% end %> @@ -129,13 +129,13 @@ <%= 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) %> + <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project) %> <% end %> ] - <%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value) %> + <%= link_to wikicontent.author, user_activities_url(wikicontent.author) %> <%= 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) %> + <%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki) %> <% end %> <%= format_time(wikicontent.updated_on) %> <% end %> @@ -145,10 +145,10 @@ <% 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) %> + ▪[<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project) %> ] + <%= link_to project_new.author, user_activities_url(project_new.author) %> <%= l(:label_project_mail_notice) %> - <%= link_to truncate(project_new.title.html_safe,length: 30,omission: '...'), news_url(project_new,:token => @token.value) %> + <%= link_to truncate(project_new.title.html_safe,length: 30,omission: '...'), news_url(project_new) %> <%= format_time(project_new.created_on) %> <% end %> <% end %> @@ -158,11 +158,11 @@ <%= l(:label_project_news) %> <% @project_news_comments.each do |project_news_comment|%> ▪[ <% unless project_news_comment.commented.nil? %> - <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project, :token => @token.value) %> + <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project) %> <% end %>] - <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author,:token => @token.value) %> + <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author) %> <%= l(:lable_project_mail_notice_reply) %> - <%= link_to truncate(project_news_comment.comments.html_safe,length: 30,omission: '...'), news_url(project_news_comment.commented,:token => @token.value) %> + <%= link_to truncate(project_news_comment.comments.html_safe,length: 30,omission: '...'), news_url(project_news_comment.commented) %> <%= format_time(project_news_comment.created_on) %> <% end %> @@ -172,10 +172,10 @@ <% unless @project_attachments.first.nil? %> <%= l(:label_project_mail_attachments) %> <% @project_attachments.each do |project_attachment|%> - ▪[<%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project, :token => @token.value) %>] - <%= link_to project_attachment.author, user_activities_url(project_attachment.author,:token => @token.value) %> + ▪[<%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project) %>] + <%= link_to project_attachment.author, user_activities_url(project_attachment.author) %> <%= l(:label_project_mail_upload) %> - <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'),project_files_url(project_attachment.project,:token => @token.value) %> + <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'),project_files_url(project_attachment.project) %> <%= format_time(project_attachment.created_on) %> <% end %> <% end %> @@ -184,10 +184,10 @@ <% 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) %> + ▪[<%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project) %> ] + <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user) %> <%= 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) %> + <%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project) %> <%= format_time(project_journal_message.created_on) %> <% end %> @@ -202,9 +202,9 @@ <%= l(:label_user_message) %> (<%= @user_journal_messages.count %>) <% @user_journal_messages.each do |user_journal_message|%> - ▪ <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value)%> + ▪ <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user)%> <%= l(:label_show_your_message) %> - <%= link_to truncate(user_journal_message.notes.html_safe,length: 30,omission: '...'), feedback_url(@user,:token => @token.value) %> + <%= link_to truncate(user_journal_message.notes.html_safe,length: 30,omission: '...'), feedback_url(@user) %> <%= format_time(user_journal_message.created_on) %> <% end %> <% end %> @@ -214,9 +214,9 @@ <% unless @forums.first.nil? %> <%= l(:label_user_forum) %> <% @forums.each do |forum|%> - ▪<%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value) %> + ▪<%= link_to forum.creator, user_activities_url(forum.creator) %> <%= l(:label_forum_new) %> - <%= link_to truncate(forum.name.html_safe,length: 30,omission: '...'),forum_url(forum,:token => @token.value) %> + <%= link_to truncate(forum.name.html_safe,length: 30,omission: '...'),forum_url(forum) %> <%= format_time(forum.created_at) %> <% end %> @@ -224,7 +224,7 @@ <% unless @memos.first.nil? %> <%= l(:label_user_message_forum) %> <% @memos.each do |memo|%> - ▪<%= link_to memo.author, user_activities_url(memo.author,:token => @token.value)%> + ▪<%= link_to memo.author, user_activities_url(memo.author)%> <%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %> <%= link_to truncate(memo.subject.html_safe,length: 30,omission: '...'),forum_memo_url(memo.forum, (memo.parent_id.nil? ? memo : memo.parent_id))%> <%= format_time(memo.created_at) %> @@ -238,6 +238,6 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <%= l(mail_option) %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> From 055fac5e2716b369a40172479c7d9976fdac6906 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 23 Dec 2015 17:29:40 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=BE=97=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/project_score_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb index a41b7d8ed..d73e1592e 100644 --- a/app/helpers/project_score_helper.rb +++ b/app/helpers/project_score_helper.rb @@ -22,10 +22,10 @@ module ProjectScoreHelper #代码提交数量 def changesets_num project - # g = Gitlab.client - # project.gpid.nil? ? 0 : g.commits_total_count(project.gpid).count + g = Gitlab.client + project.gpid.nil? ? 0 : g.commits_total_count(project.gpid).count # # commits_total_count(project.gpid) - project.changesets.count + # project.changesets.count end #讨论区帖子数量 From 7d35931460e9aa9c4a719dc1d9550d768621c0e9 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 24 Dec 2015 15:27:49 +0800 Subject: [PATCH 14/17] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/hjq_test.rake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/tasks/hjq_test.rake diff --git a/lib/tasks/hjq_test.rake b/lib/tasks/hjq_test.rake new file mode 100644 index 000000000..77b4bd22c --- /dev/null +++ b/lib/tasks/hjq_test.rake @@ -0,0 +1,16 @@ +namespace :hjq do + namespace :news do + desc "news order" + task :users => :environment do + a = [] + news = News.where("course_id =?", 122) + news.each do |new| + unless new.comments.blank? + new = new.comments.sort! { |a,b| a.created_on <=> b.created_on}.last.commented + end + a << new + end + puts a.length + end + end +end From a92d33300bafbfc4d076c45e85de956f84010d4e Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 24 Dec 2015 17:18:52 +0800 Subject: [PATCH 15/17] =?UTF-8?q?=E9=87=8C=E7=A8=8B=E7=A2=91=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20=E2=80=9C=E5=B7=B2=E8=A7=A3=E5=86=B3=E2=80=9D?= =?UTF-8?q?=EF=BC=8C=E5=8C=BA=E5=88=86=E5=B7=B2=E8=A7=A3=E5=86=B3=E5=92=8C?= =?UTF-8?q?=E5=B7=B2=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 +++- public/stylesheets/public.css | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c4bbc4ebb..4bdffb9dc 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -253,8 +253,10 @@ module ApplicationHelper subject = truncate(subject, :length => 60) end end - if issue.status_id == 5 + if issue.status_id == 3 s = link_to text, issue_path(issue), :class => "text_line_s", :title => title + elsif issue.status_id == 5 + s = link_to text, issue_path(issue), :class => "text_line_s del_line", :title => title else s = link_to text, issue_path(issue), :class => "c_blue", :title => title end diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d9f370c7d..7047316c6 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -916,4 +916,5 @@ a.resourcesTypeUser {background:url(images/homepage_icon.png) -178px -453px no-r .list_style ul li{list-style-type: disc;margin-left: 20px;} /* @功能 定义 */ -span.at {color:#269ac9;} \ No newline at end of file +span.at {color:#269ac9;} +.del_line{text-decoration:line-through !important;} \ No newline at end of file From ad4656454558e5603dee7e453286c62079e44484 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 25 Dec 2015 10:06:48 +0800 Subject: [PATCH 16/17] test --- lib/tasks/hjq_test.rake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/tasks/hjq_test.rake b/lib/tasks/hjq_test.rake index 77b4bd22c..f0be77fe6 100644 --- a/lib/tasks/hjq_test.rake +++ b/lib/tasks/hjq_test.rake @@ -3,14 +3,16 @@ namespace :hjq do desc "news order" task :users => :environment do a = [] - news = News.where("course_id =?", 122) - news.each do |new| + # news = News.where("course_id =?", 122) + course.news.each do |new| unless new.comments.blank? - new = new.comments.sort! { |a,b| a.created_on <=> b.created_on}.last.commented + latest_comment = new.comments.sort! { |a,b| a.created_on <=> b.created_on}.last end - a << new + a << latest_comment end - puts a.length + comments = a.map(&:commented_id).detect{|a.b| a.created_on <=> b.created_on} + # comments = a.sort!{|a.b| a.created_on <=> b.created_on} + news = News.where("id in (?)", comments) end end end From f4fc978b231e7aaa1b08c1dc681731ffe1019f01 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 25 Dec 2015 15:47:22 +0800 Subject: [PATCH 17/17] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=95=99=E8=A8=80bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/words/_new_respond_course.html.erb | 22 ++++---------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/app/views/words/_new_respond_course.html.erb b/app/views/words/_new_respond_course.html.erb index 5bd2a9f3c..99c119a0c 100644 --- a/app/views/words/_new_respond_course.html.erb +++ b/app/views/words/_new_respond_course.html.erb @@ -1,9 +1,9 @@ -<%= form_tag(words_create_reply_path, :remote => true,:id=>"form_#{journal.id}") do %> +<%= form_tag(words_create_reply_path, :remote => true) do %> <%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5', :style => "resize: none;overflow: hidden;",:rows => 4, :placeholder => l(:label_feedback_respond_content)#, - #:maxlength => 250 + #:maxlength => 250 %>

    <%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %> @@ -13,20 +13,6 @@
    <%= submit_tag l(:button_feedback_respond), :name => nil , - :class => "reply_btn" ,:onclick=>"form_sub_#{ journal.id}($(this),event)"%> + :class => "reply_btn"%> -<% end %> - +<% end %> \ No newline at end of file