diff --git a/app/models/project.rb b/app/models/project.rb index ca80d90f8..668e243c9 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -114,8 +114,8 @@ class Project < ActiveRecord::Base validates_presence_of :name, :identifier validates_uniqueness_of :identifier validates_uniqueness_of :name - validates_associated :repository, :wiki - # validates_length_of :description, :maximum => 255 + validates_associated :wiki#, :repository + # validates_length_of :description, :maximum => 255 validates_length_of :name, :maximum => 255 validates_length_of :homepage, :maximum => 255 validates_length_of :identifier, :in => 1..IDENTIFIER_MAX_LENGTH diff --git a/app/views/members/create.js.erb b/app/views/members/create.js.erb index 3b01980ad..35280b7a4 100644 --- a/app/views/members/create.js.erb +++ b/app/views/members/create.js.erb @@ -12,7 +12,11 @@ hideOnLoad(); $("#member-<%= member.id %>").effect("highlight"); <% end %> <% else %> - <% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ') %> - alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors))) %>'); + <% if @members %> + <% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ')%> + alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors || ''))) %>'); + <% else%> +// alert(''); + <% end%> <% end %> <% end %> diff --git a/app/views/projects/settings/_members.html.erb b/app/views/projects/settings/_members.html.erb index 25f02da0d..9c9c64bd1 100644 --- a/app/views/projects/settings/_members.html.erb +++ b/app/views/projects/settings/_members.html.erb @@ -14,8 +14,12 @@ - - + + <%= call_hook(:view_projects_settings_members_table_header, :project => @project) %> @@ -24,26 +28,30 @@ <% members.each do |member| %> <% next if member.new_record? %> - + @@ -77,7 +85,9 @@
<%= l(:label_user) %><%= l(:label_role_plural) %> + <%= l(:label_user) %> + + <%= l(:label_role_plural) %> +
<%= link_to_user member.principal %> + <%= link_to_user member.principal %> + - - <%= h member.roles.sort.collect(&:to_s).join(', ') %> - + + <%= h member.roles.sort.collect(&:to_s).join(', ') %> + <%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member), :method => :put, :html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}} ) do |f| %> -

<% roles.each do |role| %>
- <% end %>

+ <% end %> +

<%= hidden_field_tag 'membership[role_ids][]', '' %> -

<%= submit_tag l(:button_change), :class => "small" %> +

+ <%= submit_tag l(:button_change), :class => "small" %> <%= link_to_function l(:button_cancel), "$('#member-#{member.id}-roles').show(); $('#member-#{member.id}-roles-form').hide(); return false;" - %>

+ %> +

<% end %>
<% else %> -

<%= l(:label_no_data) %>

+

+ <%= l(:label_no_data) %> +

<% end %> @@ -87,20 +97,25 @@
<%= form_for(@applied_members, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
- <%= l(:label_apply_project) %> - + + <%= l(:label_apply_project) %> +
<%= render_principals_for_applied_members(@project) %>

-

<%= l(:label_role_plural) %>: +

+ <%= l(:label_role_plural) %>: <% roles.each do |role| %> - - - <% end %>

- -

<%= submit_tag l(:label_approve), :id => 'member-add-submit' %> + + <% end %> +

+

+ <%= submit_tag l(:label_approve), :id => 'member-add-submit' %> <%= submit_tag l(:label_refusal), :name => "refusal_button", :id => 'member-refusal-submit' %>

@@ -110,9 +125,13 @@ <%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
- <%= l(:label_member_new) %> - -

<%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %>

+ + <%= l(:label_member_new) %> + +

+ <%= label_tag "principal_search", l(:label_principal_search) %> + <%= text_field_tag 'principal_search', nil %> +

<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
@@ -120,13 +139,18 @@

-

<%= l(:label_role_plural) %>: +

+ <%= l(:label_role_plural) %>: <% roles.each do |role| %> - - - <% end %>

- -

<%= submit_tag l(:button_add), :id => 'member-add-submit' %>

+ + <% end %> +

+

+ <%= submit_tag l(:button_add), :id => 'member-add-submit' %> +

<% end %> <% end %>