From 2e561de52500f7e1ddddea2d757d2e15a604c42f Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 31 Jul 2015 16:32:55 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=86=85=E9=83=A8?= =?UTF-8?q?=E7=9A=84=E7=BC=96=E5=8F=B7#2264=E4=B9=9F=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=EF=BC=9A=E5=85=B6=E5=AE=9E=E9=99=85=E7=9A=84?= =?UTF-8?q?id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 8c12d62e0..b72558de4 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -2,11 +2,11 @@

<%= l(:label_issue_edit) %>

-<% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.subject}" %> +<% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.id}" %>
<%= link_to "#{@issue.project.name}"+">", project_issues_path(@issue.project) %> - <%= "#" + @issue.project_index %> + <%= "#" + @issue.id.to_s %>
From f099611d7ae1d9fecbbb55072c5cef3be834d69f Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 25 Jan 2016 11:25:43 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=B7=9F=E8=B8=AA?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../users/_project_issue_detail.html.erb | 228 +++++++++--------- 1 file changed, 114 insertions(+), 114 deletions(-) diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb index b682a74ea..774d92cb9 100644 --- a/app/views/users/_project_issue_detail.html.erb +++ b/app/views/users/_project_issue_detail.html.erb @@ -1,115 +1,115 @@ - -
-
-
    - <%#= labelled_fields_for :issue, @issue do |f| %> - <%#= f.select :status_id, ([["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0])), - {:include_blank => false, :selected => @status_id ? @status_id : 0 }, - {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} %> - <%# end %> - <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %> -
  • -

     状态  : 

    -

    <%= activity.status.name %>

    - <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), - {:include_blank => false, :selected => @status_id ? @status_id : 0 }, - {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} - ) - %> -
  • - <% end %> -
    - <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %> -
  • -

     指派  : 

    - - <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:50px; display:inline-block;" %> - - <%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project), - { :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0}, - {:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"w70 undis issueEdit"}) %> -
  • - <% end %> -
    -
-
    - <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %> -
  • -

     优先级  : 

    - <%= activity.priority.name %> - <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), - {:include_blank => false,:selected=>@priority_id ? @priority_id : 0}, - {:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %> -
  • - <% end %> -
    - <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %> -
  • -

     完成度  : 

    - <%= activity.done_ratio %>% - <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), - {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0}, - {:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %> - <% end %> -
  • - -
    -
-
    -
  • -

     开始  : 

    -

    <%= format_date(activity.start_date) %>

    -
  • -
    -
  • -

     周期  : 

    - <%= l_hours(activity.estimated_hours) %>
  • -
    -
-
    -
  • -

     计划完成  : 

    - <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
  • -
    -
  • -

     目标版本  : 

    - <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
  • -
    -
- + +
+
+
    + <%#= labelled_fields_for :issue, @issue do |f| %> + <%#= f.select :status_id, ([["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0])), + {:include_blank => false, :selected => @status_id ? @status_id : 0 }, + {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit"} %> + <%# end %> + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "status"},:remote=>'true', :method => :put, :id=>"issue_query_form_#{activity.id}", :class => 'query_form') do %> +
  • +

     状态  : 

    +

    <%= activity.status.name %>

    + <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), + {:include_blank => false, :selected => @status_id ? @status_id : 0 }, + {:onchange=>"remote_function('#issue_query_form_#{activity.id}');",:id=>"status_id",:name=>"status_id",:class=>"w70 undis issueEdit",:style=>"white-space:nowrap; overflow:hidden;"} + ) + %> +
  • + <% end %> +
    + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %> +
  • +

     指派  : 

    + + <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:50px; display:inline-block;" %> + + <%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project), + { :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0}, + {:onchange=>"remote_function('#issue_query_assign_form_#{activity.id}');", :id =>"assigned_to_id", :name => "assigned_to_id",:class=>"w70 undis issueEdit"}) %> +
  • + <% end %> +
    +
+
    + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %> +
  • +

     优先级  : 

    + <%= activity.priority.name %> + <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), + {:include_blank => false,:selected=>@priority_id ? @priority_id : 0}, + {:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %> +
  • + <% end %> +
    + <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %> +
  • +

     完成度  : 

    + <%= activity.done_ratio %>% + <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }), + {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0}, + {:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %> + <% end %> +
  • + +
    +
+
    +
  • +

     开始  : 

    +

    <%= format_date(activity.start_date) %>

    +
  • +
    +
  • +

     周期  : 

    + <%= l_hours(activity.estimated_hours) %>
  • +
    +
+
    +
  • +

     计划完成  : 

    + <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
  • +
    +
  • +

     目标版本  : 

    + <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
  • +
    +
+
\ No newline at end of file From 1607508887a35bd7f69db590bf4f9826f34981c2 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 25 Jan 2016 14:19:39 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B0=86=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E5=8F=91=E9=80=81=E8=87=B3=E8=AF=BE=E7=A8=8B=E3=80=81?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- app/controllers/users_controller.rb | 59 +++++++++++++++---- app/views/files/index.html.erb | 14 ----- app/views/messages/_course_show.html.erb | 2 +- .../messages/_org_subfield_show.html.erb | 1 + app/views/messages/_project_show.html.erb | 2 +- app/views/org_subfields/show.html.erb | 14 ----- .../_org_subfield_message.html.erb | 1 - app/views/users/_course_message.html.erb | 4 +- app/views/users/_project_message.html.erb | 4 +- .../users/_share_message_to_course.html.erb | 56 ++++++++++++++++++ .../users/_share_message_to_org.html.erb | 59 +++++++++++++++++++ .../users/_share_message_to_project.html.erb | 53 +++++++++++++++++ app/views/users/search_user_course.js.erb | 4 +- app/views/users/search_user_org.js.erb | 4 +- app/views/users/search_user_project.js.erb | 4 +- .../users/share_message_to_course.js.erb | 2 + app/views/users/share_message_to_org.js.erb | 2 + .../users/share_message_to_project.js.erb | 2 + config/routes.rb | 3 + 20 files changed, 240 insertions(+), 52 deletions(-) create mode 100644 app/views/users/_share_message_to_course.html.erb create mode 100644 app/views/users/_share_message_to_org.html.erb create mode 100644 app/views/users/_share_message_to_project.html.erb create mode 100644 app/views/users/share_message_to_course.js.erb create mode 100644 app/views/users/share_message_to_org.js.erb create mode 100644 app/views/users/share_message_to_project.js.erb diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 4e3286700..514903e93 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -302,7 +302,7 @@ class OrganizationsController < ApplicationController def org_resources_subfield @org = Organization.find(params[:id]) - if params[:send_type].present? and params[:send_type] == 'news' + if params[:send_type].present? and (params[:send_type] == 'news' or params[:send_type] == 'message') @subfield = @org.org_subfields.where("field_type = 'Post'") else @subfield = @org.org_subfields.where('field_type = "Resource" ') diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 38d148907..84f7d44c4 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1791,16 +1791,6 @@ class UsersController < ApplicationController def share_news_to_project news = News.find(params[:send_id]) project_ids = params[:project_ids] - # project_ids.each do |project_id| - # if Project.find(project_id).news.map(&:id).exclude?(news.id) - # project_news = News.create(:project_id => project_id.to_i, :title => news.title, :summary => news.summary, :description => news.description,:author_id => User.current.id, :created_on => Time.now) - # news.attachments.each do |attach| - # project_news.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest, - # :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype, - # :is_public => attach.is_public, :quotes => 0) - # end - # end - # end project_ids.each do |project_id| project = Project.find(project_id) if project.news.map(&:id).exclude?(news.id) @@ -1826,6 +1816,53 @@ class UsersController < ApplicationController OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'News', :org_act_id => org_news.id, :user_id => User.current.id) end + def share_message_to_course + @message = Message.find(params[:send_id]) + course_ids = params[:course_ids] + course_ids.each do |course_id| + course = Course.find(course_id) + if course.news.map(&:id).exclude?(@message.id) + message = Message.create(:board_id => course.boards.first.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id) + @message.attachments.each do |attach| + message.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest, + :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype, + :is_public => attach.is_public, :quotes => 0) + end + end + end + end + + def share_message_to_project + @message = Message.find(params[:send_id]) + project_ids = params[:project_ids] + project_ids.each do |project_id| + project = Project.find(project_id) + if project.news.map(&:id).exclude?(@message.id) + message = Message.create(:board_id => project.boards.first.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id) + @message.attachments.each do |attach| + message.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest, + :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype, + :is_public => attach.is_public, :quotes => 0) + end + end + end + end + + def share_message_to_org + field_id = params[:subfield] + @message = Message.find(params[:send_id]) + @message.quotes = @message.quotes.nil? ? 1 : (@message.quotes + 1) + @message.save + board = OrgSubfield.find(field_id).boards.first + mes = Message.create(:board_id => board.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id) + @message.attachments.each do |attach| + mes.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest, + :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype, + :is_public => attach.is_public, :quotes => 0) + end + OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'Message', :org_act_id => mes.id, :user_id => User.current.id) + end + def change_org_subfield end @@ -2175,7 +2212,7 @@ class UsersController < ApplicationController @user = User.current if !params[:search].nil? #发送到有栏目类型为资源的组织中 search = "%#{params[:search].to_s.strip.downcase}%" - if params[:send_type].present? and params[:send_type] == 'news' + if params[:send_type].present? and (params[:send_type] == 'news' or params[:send_type] == 'message') @orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Post'").count > 0} else @orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0} diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 8cb547b13..d4d12232e 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -185,20 +185,6 @@ } - - function org_id_click(){ - var sendText = $("input[name='org_id']:checked").next().text(); - var orgDirection = "目标地址:" - $(".orgDirection").text(orgDirection + sendText); - } - function subfield_click(){ - var sendText = $("input[name='org_id']:checked").next().text(); - var orgDirection = "目标地址:" - var sendColumn = $("input[name='subfield']:checked").next().text(); - $(".orgDirection").text(orgDirection + sendText + " / " + sendColumn); - } - - function course_attachmenttypes_change(id, type) { <% if @course%> $.ajax({ diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index c3278a209..ce2f6e085 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -60,7 +60,7 @@ ) if @message.course_destroyable_by?(User.current) %> <% end %> -
  • <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
  • +
  • <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
  • diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb index 304694b39..2578b2101 100644 --- a/app/views/messages/_org_subfield_show.html.erb +++ b/app/views/messages/_org_subfield_show.html.erb @@ -89,6 +89,7 @@ :class => 'postOptionLink' ) if @message.org_subfield_editable_by?(User.current) %> +
  • <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');",:class => 'postOptionLink'%>
  • diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index e5aba7c02..25fbc841b 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -115,7 +115,7 @@ ) if @message.destroyable_by?(User.current) %> <% end %> -
  • <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
  • +
  • <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %>
  • diff --git a/app/views/org_subfields/show.html.erb b/app/views/org_subfields/show.html.erb index 82203b4de..7d3a2b969 100644 --- a/app/views/org_subfields/show.html.erb +++ b/app/views/org_subfields/show.html.erb @@ -178,20 +178,6 @@ } - - function org_id_click(){ - var sendText = $("input[name='org_id']:checked").next().text(); - var orgDirection = "目标地址:" - $(".orgDirection").text(orgDirection + sendText); - } - function subfield_click(){ - var sendText = $("input[name='org_id']:checked").next().text(); - var orgDirection = "目标地址:" - var sendColumn = $("input[name='subfield']:checked").next().text(); - $(".orgDirection").text(orgDirection + sendText + " / " + sendColumn); - } - - function course_attachmenttypes_change(id, type) { <% if @course%> $.ajax({ diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb index 349f7c86e..16a2a55d6 100644 --- a/app/views/organizations/_org_subfield_message.html.erb +++ b/app/views/organizations/_org_subfield_message.html.erb @@ -13,7 +13,6 @@ <% end %> TO <%= link_to activity.board.org_subfield.name.to_s+" | 帖子栏目讨论区",organization_path(activity.board.org_subfield.organization, :org_subfield_id => activity.board.org_subfield.id), :class => "newsBlue ml15 mr5"%> -
    <% if activity.parent_id.nil? %> diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 5abd08224..8a7c6d4cd 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -71,9 +71,7 @@ ) if activity.course_destroyable_by?(User.current) %> <% end %> -
  • - <%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %> -
  • +
  • <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
  • diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index d4a7a9e60..ec36854cb 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -71,9 +71,7 @@ ) if activity.destroyable_by?(User.current) %> <% end %> -
  • - <%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %> -
  • +
  • <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
  • diff --git a/app/views/users/_share_message_to_course.html.erb b/app/views/users/_share_message_to_course.html.erb new file mode 100644 index 000000000..eda4a9b97 --- /dev/null +++ b/app/views/users/_share_message_to_course.html.erb @@ -0,0 +1,56 @@ + + +
    +
    +
    发送到
    +
    + +
    +
    +
    + +
    + <%= form_tag search_user_course_user_path(user),:method => 'get', + :remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> + + + + <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %> + <% end %> +
    + <%= form_tag share_message_to_course_user_path(user),:remote=>true,:id=>'course_list_form' %> +
    + + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> +
    + <% if !courses.empty? %> + <% courses.each do |course| %> +
      +
    • + +
    • +
    • <%= truncate(course.name,:lendght=>25) + '['+course.time.to_s+course.term + ']'%>
    • +
    + <% end %> +
    +
    +
    +
    + + <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %> +
    + +
    +
    + <% end %> +
    + diff --git a/app/views/users/_share_message_to_org.html.erb b/app/views/users/_share_message_to_org.html.erb new file mode 100644 index 000000000..da3c7a072 --- /dev/null +++ b/app/views/users/_share_message_to_org.html.erb @@ -0,0 +1,59 @@ +
    +
    发送到
    +
    + +
    + <%= form_tag search_user_org_user_path(user),:method => 'get', + :remote=>true,:id=>'search_user_org_form' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> + + + <% end %> +
    +
    +<%= form_tag share_message_to_org_user_path(user),:remote=>true,:id=>'orgs_list_form' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> +
    + +
      + <% unless @orgs.empty? %> + <% @orgs.each do |org|%> +
    • + +
    • + <%end%> + <%end%> +
    +
    +
    +
      + + + <%= render :partial => 'users/org_resources_subfield',:locals => {:subfield=>nil}%> + + + + + +
    +
    +
    +
    目标地址:
    +
    + <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();',:onclick=>"check_des(event);" %> +
    +
    + 取消 +
    +
    +<%end %> \ No newline at end of file diff --git a/app/views/users/_share_message_to_project.html.erb b/app/views/users/_share_message_to_project.html.erb new file mode 100644 index 000000000..4b79a779c --- /dev/null +++ b/app/views/users/_share_message_to_project.html.erb @@ -0,0 +1,53 @@ +
    +
    +
    发送到
    +
    + +
    +
    +
    + +
    + <%= form_tag search_user_project_user_path(user),:method => 'get', + :remote=>true,:id=>'search_user_project_form',:class=>'resourcesSearchBox' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> + + + + <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %> + <% end %> +
    + <%= form_tag share_message_to_project_user_path(user), :remote => true, :id=>'projects_list_form' %> +
    + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %> +
    + <% if !projects.empty? %> + <% projects.each do |project| %> +
      +
    • + +
    • +
    • <%= project.name%>
    • +
    + <% end %> +
    +
    +
    +
    + + <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %> +
    + +
    +
    + <% end %> +
    + diff --git a/app/views/users/search_user_course.js.erb b/app/views/users/search_user_course.js.erb index 138eab6f9..eed7499d5 100644 --- a/app/views/users/search_user_course.js.erb +++ b/app/views/users/search_user_course.js.erb @@ -11,8 +11,10 @@ //$("#upload_box").css('display','block'); <% if params[:send_type].present? && params[:send_type] == 'news' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_course' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); -<% else %> +<% elsif params[:send_type] == 'file' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_popup' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% elsif params[:send_type] == 'message' %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_course' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); <% end %> showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); diff --git a/app/views/users/search_user_org.js.erb b/app/views/users/search_user_org.js.erb index fb6efec9a..877629e34 100644 --- a/app/views/users/search_user_org.js.erb +++ b/app/views/users/search_user_org.js.erb @@ -1,7 +1,9 @@ <% if params[:send_type].present? && params[:send_type] == 'news' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); -<% else %> +<% elsif params[:send_type] == 'file' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_orgs' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); +<% elsif params[:send_type] == 'message' %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>'); <% end %> showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); diff --git a/app/views/users/search_user_project.js.erb b/app/views/users/search_user_project.js.erb index 926b7aa58..f80be34f8 100644 --- a/app/views/users/search_user_project.js.erb +++ b/app/views/users/search_user_project.js.erb @@ -1,7 +1,9 @@ <% if params[:send_type].present? && params[:send_type] == 'news' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); -<% else %> +<% elsif params[:send_type] == 'file' %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); +<% elsif params[:send_type] == 'message' %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>'); <% end %> showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); diff --git a/app/views/users/share_message_to_course.js.erb b/app/views/users/share_message_to_course.js.erb new file mode 100644 index 000000000..5a5046dfa --- /dev/null +++ b/app/views/users/share_message_to_course.js.erb @@ -0,0 +1,2 @@ +hideModal(); +alert("发送成功!"); \ No newline at end of file diff --git a/app/views/users/share_message_to_org.js.erb b/app/views/users/share_message_to_org.js.erb new file mode 100644 index 000000000..5a5046dfa --- /dev/null +++ b/app/views/users/share_message_to_org.js.erb @@ -0,0 +1,2 @@ +hideModal(); +alert("发送成功!"); \ No newline at end of file diff --git a/app/views/users/share_message_to_project.js.erb b/app/views/users/share_message_to_project.js.erb new file mode 100644 index 000000000..5a5046dfa --- /dev/null +++ b/app/views/users/share_message_to_project.js.erb @@ -0,0 +1,2 @@ +hideModal(); +alert("发送成功!"); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3a4d2fb92..4f191a9bf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -541,6 +541,9 @@ RedmineApp::Application.routes.draw do post 'share_news_to_course' post 'share_news_to_project' post 'share_news_to_org' + post 'share_message_to_course' + post 'share_message_to_project' + post 'share_message_to_org' get 'resource_preview' get 'rename_resource' get 'search_user_project' From dda64245b3056c3b2e823f7b9295bb89b068ad30 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 26 Jan 2016 10:35:54 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BB=A5=E4=B8=8B?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9A1.=E7=BC=96=E8=BE=91=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E9=A6=96=E9=A1=B5=E5=90=8E=EF=BC=8C=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E8=87=B3=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81=EF=BC=9B2.?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=90=8D=E7=89=87=E4=B8=AD=EF=BC=8C=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E6=98=BE=E7=A4=BA=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=9B3.=E5=90=8C=E6=84=8F=E7=94=B3=E8=AF=B7=E5=AD=90?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E5=90=8E=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=B7=B2?= =?UTF-8?q?=E5=90=8C=E6=84=8F=E7=94=B3=E8=AF=B7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/blog_comments_controller.rb | 4 ++-- app/views/users/_show_detail_info.html.erb | 9 +++++++-- app/views/users/_user_message_org.html.erb | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb index df6ba10d2..055236302 100644 --- a/app/controllers/blog_comments_controller.rb +++ b/app/controllers/blog_comments_controller.rb @@ -55,8 +55,8 @@ class BlogCommentsController < ApplicationController if params[:in_act] redirect_to user_path(params[:user_id]) else - if params[:is_homepage] - redirect_to user_blogs_path(params[:user_id]) + if @article.id.eql?(User.find(params[:user_id]).blog.homepage_id) + redirect_to user_path(params[:user_id]) else redirect_to user_blog_blog_comment_path(:user_id=>params[:user_id],:blog_id=>params[:blog_id],:id=>params[:id]) end diff --git a/app/views/users/_show_detail_info.html.erb b/app/views/users/_show_detail_info.html.erb index dc6599884..9de431336 100644 --- a/app/views/users/_show_detail_info.html.erb +++ b/app/views/users/_show_detail_info.html.erb @@ -6,11 +6,16 @@
    - + <% if (user.user_extensions && (user.user_extensions.identity != 2) ) %> + + <% end %> +

    - <%= user.user_extensions.technical_title %> + <% if user.user_extensions && user.user_extensions.identity %> + <%= get_user_roll(user) %> + <% end %>

    diff --git a/app/views/users/_user_message_org.html.erb b/app/views/users/_user_message_org.html.erb index 5bf1c8950..e3b656a46 100644 --- a/app/views/users/_user_message_org.html.erb +++ b/app/views/users/_user_message_org.html.erb @@ -12,7 +12,7 @@ <%= ma.content %>
  • - <%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"已同意申请", + <%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"申请已批准", agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ), :id => "agree_apply_subdomain_#{ma.id}", :method => 'post', From 63d1d3a8e7c1ff91f59cb9a592a07e18b82f187f Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 26 Jan 2016 10:59:28 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=8F=AA=E8=A6=81=E6=98=AF=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=88=90=E5=91=98=E5=B0=B1=E6=98=BE=E7=A4=BA=E7=BC=96=E8=BE=91?= =?UTF-8?q?issue=E5=A4=9A=E5=B1=9E=E6=80=A7=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 1e9f1bb68..c5d93e0a5 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -52,7 +52,7 @@
  • <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> <%# 局部刷新:修改xissue属性 %> - <% if is_project_manager?(User.current, activity.project) %> + <% if User.current.member_of?(activity.project) %> <% unless params[:action] == "index" %>
    <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> From 89a919163c58a751f13d07cdb47ae14574fd1d02 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 26 Jan 2016 15:25:25 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E4=B8=80=E6=97=A6=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E7=A7=81=E6=9C=89=EF=BC=8C=E5=B0=B1disabled=E6=8E=89=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E6=B8=B8=E5=AE=A2=E4=B8=8B=E8=BD=BD=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/new.html.erb | 5 +++-- app/views/organizations/setting.html.erb | 14 ++++++++++++-- public/javascripts/application.js | 13 +++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb index ea7fbbb30..e12bf3849 100644 --- a/app/views/organizations/new.html.erb +++ b/app/views/organizations/new.html.erb @@ -30,14 +30,15 @@
  • - + (打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)
  • - + (打钩为允许游客下载文件) +
  • diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 9ec118bec..b9b2f9b4c 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -63,11 +63,12 @@
  • 公开 : - class="ml3" /> + class="ml3" />
    下载支持 : - class="ml3" /> + name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />  允许游客下载 + <%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %>
    保存 <% end %> @@ -187,4 +188,13 @@ $("#apply_hint").text("子域名命名不规范,只能包含字母、数字和下划线,请重新输入"); } } + +// $(document).ready(function(){ +// if ( $("#is_public").attr("checked") != true){ +// alert($(this).attr("checked")); +// $("#allow_download").attr("checked", false); +// $("#allow_download").attr("disabled", true); +// $("#allow_down_hint").html(""); +// } +// }); \ No newline at end of file diff --git a/public/javascripts/application.js b/public/javascripts/application.js index f982d92f6..8fba6770a 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1135,3 +1135,16 @@ function chooseSendType(res_id,res_ids, user_id, send_type){ } lastSendType = sendType; } + +function disable_down(source, des, hint){ + if (source.attr("checked")){ + des.attr("disabled", false); + hint.html(""); + } + else{ + des.attr("checked", false); + des.attr("disabled", true); + hint.html("(私有组织不允许游客下载资源)"); + + } +} From d8ef2f0965eb949eded528c19040a66db092a991 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 26 Jan 2016 18:24:15 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80?= =?UTF-8?q?=E4=B8=AD=E7=9A=84at=E5=90=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/at_controller.rb | 15 +- app/models/at_message.rb | 13 +- app/views/users/_jour_form.html.erb | 3 +- app/views/users/_user_jours_list.html.erb | 2 +- db/schema.rb | 4082 +++++++++++---------- 5 files changed, 2080 insertions(+), 2035 deletions(-) diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb index 25e731754..456306c64 100644 --- a/app/controllers/at_controller.rb +++ b/app/controllers/at_controller.rb @@ -34,6 +34,12 @@ class AtController < ApplicationController find_homework(id) when 'Topic' find_topic(id) + when 'JournalsForMessage' + find_journals_for_message(id) + when 'Principal' + find_principal(id) + when 'All' + nil else nil end @@ -120,7 +126,11 @@ class AtController < ApplicationController #JournalsForMessage def find_journals_for_message(id) jounrnal = JournalsForMessage.find(id) - find_at_users(jounrnal.jour_type, jounrnal.jour_id) + if jounrnal.jour_type == 'Principal' + [jounrnal.user] + (JournalsForMessage.where(m_reply_id: id).map(&:user) || []) + else + find_at_users(jounrnal.jour_type, jounrnal.jour_id) + end end #Poll @@ -129,8 +139,6 @@ class AtController < ApplicationController #Journal def find_journal(id) - journal = Journal.find(id) - find_at_users(journal.journalized_type, journal.journalized_id) end #Document @@ -145,7 +153,6 @@ class AtController < ApplicationController #Principal def find_principal(id) - end #BlogComment diff --git a/app/models/at_message.rb b/app/models/at_message.rb index 3d20ffafb..bca2c7ba4 100644 --- a/app/models/at_message.rb +++ b/app/models/at_message.rb @@ -47,7 +47,11 @@ class AtMessage < ActiveRecord::Base "回复帖子: " end + at_message.subject when 'JournalsForMessage' - "作业: #{at_message.jour.name} 中留言" + if at_message.jour_type == 'Principal' + "留言: 在#{at_message.at_user.show_name}主页中留言" + else + "作业: #{at_message.jour.name} 中留言" + end else logger.error "error type: #{at_message_type}" end @@ -92,7 +96,12 @@ class AtMessage < ActiveRecord::Base when 'Message' {controller: :boards, action: :show, project_id: at_message.board.project, id: at_message.board} when 'JournalsForMessage' - {controller: :homework_common, action: :index, course: at_message.jour.course_id} + if at_message.jour_type == 'Principal' + {controller: :users, action: :user_messages, id: at_message.at_user} + else + {controller: :homework_common, action: :index, course: at_message.jour.course_id} + end + else logger.error "error type: #{at_message_type}" end diff --git a/app/views/users/_jour_form.html.erb b/app/views/users/_jour_form.html.erb index 13bf6d79a..0fa808d17 100644 --- a/app/views/users/_jour_form.html.erb +++ b/app/views/users/_jour_form.html.erb @@ -12,7 +12,8 @@ :minHeight=>40, :input_html => { :id => 'jour_content', :class => 'talk_text fl', - :maxlength => 5000 }%> + :maxlength => 5000 } + %>

    diff --git a/app/views/users/_user_jours_list.html.erb b/app/views/users/_user_jours_list.html.erb index 6993a7e91..1b3293e18 100644 --- a/app/views/users/_user_jours_list.html.erb +++ b/app/views/users/_user_jours_list.html.erb @@ -1,5 +1,5 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> + <%= import_ke(enable_at: true, prettify: false, init_activity: true) %> <%#= javascript_include_tag "init_KindEditor","user" %> <% end %>