From 2220e0b7cc315aaab6c446c642bc42a010f4d0e7 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 22 Dec 2015 15:48:41 +0800 Subject: [PATCH 01/13] =?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 9dc2cb8541c5c2e0ec4fce897c98c7f97afbf967 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 23 Dec 2015 10:40:50 +0800 Subject: [PATCH 02/13] =?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 b9ae579622e024060f7f3fb3891a7b3e70ba86b1 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 23 Dec 2015 15:35:26 +0800 Subject: [PATCH 03/13] =?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 73d377d06d71cf6c626962b2fa7a53bc84310756 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 23 Dec 2015 16:49:05 +0800 Subject: [PATCH 04/13] =?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 9e0b88c186d84c1bce17e706e5f158394fd87daa Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 24 Dec 2015 09:46:18 +0800 Subject: [PATCH 05/13] =?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 06/13] =?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 07/13] =?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 08/13] =?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 1a24505eac99ed6c421bc924412c7e8390497ea7 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 25 Dec 2015 15:27:45 +0800 Subject: [PATCH 09/13] =?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 @@ - diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index b20a7c22d..9468e05ce 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -118,7 +118,7 @@ :data => {:confirm => l(:text_are_you_sure)}, :class => 'postOptionLink' ) if @message.destroyable_by?(User.current) %> - <%= link_to "转发",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %> + <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %> diff --git a/app/views/messages/_show_org_subfields.html.erb b/app/views/messages/_show_org_subfields.html.erb index 78e8a4c92..659e1230e 100644 --- a/app/views/messages/_show_org_subfields.html.erb +++ b/app/views/messages/_show_org_subfields.html.erb @@ -1,4 +1,4 @@ -
      +
        <% if !org.nil? %> 组织:<%= org.name %> @@ -8,6 +8,6 @@ <% end %> <% else %> - 请在左侧选择要转发的位置 + 请在左侧选择组织 <% end %>
      \ No newline at end of file diff --git a/public/images/arrowList.png b/public/images/arrowList.png index 99dcfc0f572cacd8984e7155be7e9e5cc4e4a5ca..8385a6a7da9095de90199592ec6ab78af4df9c87 100644 GIT binary patch literal 1336 zcmeAS@N?(olHy`uVBq!ia0vp^sX$!8!3HE>o7i*#DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg49rTIArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6$OdO*{LN8 zNvY|XdA3ULckfqH$V{%1*XSQL?vFu&J;D8jzb> zlBiITo0C^;Rbi_HHrEQs1_|pcDS(xfWZNo192Makpx~Tel&WB=XRMoSU}&gdW~OIo zVrph)sH0$HU}&Uo07PcGh9*{~W>!Y#3Q(W~w5=#5%__*n4QdyVXRDM^Qc_^0uU}qX zu2*iXmtT~wZ)j<02{OaTNEfI=x41H|B(Xv_uUHvof=g;~a#3bMNoIbY0?5R~r2Ntn zTP2`NAzsKWfE$}v3=Jk=fazBx7U&!58GyV5Q|Rl9UukYGTy=3tP%6T`SPd=?sVqp< z4@xc0FD*(2MqHXQ$f^P>=c3falKi5O{QMkPCbvwy<<^cC@f?HZ*iKb+m9YcQG(BaCJ5| zb2WE1gz0t3PcF?(%`1WFO+n~&!KoLN6mkoIHoK%2WtOF;xE1B+DuBIgm5JLejyTPO z>P^Az7AKr~^?{Dj2SqGWM8kxDsRzV_CtDx~p72xifT_I*n5=(_@Fg-ZFs|`*aSW-r z_2%|o-@^_P4G(1&End!U$Y8yJF+{MV&!-*?bzuv~D#jkedE!q`T$hF|l?Q8k(tu%NKJFFC7^J+B+aC=dhZta-K!Q$1b zu=B~Yi?v+~90Wx)nwVSzSXjHNqE+~JMzu8tDe_F=N?g!$an0umt5pRwM4O)2JSm#5 zqybU{(%{$#Wpi*r*dhL_{Tw&e-8P%DX3D3xM{T~=ls|l)Jtr@TFZtd6nmW1SpP46b z^n~weo^g4`+8L{7+}wWOP-C%4eYELp`+qwf3O#jjo6X`Huz`)sn@f-AxIy!Xg& z7TnxmR44g3<;nPnqof_oXTz1(R8f?cjp<$-aUb*+&*~JUC d+}zB-%&^?SXWEuI-`qfDnWw9t%Q~loCIA9O$(#TH literal 518 zcmeAS@N?(olHy`uVBq!ia0vp^sX$!8!3HE>o7i*#Db50q$YKTtZeb8+WSBKa0w}1E z>=ES4z)+>iz|hdl!0_`wkbcR)P-?)y@G60U!DPH`dQ==QbYZR0jzS=0gsVi#Oj?yFSff0S`xz+0He=P=y+8 z3}6i!O-!yZ%^FfGYn?Yl{I@nUnW=gD`@UUwKi+S>eckHs3cuCy{B{4MYImEb${dT{ zGx=5V*Im0-os+wJe8HMaKku%wtornj>8SQbkP}c$Y(jRLl1B8KJ-Zr>{M4@&mPW)n zMecw6D!87%JiKuFdJ&w0uC%*S!fT8wEzE^83O(|&G1-YYzX8sc)I$ztaD0e0swTs!L9%R diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 99c5168d9..42186ed36 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -5,7 +5,7 @@ body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; div,img,tr,td,table{ border:0;} table,tr,td{border:0;cellspacing:0; cellpadding:0;} ol,ul,li{ list-style-type:none} -a:link,a:visited{color:#7f7f7f;text-decoration:none;} +a:link,a:visited{color:#7f7f7f !important;text-decoration:none;} a:hover,a:active{color:#000;} a:hover {text-decoration: none; } textarea {resize: none;} @@ -119,6 +119,7 @@ h4{ font-size:14px; color:#3b3b3b;} .mb8 {margin-bottom:8px;} .mb10{ margin-bottom:10px !important;} .mb20{ margin-bottom:20px;} +.pl10 {padding-left:10px;} .pl15{ padding-left:15px;} .pl5{ padding-left:5px;} .pt5{ padding-top:5px;} @@ -408,7 +409,7 @@ a:hover.search_btn{ background: #0fa9bb;} /*发送资源弹窗*/ /*.resourceShareContainer {width:100%; height:100%; background:#666; filter:alpha(opacity=50); opacity:0.5; -moz-opacity:0.5; position:absolute; left:0; top:0; z-index:-999;}*/ -.resourceSharePopup {width:300px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-150px; z-index:1000;} +.resourceSharePopup {width:300px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-150px; z-index:1000;} .sendText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:100px; display:inline-block; font-weight:bold;} .resourcesSendTo {float:left; height:20px; margin-top:15px;} .resourcesSendType {border:1px solid #e6e6e6; width:60px; height:24px; outline:none; font-size:14px; color:#888888;} @@ -424,7 +425,7 @@ a:hover.search_btn{ background: #0fa9bb;} .courseSendCancel {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#c1c1c1; float:left} .courseSendCancel:hover {background-color:#717171;} .courseReferContainer {float:left; max-height:120px; overflow:scroll; overflow-x:hidden; margin-right:16px; margin-bottom:10px;} -a.sendSourceText {font-size:14px; color:#ffffff; display:block;} +a.sendSourceText {font-size:14px; color:#ffffff !important; display:block;} /*上传资源弹窗*/ .resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;} @@ -926,7 +927,7 @@ span.at {color:#269ac9;} .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 {display:block;} .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 5334a3d40f24bc3678ca66fd2bd39f8088185175 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 28 Dec 2015 17:14:15 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E9=93=BE=E6=8E=A5=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/public.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 42186ed36..51f0be25d 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -5,7 +5,7 @@ body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; div,img,tr,td,table{ border:0;} table,tr,td{border:0;cellspacing:0; cellpadding:0;} ol,ul,li{ list-style-type:none} -a:link,a:visited{color:#7f7f7f !important;text-decoration:none;} +a:link,a:visited{color:#7f7f7f;text-decoration:none;} a:hover,a:active{color:#000;} a:hover {text-decoration: none; } textarea {resize: none;} From 0d98dba25c524031953c7be8126aa271501b3f20 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 29 Dec 2015 09:53:44 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=B8=96=E5=AD=90=E4=B8=AD=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=8F=96=E6=B6=88=E6=8C=89=E9=92=AE=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=8F=8D=E5=BA=94=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_project_show.html.erb | 4 ++-- db/schema.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index 8a11d2859..4b8101cf7 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -6,8 +6,8 @@ function reset_topic(){ $("#message_subject").val(""); $("#subjectmsg").text(""); - document.getElementById("message_sticky").checked=false; - document.getElementById("message_locked").checked=false; +// document.getElementById("message_sticky").checked=false; +// document.getElementById("message_locked").checked=false; $("#topic_attachments").html("<%= escape_javascript(render :partial => 'attachments/form_course', :locals => {:container => Message.new, :isReply => @isReply})%>"); message_content_editor.html(""); $("#topic_editor").toggle(); diff --git a/db/schema.rb b/db/schema.rb index 6448833c6..fab2d5700 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 => 20151223062932) do +ActiveRecord::Schema.define(:version => 20151224090313) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false