From 7499f4659d4fe38f178ed76e38089978393ca8f4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 19 Oct 2016 15:35:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E6=88=90=E5=91=98=E7=95=8C=E9=9D=A2=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=93=8D=E4=BD=9C-=E7=BC=96=E8=BE=91=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=8C=E8=A7=92=E8=89=B2=E5=87=BA=E7=8E=B0=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E5=88=97=E8=A1=A8=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/settings/_new_members.html.erb | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/app/views/projects/settings/_new_members.html.erb b/app/views/projects/settings/_new_members.html.erb index e4fb0f73f..1bb0757c0 100644 --- a/app/views/projects/settings/_new_members.html.erb +++ b/app/views/projects/settings/_new_members.html.erb @@ -33,6 +33,7 @@ <%= i += 1 %> <%= link_to_user_header member.principal, true %> + <% if User.current.language == "zh" %> <% zh_roles = [] %> <% member.roles.each do |role| %> @@ -45,13 +46,23 @@ end %> <% end %> - <%= h zh_roles.sort.reverse.collect(&:to_s).join(', ') %> + <% else %> - <%= h member.roles.sort.collect(&:to_s).join(', ') %> - <% end %> + + <% end %> + <%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member), + :method => :put, + :html => {:id => "members-#{member.id}-roles-form", :class => 'undis'}} + ) do |f| %> + <%= select( :membership, :roles, [["管理人员",3],["开发人员",4],["报告人员",5]], + { :include_blank => false, :selected => member.roles[0].id ? member.roles[0].id : 0 }, + { :onchange=>"remote_function('#members-#{member.id}-roles-form');", :id =>"membership[role_ids][]", :name => "membership[role_ids][]", :style => "border:1px solid #e5e5e5;"}) %> + + <% end %> + <% unless member.user_id == @project.user_id %> - 编辑 + 编辑 <%= delete_link membership_path(member), :remote => true, :class => "sy_btn_grey mr5", @@ -279,4 +290,7 @@ function add_members_submit(){ $("#new_membership").submit(); } + function remote_function(id) { + $(id).submit(); + } \ No newline at end of file From ae9a6eb928f24b30becc86f1346ac27c962b69b7 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 19 Oct 2016 15:47:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=96=87=E4=BB=B6=E9=A1=B5=E9=9D=A2=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/entry.html.erb | 35 ++++++++++++++------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/app/views/repositories/entry.html.erb b/app/views/repositories/entry.html.erb index bb2fa6dae..d463f91b3 100644 --- a/app/views/repositories/entry.html.erb +++ b/app/views/repositories/entry.html.erb @@ -1,17 +1,18 @@ -<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %> -
-
- <%= render :partial => 'navigation' %> -
- -

<%= l(:label_revision_path) %> :<%= @path %>

- - <%= render :partial => 'link_to_functions' %> - - <%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %> - - <% content_for :header_tags do %> - <%= stylesheet_link_tag "scm" %> - <% end %> -
- +<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %> +
+
+
+ <%= render :partial => 'navigation' %> +
+ +

<%= l(:label_revision_path) %> :<%= @path %>

+ + <%= render :partial => 'link_to_functions' %> + + <%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %> + + <% content_for :header_tags do %> + <%= stylesheet_link_tag "scm" %> + <% end %> +
+