From bc6ff57de2016fa282241737e5eebf91f36def31 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 16 Apr 2015 09:30:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=BB=84=E3=80=81=E6=9C=8B=E5=8F=8B=E5=9C=88=E3=80=81=E7=A0=94?= =?UTF-8?q?=E5=8F=91=E7=BB=84=E5=88=87=E6=8D=A2js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_development_group.html.erb | 4 +--- app/views/layouts/_base_friend_group.html.erb | 4 +--- app/views/layouts/_base_research_team.html.erb | 4 +--- app/views/layouts/base_projects.html.erb | 12 +++++++----- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/app/views/layouts/_base_development_group.html.erb b/app/views/layouts/_base_development_group.html.erb index 87ee4e8d8..9055b9a1b 100644 --- a/app/views/layouts/_base_development_group.html.erb +++ b/app/views/layouts/_base_development_group.html.erb @@ -1,5 +1,4 @@ <% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %> -
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/layouts/_base_friend_group.html.erb b/app/views/layouts/_base_friend_group.html.erb index c367882e5..71d375501 100644 --- a/app/views/layouts/_base_friend_group.html.erb +++ b/app/views/layouts/_base_friend_group.html.erb @@ -1,5 +1,4 @@ <% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %> -
- <% end %> -
\ No newline at end of file + <% end %> \ No newline at end of file diff --git a/app/views/layouts/_base_research_team.html.erb b/app/views/layouts/_base_research_team.html.erb index 811a58961..3f942bc40 100644 --- a/app/views/layouts/_base_research_team.html.erb +++ b/app/views/layouts/_base_research_team.html.erb @@ -1,5 +1,4 @@ <% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %> -
- <% end%> -
\ No newline at end of file + <% 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 15e30bfbb..865cf303b 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -43,19 +43,19 @@ if(data == 1) { $("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_development_team)))%>"); - $("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_development_group')) %>'); + $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'layouts/base_development_group')) %>'); $("#close_light").attr("onClick","close_window('development_group');"); } else if(data == 2) { $("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_research_group)))%>"); - $("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_research_team')) %>'); + $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'layouts/base_research_team')) %>'); $("#close_light").attr("onClick","close_window('research_group');"); } else if(data == 3) { $("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_friend_organization)))%>"); - $("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_friend_group')) %>'); + $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'layouts/base_friend_group')) %>'); $("#close_light").attr("onClick","close_window('friend_organization');"); } else @@ -165,13 +165,15 @@ <% end %> - <% if @project.project_new_type == 1 || @project.project_new_type.nil? %> +
+ <% if @project.project_new_type == 1 || @project.project_new_type.nil? %> <%= render :partial => 'layouts/base_development_group', :locals => {:project => @project}%> <% elsif @project.project_new_type == 2 %> <%= render :partial => 'layouts/base_research_team', :locals => {:project => @project}%> - <% else %> + <% else %> <%= render :partial => 'layouts/base_friend_group', :locals => {:project => @project}%> <% end %> +
From 115d77dd01c006de759e91eb74ff11d9bef3e7e5 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 16 Apr 2015 09:49:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=9C=88=E5=AD=90JS=E5=92=8CmodulesJS=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 1 + app/helpers/application_helper.rb | 10 ++++++++++ app/views/projects/modules.js.erb | 10 ++++++++++ app/views/projects/settings.html.erb | 10 ++++++++++ app/views/projects/settings/_new_modules.html.erb | 8 ++++---- app/views/projects/settings/_new_versions.html.erb | 2 +- db/schema.rb | 2 +- 7 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 app/views/projects/modules.js.erb diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8e9802280..c846de965 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -323,6 +323,7 @@ class ProjectsController < ApplicationController @member ||= @project.members.new @trackers = Tracker.sorted.all @wiki ||= @project.wiki + @select_tab = params[:tab] end def send_mail_to_member diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fad54f056..bc4a8b093 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1409,6 +1409,16 @@ module ApplicationHelper link_to l(:button_delete), url, options end + def delete_link_version(url, options={}) + options = { + :method => :delete, + :data => {:confirm => l(:text_are_you_sure)}, + :class => 'c_purple' + }.merge(options) + + link_to l(:button_delete), url, options + end + def delete_new_link(url, options={}) diff --git a/app/views/projects/modules.js.erb b/app/views/projects/modules.js.erb new file mode 100644 index 000000000..9ef3a1e2d --- /dev/null +++ b/app/views/projects/modules.js.erb @@ -0,0 +1,10 @@ +$('#pro_st_tbc_02').html('<%= escape_javascript(render :partial => 'projects/settings/new_modules') %>'); + + +<% if @project.project_new_type == 1 || @project.project_new_type.nil? %> + $('#project_memu_list').html('<%= escape_javascript(render :partial => 'layouts/base_development_group', :locals => {:project => @project}) %>'); +<% elsif @project.project_new_type == 2 %> + $('#project_memu_list').html('<%= escape_javascript(render :partial => 'layouts/base_research_team', :locals => {:project => @project}) %>'); +<% else %> + $('#project_memu_list').html('<%= escape_javascript(render :partial => 'layouts/base_friend_group', :locals => {:project => @project}) %>'); +<% end %> \ No newline at end of file diff --git a/app/views/projects/settings.html.erb b/app/views/projects/settings.html.erb index 3e66fec5e..247656350 100644 --- a/app/views/projects/settings.html.erb +++ b/app/views/projects/settings.html.erb @@ -1,3 +1,13 @@ + +

配置

diff --git a/app/views/projects/settings/_new_modules.html.erb b/app/views/projects/settings/_new_modules.html.erb index c6aa26348..d80d27a98 100644 --- a/app/views/projects/settings/_new_modules.html.erb +++ b/app/views/projects/settings/_new_modules.html.erb @@ -5,18 +5,18 @@ <% Redmine::AccessControl.available_project_modules.each do |m| %>
  • <% end %>

    - <%= check_all_links 'modules-form' %> + <%= check_all_links('modules-form').html_safe %>

    - + <%= l(:button_save) %>

    diff --git a/app/views/projects/settings/_new_versions.html.erb b/app/views/projects/settings/_new_versions.html.erb index 06e704495..b05575049 100644 --- a/app/views/projects/settings/_new_versions.html.erb +++ b/app/views/projects/settings/_new_versions.html.erb @@ -28,7 +28,7 @@ <% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %> <%= link_to l(:button_edit), edit_version_path(version), :class => 'c_purple' %> - <%= delete_link version_path(version) %> + <%= delete_link_version version_path(version) %> <% end %> diff --git a/db/schema.rb b/db/schema.rb index f9ade5aa4..69a07f2ef 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 => 20150409092151) do +ActiveRecord::Schema.define(:version => 20150414115406) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false