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 001/230] =?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 002/230] =?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 003/230] =?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 004/230] =?UTF-8?q?=E8=A7=A3=E5=86=B3fork=E9=83=A8?= =?UTF-8?q?=E5=88=86=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 005/230] =?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 006/230] =?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 2220e0b7cc315aaab6c446c642bc42a010f4d0e7 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 22 Dec 2015 15:48:41 +0800 Subject: [PATCH 007/230] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B8=96=E5=AD=90-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A0=8F=E7=9B=AE=E5=85=B3=E8=81=94=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/boards_controller.rb | 14 ++++++++++++-- app/models/board.rb | 2 ++ app/models/org_subfield.rb | 2 ++ app/models/org_subfield_board.rb | 5 +++++ config/routes.rb | 1 + .../20151221023622_create_org_subfield_boards.rb | 13 +++++++++++++ ...072758_add_board_type_to_org_subfield_boards.rb | 5 +++++ db/schema.rb | 14 +++++++++++++- spec/factories/org_subfield_boards.rb | 6 ++++++ spec/models/org_subfield_boards_spec.rb | 5 +++++ 10 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 app/models/org_subfield_board.rb create mode 100644 db/migrate/20151221023622_create_org_subfield_boards.rb create mode 100644 db/migrate/20151222072758_add_board_type_to_org_subfield_boards.rb create mode 100644 spec/factories/org_subfield_boards.rb create mode 100644 spec/models/org_subfield_boards_spec.rb diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 0c3236d4e..291593fc5 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -18,8 +18,8 @@ class BoardsController < ApplicationController layout 'base_projects'#by young default_search_scope :messages - before_filter :find_project_by_project_id, :find_board_if_available - before_filter :authorize, :except => [:new, :show, :create, :index] + before_filter :find_project_by_project_id, :find_board_if_available, :except => [:join_to_org_subfields] + before_filter :authorize, :except => [:new, :show, :create, :index, :join_to_org_subfields] accept_rss_auth :index, :show @@ -225,6 +225,16 @@ class BoardsController < ApplicationController redirect_to_settings_in_projects end + def join_to_org_subfields + if params[:id] + @board = Board.find(params[:id]) + @org_subfield_ids = params[:org_subfield_ids] + @org_subfield_ids.each do |id| + OrgSubfieldBoard.create(:org_subfield_id => id.to_i, :board_id => params[:id].to_i) + end + end + end + private def redirect_to_settings_in_projects redirect_to settings_project_url(@project, :tab => 'boards') diff --git a/app/models/board.rb b/app/models/board.rb index 67d59e599..ba1fae30a 100644 --- a/app/models/board.rb +++ b/app/models/board.rb @@ -19,6 +19,8 @@ class Board < ActiveRecord::Base include Redmine::SafeAttributes belongs_to :project,:touch => true belongs_to :course,:touch=>true + has_many :org_subfield_boards + has_many :org_subfields, :class_name => "OrgSubfield", :through => :org_subfield_boards has_many :topics, :class_name => 'Message', :conditions => "#{Message.table_name}.parent_id IS NULL", :order => "#{Message.table_name}.created_on DESC" has_many :messages, :dependent => :destroy, :order => "#{Message.table_name}.created_on DESC" belongs_to :last_message, :class_name => 'Message', :foreign_key => :last_message_id diff --git a/app/models/org_subfield.rb b/app/models/org_subfield.rb index f95bb3eba..062226e0e 100644 --- a/app/models/org_subfield.rb +++ b/app/models/org_subfield.rb @@ -2,6 +2,8 @@ class OrgSubfield < ActiveRecord::Base belongs_to :organization, :foreign_key => :organization_id has_many :org_document_comments, :dependent => :destroy has_many :files + has_many :org_subfield_boards + has_many :boards, :through => :org_subfield_boards acts_as_attachable def project diff --git a/app/models/org_subfield_board.rb b/app/models/org_subfield_board.rb new file mode 100644 index 000000000..ac820e319 --- /dev/null +++ b/app/models/org_subfield_board.rb @@ -0,0 +1,5 @@ +class OrgSubfieldBoard < ActiveRecord::Base + belongs_to :org_subfield + belongs_to :board + # attr_accessible :title, :body +end diff --git a/config/routes.rb b/config/routes.rb index 4121639c0..da04f63f3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -406,6 +406,7 @@ RedmineApp::Application.routes.draw do # boards match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message' + match 'boards/:id/join_to_org_subfields', :to => 'boards#join_to_org_subfields' get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message' match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post] get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' diff --git a/db/migrate/20151221023622_create_org_subfield_boards.rb b/db/migrate/20151221023622_create_org_subfield_boards.rb new file mode 100644 index 000000000..06f6f2f17 --- /dev/null +++ b/db/migrate/20151221023622_create_org_subfield_boards.rb @@ -0,0 +1,13 @@ +class CreateTableOrgSubfieldBoards < ActiveRecord::Migration + def up + create_table :org_subfield_boards do |t| + t.integer :org_subfield_id + t.integer :board_id + t.timestamps + end + end + + def down + drop_table :org_subfield_boards + end +end diff --git a/db/migrate/20151222072758_add_board_type_to_org_subfield_boards.rb b/db/migrate/20151222072758_add_board_type_to_org_subfield_boards.rb new file mode 100644 index 000000000..d53f9952f --- /dev/null +++ b/db/migrate/20151222072758_add_board_type_to_org_subfield_boards.rb @@ -0,0 +1,5 @@ +class AddBoardTypeToOrgSubfieldBoards < ActiveRecord::Migration + def change + add_column :org_subfield_boards, :board_type, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 8e946c493..f2c61ac5f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151218110033) do +ActiveRecord::Schema.define(:version => 20151222072758) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1196,6 +1196,14 @@ ActiveRecord::Schema.define(:version => 20151218110033) do t.datetime "created_at" end + create_table "org_subfield_boards", :force => true do |t| + t.integer "org_subfield_id" + t.integer "board_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "board_type" + end + create_table "org_subfields", :force => true do |t| t.integer "organization_id" t.integer "priority" @@ -1634,6 +1642,10 @@ ActiveRecord::Schema.define(:version => 20151218110033) do t.string "extra" end + create_table "temp", :id => false, :force => true do |t| + t.integer "id", :default => 0, :null => false + end + create_table "time_entries", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false diff --git a/spec/factories/org_subfield_boards.rb b/spec/factories/org_subfield_boards.rb new file mode 100644 index 000000000..0af4bc0d3 --- /dev/null +++ b/spec/factories/org_subfield_boards.rb @@ -0,0 +1,6 @@ +FactoryGirl.define do + factory :org_subfield_board, :class => 'OrgSubfieldBoards' do + + end + +end diff --git a/spec/models/org_subfield_boards_spec.rb b/spec/models/org_subfield_boards_spec.rb new file mode 100644 index 000000000..9a011c015 --- /dev/null +++ b/spec/models/org_subfield_boards_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe OrgSubfieldBoards, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end 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 008/230] =?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 009/230] =?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 9dc2cb8541c5c2e0ec4fce897c98c7f97afbf967 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 23 Dec 2015 10:40:50 +0800 Subject: [PATCH 010/230] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E9=99=84=E4=BB=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 + .../org_document_comments_controller.rb | 5 +- app/models/org_document_comment.rb | 6 ++ .../_attachment.html.erb | 79 +++++++++++++++++++ app/views/org_document_comments/edit.html.erb | 7 +- app/views/org_document_comments/new.html.erb | 8 +- app/views/org_document_comments/show.html.erb | 3 + 7 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 app/views/org_document_comments/_attachment.html.erb diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 664dc4cf5..9ce76dca8 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -242,6 +242,8 @@ class AttachmentsController < ApplicationController format.html { redirect_to_referer_or mobile_version_path } elsif !@attachment.container.nil? && @attachment.container.is_a?(OrgSubfield) format.html {redirect_to_referer_or org_subfield_files_path(@attachment.container)} + elsif !@attachment.container.nil? && @attachment.container.is_a?(OrgDocumentComment) + format.html {redirect_to_referer_or org_document_comment_path(@attachment.container)} else if @project.nil? format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index b8584fea3..67d3b247a 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -1,16 +1,18 @@ class OrgDocumentCommentsController < ApplicationController before_filter :find_organization, :only => [:new, :create, :show, :index] - + helper :attachments layout 'base_org' def new @org_document_comment = OrgDocumentComment.new end + def create @org_document_comment = OrgDocumentComment.new(:organization_id => @organization.id, :creator_id => User.current.id) @org_document_comment.title = params[:org_document_comment][:title] @org_document_comment.content = params[:org_document_comment][:content] + @org_document_comment.save_attachments(params[:attachments]) if params[:field_id] @org_document_comment.org_subfield_id = params[:field_id].to_i end @@ -40,6 +42,7 @@ class OrgDocumentCommentsController < ApplicationController def update @org_document = OrgDocumentComment.find(params[:id]) @org_document.update_attributes(:title => params[:org_document_comment][:title], :content => params[:org_document_comment][:content]) + @org_document.save_attachments(params[:attachments]) if @org_document.parent.nil? act = OrgActivity.where("org_act_type='OrgDocumentComment' and org_act_id =?", @org_document.id).first act.update_attributes(:updated_at => @org_document.updated_at) diff --git a/app/models/org_document_comment.rb b/app/models/org_document_comment.rb index e2ce350ce..8febbf981 100644 --- a/app/models/org_document_comment.rb +++ b/app/models/org_document_comment.rb @@ -5,6 +5,7 @@ class OrgDocumentComment < ActiveRecord::Base belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id' has_many :editor_of_documents, :dependent => :destroy acts_as_tree :order => "#{OrgDocumentComment.table_name}.sticky asc, #{OrgDocumentComment.table_name}.created_at desc" + acts_as_attachable has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy after_create :document_save_as_org_activity @@ -17,4 +18,9 @@ class OrgDocumentComment < ActiveRecord::Base end end + + def project + + end + end diff --git a/app/views/org_document_comments/_attachment.html.erb b/app/views/org_document_comments/_attachment.html.erb new file mode 100644 index 000000000..86298a330 --- /dev/null +++ b/app/views/org_document_comments/_attachment.html.erb @@ -0,0 +1,79 @@ + +
    + +<% if defined?(container) && container && container.saved_attachments %> + <% container.attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><%= l(:field_is_public) %>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %> + <%= if attachment.id.nil? + #待补充代码 + else + link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') + end + %> + <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> + + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + +
    + <% end %> + <% container.saved_attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %> + <%= l(:field_is_public) %>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %> + <%= if attachment.id.nil? + #待补充代码 + else + link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') + end + %> + <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> + + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + +
    + <% end %> +<% end %> +
    +
    + + <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> + + <%#= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %> + 上传附件 + <%= file_field_tag 'attachments[dummy][file]', + :id => '_file', + :class => 'file_selector', + :multiple => true, + :onchange => 'addInputFiles(this);', + :style => ie8? ? '' : 'display:none', + :data => { + :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'), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :lebel_file_uploding => l(:lebel_file_uploding), + :delete_all_files => l(:text_are_you_sure_all) + } %> + + <%= l(:label_no_file_uploaded) %> + + (<%= l(:label_max_size) %>: + <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) + + + <% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> + <% end %> +
    + diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb index 33244ef14..6ee42bb08 100644 --- a/app/views/org_document_comments/edit.html.erb +++ b/app/views/org_document_comments/edit.html.erb @@ -33,10 +33,15 @@
    -

    +
    +
    + <%= render :partial => 'org_document_comments/attachment', :locals => {:container => @org_document} %> +
    +
    +
    确定 diff --git a/app/views/org_document_comments/new.html.erb b/app/views/org_document_comments/new.html.erb index 24160f6eb..6b0a275c3 100644 --- a/app/views/org_document_comments/new.html.erb +++ b/app/views/org_document_comments/new.html.erb @@ -39,10 +39,14 @@ <%= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
    - -

    +
    +
    + <%= render :partial => 'org_document_comments/attachment', :locals => {:container => nil} %> +
    +
    +
    确定 diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index 0848bc4e5..5815483e5 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -29,6 +29,9 @@ <%= @document.content.html_safe %>
    <% end %> +
    + <%= link_to_attachments_course @document, :author => false %> +
    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 011/230] =?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 012/230] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0but?= =?UTF-8?q?ton=E7=9A=84=E8=B7=AF=E5=BE=84=E5=8E=BB=E6=8E=89project?= =?UTF-8?q?=E5=8F=82=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 b9ae579622e024060f7f3fb3891a7b3e70ba86b1 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 23 Dec 2015 15:35:26 +0800 Subject: [PATCH 013/230] =?UTF-8?q?=E5=B0=86=E8=AF=BE=E7=A8=8B=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E8=BD=AC=E5=8F=91=E8=87=B3=E7=BB=84=E7=BB=87=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E6=A0=8F=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 20 ++++++- app/models/board.rb | 2 - app/models/message.rb | 2 + app/models/org_subfield.rb | 4 +- app/models/org_subfield_board.rb | 5 -- app/views/messages/_course_show.html.erb | 1 + .../messages/_join_org_subfield_menu.html.erb | 60 +++++++++++++++++++ .../messages/_show_org_subfields.html.erb | 13 ++++ .../messages/get_subfield_on_click_org.js.erb | 2 + app/views/messages/join_org_subfield.js.erb | 11 ++++ app/views/messages/join_org_subfields.js.erb | 2 + .../_org_left_subfield_list.html.erb | 1 + config/routes.rb | 3 + ...151221023622_create_org_subfield_boards.rb | 13 ---- ...8_add_board_type_to_org_subfield_boards.rb | 5 -- db/schema.rb | 8 +-- public/stylesheets/org.css | 15 ++++- public/stylesheets/public.css | 15 ++++- 18 files changed, 148 insertions(+), 34 deletions(-) delete mode 100644 app/models/org_subfield_board.rb create mode 100644 app/views/messages/_join_org_subfield_menu.html.erb create mode 100644 app/views/messages/_show_org_subfields.html.erb create mode 100644 app/views/messages/get_subfield_on_click_org.js.erb create mode 100644 app/views/messages/join_org_subfield.js.erb create mode 100644 app/views/messages/join_org_subfields.js.erb delete mode 100644 db/migrate/20151221023622_create_org_subfield_boards.rb delete mode 100644 db/migrate/20151222072758_add_board_type_to_org_subfield_boards.rb diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 6f173b7c2..957d77b8a 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -22,7 +22,7 @@ class MessagesController < ApplicationController default_search_scope :messages before_filter :find_board, :only => [:new, :preview,:edit] before_filter :find_attachments, :only => [:preview] - before_filter :find_message, :except => [:new, :preview] + before_filter :find_message, :except => [:new, :preview, :join_org_subfield, :get_subfield_on_click_org, :join_org_subfields] before_filter :authorize, :except => [:preview, :edit, :destroy, :new] helper :boards @@ -301,6 +301,24 @@ class MessagesController < ApplicationController render :partial => 'common/preview' end + def join_org_subfield + @message = Message.find(params[:message_id]) + @organizations = User.current.organizations + end + + def get_subfield_on_click_org + @org = Organization.find(params[:organization_id]) + end + + def join_org_subfields + org_subfield_ids = params[:org_subfields] + @message = Message.find(params[:id]) + type = @message.board.course_id.nil? ? "Project":"Course" + org_subfield_ids.each do |field_id| + OrgSubfieldMessage.create(:org_subfield_id => field_id.to_i, :message_id => @message.id, :message_type => type) + end + end + private def find_message return unless find_board diff --git a/app/models/board.rb b/app/models/board.rb index ba1fae30a..67d59e599 100644 --- a/app/models/board.rb +++ b/app/models/board.rb @@ -19,8 +19,6 @@ class Board < ActiveRecord::Base include Redmine::SafeAttributes belongs_to :project,:touch => true belongs_to :course,:touch=>true - has_many :org_subfield_boards - has_many :org_subfields, :class_name => "OrgSubfield", :through => :org_subfield_boards has_many :topics, :class_name => 'Message', :conditions => "#{Message.table_name}.parent_id IS NULL", :order => "#{Message.table_name}.created_on DESC" has_many :messages, :dependent => :destroy, :order => "#{Message.table_name}.created_on DESC" belongs_to :last_message, :class_name => 'Message', :foreign_key => :last_message_id diff --git a/app/models/message.rb b/app/models/message.rb index 4cdae1f6e..19531e270 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -23,6 +23,8 @@ class Message < ActiveRecord::Base belongs_to :board,:touch => true belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_many :org_subfield_messages, :dependent => :destroy + has_many :org_subfields, :through => :org_subfield_messages acts_as_tree :counter_cache => :replies_count, :order => "#{Message.table_name}.created_on ASC" acts_as_attachable diff --git a/app/models/org_subfield.rb b/app/models/org_subfield.rb index 062226e0e..b63883e81 100644 --- a/app/models/org_subfield.rb +++ b/app/models/org_subfield.rb @@ -2,8 +2,8 @@ class OrgSubfield < ActiveRecord::Base belongs_to :organization, :foreign_key => :organization_id has_many :org_document_comments, :dependent => :destroy has_many :files - has_many :org_subfield_boards - has_many :boards, :through => :org_subfield_boards + has_many :org_subfield_messages, :dependent => :destroy + has_many :messages, :through => :org_subfield_messages acts_as_attachable def project diff --git a/app/models/org_subfield_board.rb b/app/models/org_subfield_board.rb deleted file mode 100644 index ac820e319..000000000 --- a/app/models/org_subfield_board.rb +++ /dev/null @@ -1,5 +0,0 @@ -class OrgSubfieldBoard < ActiveRecord::Base - belongs_to :org_subfield - belongs_to :board - # attr_accessible :title, :body -end diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index e06c04775..1b4c8a0f6 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -57,6 +57,7 @@ :data => {:confirm => l(:text_are_you_sure)}, :class => 'postOptionLink' ) if @message.course_destroyable_by?(User.current) %> + <%= link_to "转发",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %> diff --git a/app/views/messages/_join_org_subfield_menu.html.erb b/app/views/messages/_join_org_subfield_menu.html.erb new file mode 100644 index 000000000..692195892 --- /dev/null +++ b/app/views/messages/_join_org_subfield_menu.html.erb @@ -0,0 +1,60 @@ + + + + + + + + + + +
    +
    转发到
    +
    +
    +
    + +
    + 我的组织 +
    +
      + <% organizations.each do |org| %> +
    • <%= link_to org.name, messages_get_subfield_on_click_org_path(:organization_id => org.id), :remote => true %>
    • + <% end %> +
    +
    + <%= form_tag url_for(:controller => 'messages', :action => 'join_org_subfields', :id => id), :id => 'join-form', :remote => true %> +
    + <%= render :partial => 'show_org_subfields', :locals => {:org => nil} %> +
    +
    + + +
    + + + diff --git a/app/views/messages/_show_org_subfields.html.erb b/app/views/messages/_show_org_subfields.html.erb new file mode 100644 index 000000000..c1fa92990 --- /dev/null +++ b/app/views/messages/_show_org_subfields.html.erb @@ -0,0 +1,13 @@ +
      + + <% if !org.nil? %> + 组织:<%= org.name %> + <% org.org_subfields.where("field_type='Post'").each do |subfield| %> +
    • + +
    • + <% end %> + <% else %> + 请在左侧选择要转发的位置 + <% end %> +
    \ No newline at end of file diff --git a/app/views/messages/get_subfield_on_click_org.js.erb b/app/views/messages/get_subfield_on_click_org.js.erb new file mode 100644 index 000000000..858236a96 --- /dev/null +++ b/app/views/messages/get_subfield_on_click_org.js.erb @@ -0,0 +1,2 @@ +$("#org_subfield_list").html(""); +$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'show_org_subfields', :locals => {:org => @org}) %>"); diff --git a/app/views/messages/join_org_subfield.js.erb b/app/views/messages/join_org_subfield.js.erb new file mode 100644 index 000000000..68e21d4e3 --- /dev/null +++ b/app/views/messages/join_org_subfield.js.erb @@ -0,0 +1,11 @@ +$('#topnav_course_menu').hide(); + +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_org_subfield_menu', :locals => {:organizations => @organizations, :id => @message.id}) %>'); +showModal('ajax-modal', '430px'); +$('#ajax-modal').siblings().hide(); +$('#ajax-modal').before( + ""); +//$('#ajax-modal').css('position','absolute') +$('#ajax-modal').css("top","").css("left",""); +$('#ajax-modal').parent().addClass("resourceSharePopup"); + diff --git a/app/views/messages/join_org_subfields.js.erb b/app/views/messages/join_org_subfields.js.erb new file mode 100644 index 000000000..7cb64e228 --- /dev/null +++ b/app/views/messages/join_org_subfields.js.erb @@ -0,0 +1,2 @@ +hideModal(); +alert("转发成功!"); \ No newline at end of file diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 4d85342a6..9032ba62e 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -9,6 +9,7 @@
      + <%= render :partial => 'layouts/org_projects',:locals=>{:projects=>organization.projects.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
    diff --git a/config/routes.rb b/config/routes.rb index da04f63f3..c5e890d15 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -415,6 +415,9 @@ RedmineApp::Application.routes.draw do post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply' post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy' + match 'messages/join_org_subfield', :to => 'messages#join_org_subfield' + match 'messages/get_subfield_on_click_org', :to => 'messages#get_subfield_on_click_org' + match 'messages/join_org_subfields', :to => 'messages#join_org_subfields' # boards end # Misc issue routes. TODO: move into resources diff --git a/db/migrate/20151221023622_create_org_subfield_boards.rb b/db/migrate/20151221023622_create_org_subfield_boards.rb deleted file mode 100644 index 06f6f2f17..000000000 --- a/db/migrate/20151221023622_create_org_subfield_boards.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateTableOrgSubfieldBoards < ActiveRecord::Migration - def up - create_table :org_subfield_boards do |t| - t.integer :org_subfield_id - t.integer :board_id - t.timestamps - end - end - - def down - drop_table :org_subfield_boards - end -end diff --git a/db/migrate/20151222072758_add_board_type_to_org_subfield_boards.rb b/db/migrate/20151222072758_add_board_type_to_org_subfield_boards.rb deleted file mode 100644 index d53f9952f..000000000 --- a/db/migrate/20151222072758_add_board_type_to_org_subfield_boards.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddBoardTypeToOrgSubfieldBoards < ActiveRecord::Migration - def change - add_column :org_subfield_boards, :board_type, :string - end -end diff --git a/db/schema.rb b/db/schema.rb index f2c61ac5f..50575eca8 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151222072758) do +ActiveRecord::Schema.define(:version => 20151223062932) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1196,12 +1196,12 @@ ActiveRecord::Schema.define(:version => 20151222072758) do t.datetime "created_at" end - create_table "org_subfield_boards", :force => true do |t| + create_table "org_subfield_messages", :force => true do |t| t.integer "org_subfield_id" - t.integer "board_id" + t.integer "message_id" + t.string "message_type" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "board_type" end create_table "org_subfields", :force => true do |t| diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 44dcc70e3..2ffefa48a 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -85,4 +85,17 @@ a.linkGrey8:hover {color:#585858;} .re_con_top span{ color:#999999; font-weight:bold;} ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } -.popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} \ No newline at end of file +.popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} + +/*转发样式*/ +.shareDP {width:415px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; z-index:1000;} +.shareArrow {background:url(../images/arrowList.png) -90px -108px no-repeat; display:inline-block; width:5px; height:10px; margin-right:3px;} +.sectionWrap {float:left; max-height:150px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:220px; background-color:#f1f1f1; min-height:150px; padding-top:5px;} +.columnWrap {float:left; max-height:148px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:178px; background-color:#fffff; min-height:148px; padding-top:5px; border:1px solid #f1f1f1;} +.columnWrap li {padding-left:10px; color:#585858;} +.columnWrap span {width:150px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:inline-block;} +.sectionRow:hover {background-color:#cccccc; cursor:pointer;} +.sectionContent {display:none;} +.sectionContent li {padding-left:30px;} +.sectionContent li:hover {background-color:#cccccc; cursor:pointer;} +.sectionContent span {width:175px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:18px; vertical-align:middle;} \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d9f370c7d..f73f389ae 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -916,4 +916,17 @@ 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;} + +/*转发样式*/ +.shareDP {width:415px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; z-index:1000;} +.shareArrow {background:url(../images/arrowList.png) -90px -108px no-repeat; display:inline-block; width:5px; height:10px; margin-right:3px;} +.sectionWrap {float:left; max-height:150px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:220px; background-color:#f1f1f1; min-height:150px; padding-top:5px;} +.columnWrap {float:left; max-height:148px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:178px; background-color:#fffff; min-height:148px; padding-top:5px; border:1px solid #f1f1f1;} +.columnWrap li {padding-left:10px; color:#585858;} +.columnWrap span {width:150px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:inline-block;} +.sectionRow:hover {background-color:#cccccc; cursor:pointer;} +.sectionContent {display:none;} +.sectionContent li {padding-left:30px;} +.sectionContent li:hover {background-color:#cccccc; cursor:pointer;} +.sectionContent span {width:175px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:18px; vertical-align:middle;} \ No newline at end of file From 00711f11006eb79827da014157c83f44a9c732df Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 23 Dec 2015 16:12:23 +0800 Subject: [PATCH 014/230] =?UTF-8?q?issue=E7=BC=96=E8=BE=91=E3=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=82=AE=E4=BB=B6=E4=B8=AD=E5=8E=BB=E6=8E=89?= =?UTF-8?q?token?= 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 73d377d06d71cf6c626962b2fa7a53bc84310756 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 23 Dec 2015 16:49:05 +0800 Subject: [PATCH 015/230] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E6=98=BE=E7=A4=BA=E8=BD=AC=E5=8F=91=E7=9A=84?= =?UTF-8?q?=E5=B8=96=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 7 +++++++ app/controllers/org_subfields_controller.rb | 14 +++++++++++--- app/controllers/organizations_controller.rb | 2 +- app/models/org_subfield_message.rb | 3 +++ app/views/org_subfields/show.html.erb | 0 app/views/organizations/_org_activities.html.erb | 10 ++++++++++ .../20151223062932_create_org_subfield_messages.rb | 10 ++++++++++ spec/factories/org_subfield_messages.rb | 6 ++++++ spec/models/org_subfield_message_spec.rb | 5 +++++ 9 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 app/models/org_subfield_message.rb create mode 100644 app/views/org_subfields/show.html.erb create mode 100644 db/migrate/20151223062932_create_org_subfield_messages.rb create mode 100644 spec/factories/org_subfield_messages.rb create mode 100644 spec/models/org_subfield_message_spec.rb diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 957d77b8a..d5ce9e0eb 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -313,9 +313,16 @@ class MessagesController < ApplicationController def join_org_subfields org_subfield_ids = params[:org_subfields] @message = Message.find(params[:id]) + # @message.update_attribute(:updated_on, Time.now) type = @message.board.course_id.nil? ? "Project":"Course" org_subfield_ids.each do |field_id| OrgSubfieldMessage.create(:org_subfield_id => field_id.to_i, :message_id => @message.id, :message_type => type) + org_acts = OrgActivity.where("container_type='OrgSubfield' and container_id=? and org_act_type='Message' and org_act_id=?", field_id.to_i, @message.id) + if org_acts.all.size() > 0 + org_acts.first.update_attribute(:updated_at, Time.now) + else + OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'Message', :org_act_id => @message.id, :user_id => User.current.id) + end end end diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index 1dc7885fe..26e35fc16 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -6,6 +6,17 @@ class OrgSubfieldsController < ApplicationController @subfield.update_attributes(:priority => @subfield.id, :field_type => params[:field_type]) end + def show + @org_subfield = OrgSubfield.find(params[:id]) + @organization = @org_subfield.organization.id + @messages = [] + @messages << @org_subfield.org_document_comments + @messages << @org_subfield.messages + @messages.sort{|a, b| b.updated_at <=> a.updated_at} + respond_to do |format| + format.html{render :layout => 'base_org'} + end + end def destroy @subfield = OrgSubfield.find(params[:id]) @organization = Organization.find(@subfield.organization_id) @@ -18,7 +29,4 @@ class OrgSubfieldsController < ApplicationController @subfield.update_attributes(:name => params[:name]) end - def show - - end end diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 38402f68e..69437e87f 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -71,7 +71,7 @@ class OrganizationsController < ApplicationController if params[:org_subfield_id] @org_subfield = OrgSubfield.find(params[:org_subfield_id]) @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0 - @org_activities = OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})").order('updated_at desc').page(params[:page] || 1).per(10) + @org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10) else project_ids = @organization.projects.map(&:id) << 0 course_ids = @organization.courses.map(&:id) << 0 diff --git a/app/models/org_subfield_message.rb b/app/models/org_subfield_message.rb new file mode 100644 index 000000000..ba8778783 --- /dev/null +++ b/app/models/org_subfield_message.rb @@ -0,0 +1,3 @@ +class OrgSubfieldMessage < ActiveRecord::Base + # attr_accessible :title, :body +end diff --git a/app/views/org_subfields/show.html.erb b/app/views/org_subfields/show.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index 8bd1f5bbf..f9dfa8ea2 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -49,6 +49,16 @@ <%= render :partial => 'org_course_create', :locals => {:activity => Course.find(act.org_act_id), :user_activity_id => act.id} %> <% end %> <% end %> + <% if act.container_type == 'OrgSubfield' %> + <% if act.org_act_type == 'Message' %> + <% message = Message.find(act.org_act_id) %> + <% if !message.board.course_id.nil? %> + <%= render :partial => 'org_course_message', :locals => {:activity => message,:user_activity_id =>act.id} %> + <% else %> + <%= render :partial => 'organizations/project_message', :locals => {:activity => message,:user_activity_id =>act.id} %> + <% end %> + <% end %> + <% end %> <% end %> <%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> diff --git a/db/migrate/20151223062932_create_org_subfield_messages.rb b/db/migrate/20151223062932_create_org_subfield_messages.rb new file mode 100644 index 000000000..b5e4c2028 --- /dev/null +++ b/db/migrate/20151223062932_create_org_subfield_messages.rb @@ -0,0 +1,10 @@ +class CreateOrgSubfieldMessages < ActiveRecord::Migration + def change + create_table :org_subfield_messages do |t| + t.integer :org_subfield_id + t.integer :message_id + t.string :message_type + t.timestamps + end + end +end diff --git a/spec/factories/org_subfield_messages.rb b/spec/factories/org_subfield_messages.rb new file mode 100644 index 000000000..a3d6b391b --- /dev/null +++ b/spec/factories/org_subfield_messages.rb @@ -0,0 +1,6 @@ +FactoryGirl.define do + factory :org_subfield_message, :class => 'OrgSubfieldMessage' do + + end + +end diff --git a/spec/models/org_subfield_message_spec.rb b/spec/models/org_subfield_message_spec.rb new file mode 100644 index 000000000..806fa5ba9 --- /dev/null +++ b/spec/models/org_subfield_message_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe OrgSubfieldMessage, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end From 19f84b111b28c1ede77c51e34e11710563085eb0 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 23 Dec 2015 17:16:35 +0800 Subject: [PATCH 016/230] =?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 017/230] =?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 9e0b88c186d84c1bce17e706e5f158394fd87daa Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 24 Dec 2015 09:46:18 +0800 Subject: [PATCH 018/230] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E6=A0=B7=E5=BC=8F=E6=94=B9=E6=88=90=E6=96=B9=E5=9D=97?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_project_new_topic.html.erb | 72 +++- app/views/boards/_project_show.html.erb | 232 ++----------- .../boards/_project_show_detail.html.erb | 70 ++++ app/views/layouts/base_projects.html.erb | 2 +- app/views/messages/_form_project.html.erb | 64 +++- app/views/messages/_project_show.html.erb | 309 ++++++++++++------ app/views/users/_project_message.html.erb | 4 +- 7 files changed, 424 insertions(+), 329 deletions(-) create mode 100644 app/views/boards/_project_show_detail.html.erb diff --git a/app/views/boards/_project_new_topic.html.erb b/app/views/boards/_project_new_topic.html.erb index 00a3d2016..2259cc5bb 100644 --- a/app/views/boards/_project_new_topic.html.erb +++ b/app/views/boards/_project_new_topic.html.erb @@ -1,11 +1,65 @@ -<%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'},:html => {:nhname=>'form', :multipart => true, :id => 'message-form', :name=>'message-form'} do |f| %> +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true, prettify: false) %> +<% end %> - <%= render :partial => 'form_project', :locals => {:f => f, :topic => @message} %> -
  • -
    - <%= l(:button_cancel) %> +<%= error_messages_for 'message' %> +
    +
    +
    +
    + +

    +
    +
  • -<% end %> \ No newline at end of file + <%= f.kindeditor :content, :editor_id => 'message_content_editor', + :owner_id => topic.nil? ? 0: topic.id, + :owner_type => OwnerTypeHelper::MESSAGE, + :width => '100%', + :height => 300, + :minHeight=>300, + :class => 'talk_text fl', + :input_html => { :id => 'message_content', + :class => 'talk_text fl', + :maxlength => 5000 }, + at_id: topic.id, at_type: topic.class.to_s + %> +
    +

    + +
    +
    +
    + <%= render :partial => 'attachments/form_course', :locals => {:container => topic, :isReply => @isReply} %> +
    +
    +
    +
    + <%if !edit_mode %> + 确定 + + 取消 + <% else %> + 确定 + + <%= link_to "取消",board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "fr mr10 mt3"%> + <% end %> +
    +
    + + + + \ No newline at end of file diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index 839d587b2..8a11d2859 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -1,204 +1,44 @@ -
    -
    -

    - <% if User.current.language == "zh"%> - <%= h @board.name %> - <% else %> - <%= l(:project_module_boards) %> - <% end %> -

    - <% if User.current.logged? %> - <%= l(:label_message_new) %> - <% end %> -
    -
    - <% if !User.current.logged? %> -
    - <%= l(:label_user_login_project_board) %> - <%= link_to l(:label_user_login_new), signin_path, :class => "c_blue ml5" %> + + +
    +
    +
    + 项目讨论区
    - <% end %> -
    -
    -
    -
    -
    -

    讨论区共有<%= @topic_count %>个帖子

    - <% if @topics.any? %> - <% @topics.each do |topic| %> -
    - <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %> -
    - <% author = topic.author.to_s %> -
    - <%= link_to author, user_path(topic.author), :class =>"talkmain_name fl f14",:title=>author, - :style=>'max-width:80px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;' %> -
    -

      :

    - -

      <%= h(topic.subject) %>

    - - <% if topic.editable_by?(User.current) %> - <%= l(:button_edit) %> - <% end %> - <%= link_to(l(:button_delete), {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :class => 'talk_edit fr', - :style => ' margin-right: 10px;') if topic.destroyable_by?(User.current) %> - <% if topic.sticky? %> - <%= l(:label_board_sticky)%> - <% end %> - - -
    -
    -
    - <%= topic.content.html_safe %> - -
    -
    - - <%= link_to_attachments_course topic, :author => false %> - <%= l(:label_activity_time)%>:  <%= format_time topic.created_on %> -
    - <% if User.current.logged? %> - <%= l(:button_reply) %> - <% end %> -
    - -
    -
    - <% reply = Message.new(:subject => "RE: #{topic.subject}")%> - <% if !topic.locked? && authorize_for('messages', 'reply') %> - - <% end %> -
    - <% replies_all = topic.children.includes(:author, :attachments, {:board => :project}).reorder("#{Message.table_name}.id desc").all %> - <% unless replies_all.empty? %> -
    -
      - <% replies_all_i = 0 %> - <% replies_all.each do |message| %> - <% replies_all_i=replies_all_i+1 %> -
    • - <%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %> -
      - <%= link_to_user_header message.author,false,:class => 'fl c_orange f14 ' %> -
      -
      - <%= textAreailizable message,:content,:attachments => message.attachments %> - -
      - -
      - <%= format_time(message.created_on) %> - <%= link_to(l(:button_delete),{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:button_delete), - :class => ' c_dblue fr f14') if message.course_destroyable_by?(User.current) %> - <%= link_to(l(:button_reply), 'javascript:;', - :nhname =>'showbtn_child_reply', - :class => ' c_dblue fr f14', - :style => 'margin-right: 10px;', - :title => l(:button_reply)) if !topic.locked? && authorize_for('messages', 'reply') %> -
      -
      -
    • - <% end %> -
    -
    - <%if topic.replies_count>2 %> - - <% end %> - <% end %> -
    -
    + <% if User.current.logged? %> + <%= labelled_form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, + :html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %> + <%#= render :partial => 'project_new_topic', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %> + <%= render :partial => 'project_new_topic', :locals => {:f => f, :topic => @message, :edit_mode => false, :project => @board.project} %> <% end %> - <% else %> -

    <%= l(:label_no_data) %>

    - <% end %> -
      - <%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => false, :flag => true %> -
    - - -<%# other_formats_links do |f| %> - <%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> -<%# end %> - <% html_title @board.name %> - <% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %> <% end %> + <%= render :partial=> 'project_show_detail',:locals =>{:topics => @topics, :page => 0} %>
    -
    + + + + + + <% if topic %> + <%= render :partial => 'users/project_message', :locals => {:activity => topic,:user_activity_id =>topic.id} %> + <% end %> + <% end %> + + <% if topics.count == 10 %> +
    展开更多<%= link_to "", boards_topic_path(@board, :project_id => @board.project.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %>
    + <% end %> +<% end%> + + \ No newline at end of file diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index f7dcc40f5..433d30214 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -12,7 +12,7 @@ <%= favicon %> <%= javascript_heads %> <%= heads_for_theme %> - <%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header','repository' %> + <%= stylesheet_link_tag 'public', 'pleft', 'project','courses','prettify','jquery/jquery-ui-1.9.2','header','repository' %> <%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','attachments' %> <%= call_hook :view_layouts_base_html_head %> diff --git a/app/views/messages/_form_project.html.erb b/app/views/messages/_form_project.html.erb index bf91b3517..57d8a27c2 100644 --- a/app/views/messages/_form_project.html.erb +++ b/app/views/messages/_form_project.html.erb @@ -1,16 +1,23 @@ + +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> +<% end %> + <%= error_messages_for 'message' %> <% replying ||= false %> -<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %> +<% extra_option = replying ? { hidden: "hidden"} : { maxlength: 200 } %> +
  • - +
    <% if replying %> - <%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %> +
    <%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585 fl" }.merge(extra_option) %>
    <% else %> <%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %> +

    <% end %> -

    +
  • -
  • +
  • <% unless replying %> <% if @message.safe_attribute? 'sticky' %> <%= f.check_box :sticky %> @@ -24,20 +31,45 @@
  • -
    - +
    + <%= text_area :quote,:quote,:style => 'display:none' %> - <%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %> + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + <% if replying %> + <%= f.kindeditor :content, :editor_id => 'message_content_editor', + :width => '99%', + :height => 100, + :minHeight=>100, + :input_html => { :id => 'message_content', + :class => 'talk_text fl', + :maxlength => 5000 }%> + <% else %> + <%= f.kindeditor :content, :editor_id => 'message_content_editor', + :owner_id => @message.nil? ? 0: @message.id, + :owner_type => OwnerTypeHelper::MESSAGE, + :width => '90%', + :height => 300, + :minHeight=>300, + :class => 'talk_text fl', + :input_html => { :id => 'message_content', + :class => 'talk_text fl', + :maxlength => 5000 }%> + <% end %>
    -

    +

  • -
  • - -
    - <%= render :partial => 'attachments/form_project', :locals => {:container => @message,:isReply => @isReply} %> -
    -
  • +<% unless replying %> +
  • + +
    + <%= render :partial => 'attachments/form_project', :locals => {:container => @message,:isReply => @isReply} %> +
    +
  • +<% end %>
  • -
  • \ No newline at end of file + diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index 28b9e28d5..b20a7c22d 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -1,104 +1,3 @@ -
    -

    <%= h @board.name %>

    -
    -
    -
    - <%=link_to image_tag(url_to_avatar(@topic.author), :width => "46", :height => "46"), user_path(@topic.author) %> -
    -
    -

    - <%= @topic.subject %>

    -
    -

    由<%= link_to_user_header @topic.author,false,:class=> 'problem_name c_orange' %> 添加于<%= format_time(@topic.created_on) %>

    -
    - - <%#= watcher_link(@topic, User.current) %> - <%= link_to( - l(:button_edit), - {:action => 'edit', :id => @topic}, - :class => 'talk_edit fr' - ) if @message.editable_by?(User.current) %> - <%= link_to( - l(:button_delete), - {:action => 'destroy', :id => @topic}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :class => 'talk_edit fr' - ) if @message.destroyable_by?(User.current) %> -
    -
    <%= textilizable(@topic, :content) %>
    -
    <%= link_to_attachment_project @topic, :author => false %>
    - -
    - <% if User.current.logged? %> - <%= toggle_link l(:button_reply), "reply", :focus => 'message_content',:class => 'talk_edit fr' %> - <% else %> - <%= link_to l(:button_reply), signin_path,:class => 'talk_edit fr' %> - <% end %> - <%= link_to( - l(:button_quote), - {:action => 'quote', :id => @topic}, - :remote => true, - :method => 'get', - :class => 'talk_edit fr', - :remote => true) if !@topic.locked? && authorize_for('messages', 'reply') %> -
    -
    -<% unless @replies.empty? %> - <% reply_count = 0 %> - <% @replies.each do |message| %> -
    "> -
    <%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %>
    -
    -
    - <%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %> - <%= format_time(message.created_on) %> -
    -

    <%= textAreailizable message,:content,:attachments => message.attachments %>

    - <%= link_to_attachments_course message, :author => false %> -
    -
    - <%= link_to( - l(:button_quote), - {:action => 'quote', :id => message}, - :remote => true, - :method => 'get', - :title => l(:button_quote)) if !@topic.locked? && authorize_for('messages', 'reply') %> - <%= link_to( - #image_tag('edit.png'), - l(:button_edit), - {:action => 'edit', :id => message}, - :title => l(:button_edit) - ) if message.course_editable_by?(User.current) %> - <%= link_to( - #image_tag('delete.png'), - l(:button_delete), - {:action => 'destroy', :id => message}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:button_delete) - ) if message.course_destroyable_by?(User.current) %> -
    -
    -
    -
    -
    - <% end %> -<% end %> -<% if !@topic.locked? && authorize_for('messages', 'reply') %> - -<% end %> -
      - <%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false, :remote => false, :flag => true%> -
    -<% html_title @topic.subject %> \ No newline at end of file + + + + +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> +<% end %> + + + + +
    +
    +
    + <%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %> +
    +
    + <% if @topic.author.id == User.current.id%> + + <%end%> + +
    + +
    + <% if @topic.try(:author).try(:realname) == ' ' %> + <%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% else %> + <%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% end %> +
    +
    <%= format_time( @topic.created_on)%>
    +
    +
    + <%= @topic.content.html_safe%> +
    +
    +
    + <%= link_to_attachments_course @topic, :author => false %> +
    +
    +
    +
    +
    +
    + <% unless @replies.empty? %> +
    +
    回复(<%=@reply_count %>)
    +
    + +
    +
    + <% @replies.each_with_index do |reply,i| %> + +
    +
    + <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> +
    +
    +
    + <% if reply.try(:author).try(:realname) == ' ' %> + <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% end %> +
    +
    + <%= reply.content.html_safe%> +
    +
    + <%= format_time(reply.created_on) %> + +
    +

    +
    +
    +
    + <% end %> +
    + + <% end %> +
    + <% if !@topic.locked? && authorize_for('messages', 'reply') %> +
    + +
    +
    + <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %> + <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %> + <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'project_board_cancel_message_replay();', :class => "blue_btn grey_btn fr c_white mt10 mr5" %> + <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'project_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %> + <% end %> +
    +
    +
    + <% end %> +
    +
    \ No newline at end of file diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 14c37096e..96d74d82f 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -16,10 +16,10 @@
    <% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey" + <%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" %> <% else %> - <%= link_to activity.parent.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey" + <%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" %> <% end %>
    From eb7d0761cb5c8b81be42296b762e15d7cd527c88 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 24 Dec 2015 10:37:13 +0800 Subject: [PATCH 019/230] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=A0=8F=E4=BF=AE=E6=94=B9=E6=88=90=E5=92=8C=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=9B=B8=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org.html.erb | 27 ++--- public/stylesheets/org.css | 175 ++++++++++++++-------------- 2 files changed, 99 insertions(+), 103 deletions(-) diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 93af3fd29..e17562ecc 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -46,13 +46,13 @@ - + <% else %> @@ -197,19 +197,14 @@ } } $(document).ready(function(){ - $("#orgUser,#orgSwitch").click(function(){ - $(".org_login_list").toggle(); - if($("#orgArrow").attr("class") == "orgMenuArrow"){ - $("#orgArrow").attr("class","orgMenuArrow2"); - } - else { - $("#orgArrow").attr("class","orgMenuArrow") ; - } - }); - if($(".org_login_list").children().click){ - $(".org_login_list").css("display","none"); - $("#orgArrow").attr("class","orgMenuArrow"); - }; + $("#orgUser,#orgSwitch,.org_login_list").mouseover(function () { + $(".org_login_list").css("display", "block"); + $("#orgArrow").attr("class", "orgMenuArrow2"); + }); + $("#orgUser,#orgSwitch,.org_login_list").mouseout(function () { + $(".org_login_list").css("display", "none"); + $("#orgArrow").attr("class", "orgMenuArrow"); + }); }); diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 44dcc70e3..e425d12c9 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -1,88 +1,89 @@ -@charset "utf-8"; -/* CSS Document */ - -.orgName {width:130px; color:#484848;} -.organization_r_h02{ width:980px; height:40px; background:#eaeaea; margin-bottom:10px;} -.organization_h2{ background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;} - -.orgSettingOp {width:45px; height:21px; color:#269ac9; text-align:center; border-bottom:3px solid #e4e4e4; float:left; font-weight:bold; cursor:pointer;} -.orgBorder {width:628px; height:21px; border-bottom:3px solid #e4e4e4; float:left;} -.orgOpActive {border-bottom:3px solid #269ac9 !important; color:#444444;} -.logoBorder {border:1px solid #eaeaea; padding:2px;} -.logoBorder:hover {border:1px solid #269ac9;} -.logoEnter {border:1px solid #eaeaea; padding:2px 5px; margin-top:37px;} -.orgNameInput {width:600px; outline:none; border:1px solid #eaeaea; float:right; height:22px;} -.orgRow {font-size:14px; color:#484848;} -.orgDes {width:600px; height:150px; outline:none; border:1px solid #eaeaea; float:right; resize:none;} -.w607 {width:607px;} -.orgUrlInput {width:200px; outline:none; border:1px solid #eaeaea; height:22px;} -a.saveBtn {padding:3px 5px; background-color:#269ac9; color:#ffffff;} -a.saveBtn:hover {background-color:#297fb8;} -.orgMemberList {width:410px; float:left;} -.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px;} -.orgListUser {width:119px; float:left;} -.orgListRole {width:180px; float:left;} -.orgMemContainer {width:278px;} -.orgMemberAdd {float:right; width:240px;} -.orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;} -.undis {display:none;} -.dis {display:inline-block;} -.upbtn { margin: 40px 0px 0px 15px; - display: block; - padding: 2px 5px; - border: 1px solid #EAEAEA;} - -a.org_member_btn{ padding:1px 5px; background:#15bccf; color:#fff;} - -/*项目关联css*/ -.relateOrg {width:335px;} -.relatedList {width:335px;} -.searchOrg {height:24px; width:200px; color:#9b9b9b; border:1px solid #15bccf;} -a.cancelBtn {padding:3px 5px; background-color:#D9D9D9; color:#656565;} -a.cancelBtn:hover {background-color:#717171; color:#ffffff;} -.relatedList ul li {border-bottom:1px solid #e4e4e4; width:320px; height:22px; vertical-align:middle; line-height:22px;} -.relatedListName {width:240px; text-align:left; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;} -.relatedListOption {width:80px; text-align:center;} -.relateOrgName {width:240px; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;color:#656565;} -.search_org {width:150px; max-width:200px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;color:#656565;} - -/*组织列表*/ -.mt28 {margin-top:28px;} -.orgWrap {width:880px; float:left;} -.orgTitle {width:880px; max-width:880px; margin-bottom:5px;word-break: break-all; word-wrap:break-word; } -.orgIntro {width:880px; max-width:880px; margin-bottom:6px; color:#484848;} - -/*关联项目弹窗*/ -.projectRelate {float:left; max-height:118px;margin-right:16px;margin-bottom:10px; overflow:auto; overflow-x:hidden; width:288px;} -.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;} - -/*组织首页新151204Tim*/ -.orgNav {width:1000px; height:30px; background-color:#cfcfcf; margin:0 auto;} -.orgContainer {width:100%; margin:0 auto; background-color:#cfcfcf;} -.navOrgLogo {width:21px; height:30px; margin-left:2px; margin-right:15px;} -.navOrgMenu {display:inline-block;height:30px; line-height:30px; vertical-align:middle;} -a.linkGrey8 {color:#888888;} -a.linkGrey8:hover {color:#585858;} -.orgBorder {width:583px; height:21px; border-bottom:3px solid #e4e4e4; float:left;} -.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px; color:#555555;} -.orgMenuArrow {background:url(../images/nav_icon.png) -10px -165px no-repeat; position:relative; display:inline-block; width:20px; height:30px;} -.orgMenuArrow2 {background:url(../images/nav_icon.png) -10px -132px no-repeat; position:relative; display:inline-block; width:20px; height:30px;} -.org_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-53px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 30px;} -#orgUserName {max-width:50px; overflow:hidden; white-space: nowrap; text-overflow: ellipsis; display:inline-block;} - -.orgListStatus {width:55px; float:left;} -.reCon{ margin:5px; width:710px;} -.retop{width:710px; height:40px; background:#eaeaea; padding:5px;} -.resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right} -.re_search{ margin-top:7px; margin-left:5px;} -.re_search{ margin-top:7px; margin-left:5px;} -.re_schbox{ width:240px; height:24px; border:1px solid #64bdd9; color:#666666;} -.re_schbtn{ width:60px; height:26px; color:#fff; margin-right:5px; border:none; margin-left:0px;padding-left: 0px;} -.b_lblue{ background:#64bdd9;} -.c_grey{ color:#888888;} -.re_con{ margin:5px; width:665px;} -.re_con_top{color:#494949; } -.re_con_top span{ color:#999999; font-weight:bold;} -ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } - +@charset "utf-8"; +/* CSS Document */ + +.orgName {width:130px; color:#484848;} +.organization_r_h02{ width:980px; height:40px; background:#eaeaea; margin-bottom:10px;} +.organization_h2{ background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;} + +.orgSettingOp {width:45px; height:21px; color:#269ac9; text-align:center; border-bottom:3px solid #e4e4e4; float:left; font-weight:bold; cursor:pointer;} +.orgBorder {width:628px; height:21px; border-bottom:3px solid #e4e4e4; float:left;} +.orgOpActive {border-bottom:3px solid #269ac9 !important; color:#444444;} +.logoBorder {border:1px solid #eaeaea; padding:2px;} +.logoBorder:hover {border:1px solid #269ac9;} +.logoEnter {border:1px solid #eaeaea; padding:2px 5px; margin-top:37px;} +.orgNameInput {width:600px; outline:none; border:1px solid #eaeaea; float:right; height:22px;} +.orgRow {font-size:14px; color:#484848;} +.orgDes {width:600px; height:150px; outline:none; border:1px solid #eaeaea; float:right; resize:none;} +.w607 {width:607px;} +.orgUrlInput {width:200px; outline:none; border:1px solid #eaeaea; height:22px;} +a.saveBtn {padding:3px 5px; background-color:#269ac9; color:#ffffff;} +a.saveBtn:hover {background-color:#297fb8;} +.orgMemberList {width:410px; float:left;} +.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px;} +.orgListUser {width:119px; float:left;} +.orgListRole {width:180px; float:left;} +.orgMemContainer {width:278px;} +.orgMemberAdd {float:right; width:240px;} +.orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;} +.undis {display:none;} +.dis {display:inline-block;} +.upbtn { margin: 40px 0px 0px 15px; + display: block; + padding: 2px 5px; + border: 1px solid #EAEAEA;} + +a.org_member_btn{ padding:1px 5px; background:#15bccf; color:#fff;} + +/*项目关联css*/ +.relateOrg {width:335px;} +.relatedList {width:335px;} +.searchOrg {height:24px; width:200px; color:#9b9b9b; border:1px solid #15bccf;} +a.cancelBtn {padding:3px 5px; background-color:#D9D9D9; color:#656565;} +a.cancelBtn:hover {background-color:#717171; color:#ffffff;} +.relatedList ul li {border-bottom:1px solid #e4e4e4; width:320px; height:22px; vertical-align:middle; line-height:22px;} +.relatedListName {width:240px; text-align:left; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;} +.relatedListOption {width:80px; text-align:center;} +.relateOrgName {width:240px; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;color:#656565;} +.search_org {width:150px; max-width:200px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;color:#656565;} + +/*组织列表*/ +.mt28 {margin-top:28px;} +.orgWrap {width:880px; float:left;} +.orgTitle {width:880px; max-width:880px; margin-bottom:5px;word-break: break-all; word-wrap:break-word; } +.orgIntro {width:880px; max-width:880px; margin-bottom:6px; color:#484848;} + +/*关联项目弹窗*/ +.projectRelate {float:left; max-height:118px;margin-right:16px;margin-bottom:10px; overflow:auto; overflow-x:hidden; width:288px;} +.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;} + +/*组织首页新151204Tim*/ +.orgNav {width:1000px; height:30px; background-color:#cfcfcf; margin:0 auto;} +.orgContainer {width:100%; margin:0 auto; background-color:#cfcfcf;} +.navOrgLogo {width:21px; height:30px; margin-left:2px; margin-right:15px;} +.navOrgMenu {display:inline-block;height:30px; line-height:30px; vertical-align:middle;} +a.linkGrey8 {color:#888888;} +a.linkGrey8:hover {color:#585858;} +.orgBorder {width:583px; height:21px; border-bottom:3px solid #e4e4e4; float:left;} +.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px; color:#555555;} +.orgMenuArrow {background:url(../images/nav_icon.png) -10px -165px no-repeat; position:relative; display:inline-block; width:20px; height:30px;} +.orgMenuArrow2 {background:url(../images/nav_icon.png) -10px -132px no-repeat; position:relative; display:inline-block; width:20px; height:30px;} +.org_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-53px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 30px;} +#orgUserName {max-width:50px; overflow:hidden; white-space: nowrap; text-overflow: ellipsis; display:inline-block;} +.org_login_list a {color:#269ac9;} + +.orgListStatus {width:55px; float:left;} +.reCon{ margin:5px; width:710px;} +.retop{width:710px; height:40px; background:#eaeaea; padding:5px;} +.resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right} +.re_search{ margin-top:7px; margin-left:5px;} +.re_search{ margin-top:7px; margin-left:5px;} +.re_schbox{ width:240px; height:24px; border:1px solid #64bdd9; color:#666666;} +.re_schbtn{ width:60px; height:26px; color:#fff; margin-right:5px; border:none; margin-left:0px;padding-left: 0px;} +.b_lblue{ background:#64bdd9;} +.c_grey{ color:#888888;} +.re_con{ margin:5px; width:665px;} +.re_con_top{color:#494949; } +.re_con_top span{ color:#999999; font-weight:bold;} +ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } + .popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} \ No newline at end of file From 59f42bb54fcd95608091ea90275a7ecf97928191 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 24 Dec 2015 11:09:57 +0800 Subject: [PATCH 020/230] =?UTF-8?q?1.=E5=B0=86=E6=B7=BB=E5=8A=A0=E9=99=84?= =?UTF-8?q?=E5=8A=A0=E5=8A=9F=E8=83=BD=E5=8A=A0=E5=85=A5=E5=88=B0=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E5=88=97=E8=A1=A8=E4=B8=AD=E7=9A=84=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=87=E7=AB=A0=EF=BC=9B=202.=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E7=BC=96=E8=BE=91=E6=96=87=E7=AB=A0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=B8=8A=E4=BC=A0=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_document_comments_controller.rb | 5 ++++- app/views/attachments/_form_course.html.erb | 3 +-- app/views/org_document_comments/_attachment.html.erb | 2 +- app/views/org_document_comments/_new.html.erb | 8 ++++++-- app/views/organizations/_project_message.html.erb | 4 ++-- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index 67d3b247a..7685b77a8 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -28,6 +28,7 @@ class OrgDocumentCommentsController < ApplicationController redirect_to new_org_document_comment_path(:organization_id => @organization.id) end end + def show @document = OrgDocumentComment.find(params[:id]) end @@ -39,10 +40,12 @@ class OrgDocumentCommentsController < ApplicationController render_403 end end + def update @org_document = OrgDocumentComment.find(params[:id]) @org_document.update_attributes(:title => params[:org_document_comment][:title], :content => params[:org_document_comment][:content]) - @org_document.save_attachments(params[:attachments]) + Attachment.attach_files(@org_document, params[:attachments]) + # @org_document.save_attachments(params[:attachments]) if @org_document.parent.nil? act = OrgActivity.where("org_act_type='OrgDocumentComment' and org_act_id =?", @org_document.id).first act.update_attributes(:updated_at => @org_document.updated_at) diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index ef5385647..348c5339d 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -61,8 +61,7 @@ :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), :delete_all_files => l(:text_are_you_sure_all), - :lebel_file_uploding => l(:lebel_file_uploding), - :containerid => "#{container.id}" + :lebel_file_uploding => l(:lebel_file_uploding) } %> <% if container.nil? %> <%= l(:label_no_file_uploaded)%> diff --git a/app/views/org_document_comments/_attachment.html.erb b/app/views/org_document_comments/_attachment.html.erb index 86298a330..5cdcfa041 100644 --- a/app/views/org_document_comments/_attachment.html.erb +++ b/app/views/org_document_comments/_attachment.html.erb @@ -63,7 +63,7 @@ :are_you_sure => l(:text_are_you_sure), :file_count => l(:label_file_count), :lebel_file_uploding => l(:lebel_file_uploding), - :delete_all_files => l(:text_are_you_sure_all) + :containerid => "#{container.id}" } %> <%= l(:label_no_file_uploaded) %> diff --git a/app/views/org_document_comments/_new.html.erb b/app/views/org_document_comments/_new.html.erb index 8d9eb6b02..3d8e8bc23 100644 --- a/app/views/org_document_comments/_new.html.erb +++ b/app/views/org_document_comments/_new.html.erb @@ -45,10 +45,14 @@
    -

    - +
    +
    + <%= render :partial => 'org_document_comments/attachment', :locals => {:container => nil} %> +
    +
    +
    确定 diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index 2708bb546..037dfe61b 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -16,10 +16,10 @@
    <% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey" + <%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" %> <% else %> - <%= link_to activity.parent.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey" + <%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey" %> <% end %>
    From 7d7d9b77b53ca1a172dd5473e52e1387b69a2e7e Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 24 Dec 2015 11:58:00 +0800 Subject: [PATCH 021/230] =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=A0=B7=E5=BC=8F=E6=94=B9=E6=88=90=E6=96=B9?= =?UTF-8?q?=E5=9D=97=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../boards/_project_message_edit.html.erb | 16 ++++++++++++++ app/views/messages/edit.html.erb | 21 +++++-------------- 2 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 app/views/boards/_project_message_edit.html.erb diff --git a/app/views/boards/_project_message_edit.html.erb b/app/views/boards/_project_message_edit.html.erb new file mode 100644 index 000000000..88297bd79 --- /dev/null +++ b/app/views/boards/_project_message_edit.html.erb @@ -0,0 +1,16 @@ + +
    +
    +
    + 编辑帖子 +
    +
    + <%= render :partial => 'boards/project_new_topic', + :locals => {:f => f, :edit_mode => edit_mode, :topic => topic, :project => project} %> +
    \ No newline at end of file diff --git a/app/views/messages/edit.html.erb b/app/views/messages/edit.html.erb index 624174b14..7543e16e2 100644 --- a/app/views/messages/edit.html.erb +++ b/app/views/messages/edit.html.erb @@ -1,26 +1,16 @@ <% if @message.project %> -
    -

    <%= l(:label_course_board) %>

    -
    - - - <%#= board_breadcrumb(@message) %> - -
    -
      <%= form_for @message, {:as => :message, :url => {:action => 'edit'}, :html => {:multipart => true, :id => 'message-form', :method => :post} } do |f| %> - <%= render :partial => 'form_project', - :locals => {:f => f, :replying => !@message.parent.nil?} %> - <%= l(:button_submit) %> - <%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "blue_btn grey_btn fl c_white" %> -
    -
    + <%= render :partial => 'boards/project_message_edit', + :locals => {:f => f, :edit_mode => true, :topic => @message, :project => @message.project} %> + + <%#= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "blue_btn grey_btn fl c_white" %> <% end %> + <% elsif @message.course %> <%= form_for @message, { :as => :message, @@ -31,7 +21,6 @@ } do |f| %> <%= render :partial => 'boards/course_message_edit', :locals => {:f => f, :edit_mode => true, :topic => @message, :course => @message.course} %> - <% end %> <% end %> From 7d35931460e9aa9c4a719dc1d9550d768621c0e9 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 24 Dec 2015 15:27:49 +0800 Subject: [PATCH 022/230] =?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 023/230] =?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 024/230] 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 1a24505eac99ed6c421bc924412c7e8390497ea7 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 25 Dec 2015 15:27:45 +0800 Subject: [PATCH 025/230] =?UTF-8?q?footer=E6=96=B0=E5=A2=9E=E5=9B=BE?= =?UTF-8?q?=E7=89=87=EF=BC=8C=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_footer.html.erb | 80 +++++++++--------- app/views/layouts/base_org.html.erb | 17 +--- .../images/footer_logo/BeiHang_university.png | Bin 0 -> 8096 bytes public/images/footer_logo/CVICSE.png | Bin 0 -> 9688 bytes public/images/footer_logo/ISCAS_logo.png | Bin 0 -> 7948 bytes .../images/footer_logo/PekingUniversity.png | Bin 0 -> 9854 bytes public/images/footer_logo/bee_logo.png | Bin 0 -> 7265 bytes public/stylesheets/new_user.css | 3 +- public/stylesheets/public.css | 2 +- 9 files changed, 46 insertions(+), 56 deletions(-) create mode 100644 public/images/footer_logo/BeiHang_university.png create mode 100644 public/images/footer_logo/CVICSE.png create mode 100644 public/images/footer_logo/ISCAS_logo.png create mode 100644 public/images/footer_logo/PekingUniversity.png create mode 100644 public/images/footer_logo/bee_logo.png diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index 13730fd96..1db3091d7 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -1,39 +1,43 @@ - + <% if !edit_mode || edit_mode && homework.homework_detail_manual.comment_status < 2 %> +
    + + 启用匿评 +
    + <% end %>

    @@ -68,12 +86,12 @@
    <% if edit_mode %> - 确定 + 确定 <%#= link_to "取消",user_homeworks_user_path(User.current.id),:class => "fr mr10 mt3"%> 取消 <% else %> - 发送 + 发送 取消 <% end %> From 7412c1caf63257632a601b62f622543368b0c015 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 25 Dec 2015 16:04:49 +0800 Subject: [PATCH 028/230] =?UTF-8?q?=E6=B7=BB=E5=8A=A0footer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_footer.html.erb | 28 ++++++++++++++++------------ app/views/layouts/base_org.html.erb | 17 +---------------- lib/tasks/hjq_test.rake | 18 ------------------ 3 files changed, 17 insertions(+), 46 deletions(-) delete mode 100644 lib/tasks/hjq_test.rake diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index 13730fd96..fca343af4 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -12,24 +12,28 @@
    - - + + <% else %> @@ -75,126 +75,121 @@
    -
    -
    -
    -
    - - - -