diff --git a/app/models/profile.rb b/app/models/profile.rb index 6fa6301..742cad0 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -44,6 +44,11 @@ class Profile < ActiveRecord::Base acts_as_searchable :additional_fields => [ :extra_data_for_index ] + # FIXME ugly workaround + def self.human_attribute_name(attrib) + _(self.superclass.human_attribute_name(attrib)) + end + class_inheritable_accessor :extra_index_methods self.extra_index_methods = [] @@ -158,7 +163,7 @@ class Profile < ActiveRecord::Base end validates_presence_of :identifier, :name - validates_format_of :identifier, :with => IDENTIFIER_FORMAT + validates_format_of :identifier, :with => IDENTIFIER_FORMAT, :if => lambda { |profile| !profile.identifier.blank? } validates_exclusion_of :identifier, :in => RESERVED_IDENTIFIERS validates_uniqueness_of :identifier, :scope => :environment_id diff --git a/app/models/user.rb b/app/models/user.rb index 05381cb..68781d0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -13,7 +13,7 @@ class User < ActiveRecord::Base case attrib.to_sym when :login: return _('Username') when :email: return _('e-Mail') - else self.superclass.human_attribute_name(attrib) + else _(self.superclass.human_attribute_name(attrib)) end end @@ -43,16 +43,16 @@ class User < ActiveRecord::Base attr_accessor :password validates_presence_of :login, :email - validates_format_of :login, :with => Profile::IDENTIFIER_FORMAT + validates_format_of :login, :with => Profile::IDENTIFIER_FORMAT, :if => (lambda {|user| !user.login.blank?}) validates_presence_of :password, :if => :password_required? - validates_presence_of :password_confirmation, :if => :password_required? - validates_length_of :password, :within => 4..40, :if => :password_required? + validates_presence_of :password_confirmation, :if => :password_required?, :if => (lambda {|user| !user.password.blank?}) + validates_length_of :password, :within => 4..40, :if => :password_required?, :if => (lambda {|user| !user.password.blank?}) validates_confirmation_of :password, :if => :password_required? - validates_length_of :login, :within => 2..40 - validates_length_of :email, :within => 3..100 + validates_length_of :login, :within => 2..40, :if => (lambda {|user| !user.login.blank?}) + validates_length_of :email, :within => 3..100, :if => (lambda {|user| !user.email.blank?}) validates_uniqueness_of :login, :email, :case_sensitive => false before_save :encrypt_password - validates_format_of :email, :with => Noosfero::Constants::EMAIL_FORMAT + validates_format_of :email, :with => Noosfero::Constants::EMAIL_FORMAT, :if => (lambda {|user| !user.email.blank?}) validates_inclusion_of :terms_accepted, :in => [ '1' ], :if => lambda { |u| ! u.terms_of_use.blank? }, :message => N_('%{fn} must be checked in order to signup.') diff --git a/app/views/admin_panel/manage_templates.rhtml b/app/views/admin_panel/manage_templates.rhtml index e7f801e..d941c67 100644 --- a/app/views/admin_panel/manage_templates.rhtml +++ b/app/views/admin_panel/manage_templates.rhtml @@ -22,12 +22,3 @@ <% end %> <% end %> - -

<%= _('Edit Templates') %>

- - - diff --git a/app/views/features/_manage_enterprise_fields.rhtml b/app/views/features/_manage_enterprise_fields.rhtml index 55ee75c..5a6869f 100644 --- a/app/views/features/_manage_enterprise_fields.rhtml +++ b/app/views/features/_manage_enterprise_fields.rhtml @@ -1,4 +1,4 @@ -

<%= _('Manage enterprise fields') %>

+

<%= __('Manage enterprise fields') %>

<% labelled_form_for(:environment, @environment, :url => {:action => 'manage_enterprise_fields'}) do |f| %> diff --git a/lib/unifreire_terminology.rb b/lib/unifreire_terminology.rb index c9cbfe2..c9376fc 100644 --- a/lib/unifreire_terminology.rb +++ b/lib/unifreire_terminology.rb @@ -28,6 +28,7 @@ class UnifreireTerminology < Noosfero::Terminology::Custom 'Enterprises in "%s"' => N_('Institutions in "%s"'), 'Register a new Enterprise' => N_('Register a new Institution'), 'Events' => N_('Schedule'), + 'Manage enterprise fields' => N_('Manage institutions fields'), }) end diff --git a/public/stylesheets/forms.css b/public/stylesheets/forms.css index 5770f5b..743a403 100644 --- a/public/stylesheets/forms.css +++ b/public/stylesheets/forms.css @@ -76,10 +76,10 @@ /*** REQUIRED FIELDS ***/ -#content form .required-field label { +#content form .required-field label.formlabel { font-weight: bold; } -#content form .required-field label:after { +#content form .required-field label.formlabel:after { content: ' (*)'; } -- libgit2 0.21.2