diff options
-rw-r--r-- | app/models/project.rb | 4 | ||||
-rw-r--r-- | app/models/user.rb | 5 | ||||
-rw-r--r-- | app/views/account/password_recovery.rhtml | 3 | ||||
-rw-r--r-- | app/views/my/account.rhtml | 3 | ||||
-rw-r--r-- | app/views/projects/_form.rhtml | 6 | ||||
-rw-r--r-- | app/views/users/_form.rhtml | 3 | ||||
-rw-r--r-- | lang/de.yml | 4 | ||||
-rw-r--r-- | lang/en.yml | 4 | ||||
-rw-r--r-- | lang/es.yml | 4 | ||||
-rw-r--r-- | lang/fr.yml | 4 | ||||
-rw-r--r-- | lang/it.yml | 4 | ||||
-rw-r--r-- | lang/ja.yml | 4 | ||||
-rw-r--r-- | lang/zh.yml | 4 |
13 files changed, 37 insertions, 15 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 2419e720d..60a376768 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -35,8 +35,10 @@ class Project < ActiveRecord::Base validates_uniqueness_of :name, :identifier validates_associated :custom_values, :on => :update validates_associated :repository, :wiki + validates_length_of :name, :maximum => 30 validates_format_of :name, :with => /^[\w\s\'\-]*$/i - validates_length_of :identifier, :maximum => 12 + validates_length_of :description, :maximum => 255 + validates_length_of :identifier, :in => 3..12 validates_format_of :identifier, :with => /^[a-z0-9\-]*$/ def identifier=(identifier) diff --git a/app/models/user.rb b/app/models/user.rb index 869be920e..08220beaa 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -33,9 +33,12 @@ class User < ActiveRecord::Base validates_presence_of :login, :firstname, :lastname, :mail validates_uniqueness_of :login, :mail # Login must contain lettres, numbers, underscores only - validates_format_of :firstname, :lastname, :with => /^[\w\s\'\-]*$/i validates_format_of :login, :with => /^[a-z0-9_\-@\.]+$/i + validates_length_of :login, :maximum => 30 + validates_format_of :firstname, :lastname, :with => /^[\w\s\'\-]*$/i + validates_length_of :firstname, :lastname, :maximum => 30 validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i + validates_length_of :mail, :maximum => 60 # Password length between 4 and 12 validates_length_of :password, :in => 4..12, :allow_nil => true validates_confirmation_of :password, :allow_nil => true diff --git a/app/views/account/password_recovery.rhtml b/app/views/account/password_recovery.rhtml index 89b105292..c3c451e57 100644 --- a/app/views/account/password_recovery.rhtml +++ b/app/views/account/password_recovery.rhtml @@ -9,7 +9,8 @@ <% form_tag({:token => @token.value}, :class => "tabular") do %> <p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label> - <%= password_field_tag 'new_password', nil, :size => 25 %></p> + <%= password_field_tag 'new_password', nil, :size => 25 %><br /> + <em><%= l(:text_length_between, 4, 12) %></em></p> <p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label> <%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p> diff --git a/app/views/my/account.rhtml b/app/views/my/account.rhtml index 8a1468cd5..24f0ef551 100644 --- a/app/views/my/account.rhtml +++ b/app/views/my/account.rhtml @@ -35,7 +35,8 @@ <%= password_field_tag 'password', nil, :size => 25 %></p> <p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label> - <%= password_field_tag 'new_password', nil, :size => 25 %></p> + <%= password_field_tag 'new_password', nil, :size => 25 %><br /> + <em><%= l(:text_length_between, 4, 12) %></em></p> <p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label> <%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p> diff --git a/app/views/projects/_form.rhtml b/app/views/projects/_form.rhtml index 184370b92..03a757d70 100644 --- a/app/views/projects/_form.rhtml +++ b/app/views/projects/_form.rhtml @@ -2,14 +2,14 @@ <div class="box"> <!--[form:project]--> -<p><%= f.text_field :name, :required => true %></p> +<p><%= f.text_field :name, :required => true %><br /><em><%= l(:text_caracters_maximum, 30) %></em></p> <% if admin_loggedin? and !@root_projects.empty? %> <p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p> <% end %> -<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 3 %></p> -<p><%= f.text_field :identifier, :required => true, :size => 15, :disabled => @project.identifier_frozen? %><br /><em><%= l(:text_project_identifier_info) unless @project.identifier_frozen? %></em></p> +<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 3 %><br /><em><%= l(:text_caracters_maximum, 255) %></em></p> +<p><%= f.text_field :identifier, :required => true, :size => 15, :disabled => @project.identifier_frozen? %><br /><em><%= l(:text_length_between, 3, 12) %> <%= l(:text_project_identifier_info) unless @project.identifier_frozen? %></em></p> <p><%= f.text_field :homepage, :size => 40 %></p> <p><%= f.check_box :is_public %></p> diff --git a/app/views/users/_form.rhtml b/app/views/users/_form.rhtml index 18c849257..43540e67c 100644 --- a/app/views/users/_form.rhtml +++ b/app/views/users/_form.rhtml @@ -23,7 +23,8 @@ <p><%= f.select :auth_source_id, [[l(:label_internal), ""]] + @auth_sources.collect { |a| [a.name, a.id] } %></p> <% end %> <p><label for="password"><%=l(:field_password)%><span class="required"> *</span></label> -<%= password_field_tag 'password', nil, :size => 25 %></p> +<%= password_field_tag 'password', nil, :size => 25 %><br /> +<em><%= l(:text_length_between, 4, 12) %></em></p> <p><label for="password_confirmation"><%=l(:field_password_confirmation)%><span class="required"> *</span></label> <%= password_field_tag 'password_confirmation', nil, :size => 25 %></p> </div> diff --git a/lang/de.yml b/lang/de.yml index 39b3ea1f5..c08b4af40 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -397,7 +397,9 @@ text_journal_deleted: gelöscht text_tip_task_begin_day: Aufgabe, die an diesem Tag beginnt text_tip_task_end_day: Aufgabe, die an diesem Tag beendet text_tip_task_begin_end_day: Aufgabe, die an diesem Tag beginnt und beendet -text_project_identifier_info: '12 characters maximum. Letters (a-z), numbers (0-9) and dashes allowed.<br />Once saved, the identifier can not be changed.' +text_project_identifier_info: 'Lower case letters (a-z), numbers and dashes allowed.<br />Once saved, the identifier can not be changed.' +text_caracters_maximum: %d characters maximum. +text_length_between: Length between %d and %d characters. default_role_manager: Manager default_role_developper: Developer diff --git a/lang/en.yml b/lang/en.yml index 4f0cbe9f0..4ce8bcb27 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -397,7 +397,9 @@ text_journal_deleted: deleted text_tip_task_begin_day: task beginning this day text_tip_task_end_day: task ending this day text_tip_task_begin_end_day: task beginning and ending this day -text_project_identifier_info: '12 characters maximum. Letters (a-z), numbers (0-9) and dashes allowed.<br />Once saved, the identifier can not be changed.' +text_project_identifier_info: 'Lower case letters (a-z), numbers and dashes allowed.<br />Once saved, the identifier can not be changed.' +text_caracters_maximum: %d characters maximum. +text_length_between: Length between %d and %d characters. default_role_manager: Manager default_role_developper: Developer diff --git a/lang/es.yml b/lang/es.yml index 7b05f3707..a2014845e 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -397,7 +397,9 @@ text_journal_deleted: suprimido text_tip_task_begin_day: tarea que comienza este día text_tip_task_end_day: tarea que termina este día text_tip_task_begin_end_day: tarea que comienza y termina este día -text_project_identifier_info: '12 characters maximum. Letters (a-z), numbers (0-9) and dashes allowed.<br />Once saved, the identifier can not be changed.' +text_project_identifier_info: 'Lower case letters (a-z), numbers and dashes allowed.<br />Once saved, the identifier can not be changed.' +text_caracters_maximum: %d characters maximum. +text_length_between: Length between %d and %d characters. default_role_manager: Manager default_role_developper: Desarrollador diff --git a/lang/fr.yml b/lang/fr.yml index 564b5fe78..8b52ac5de 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -397,7 +397,9 @@ text_journal_deleted: supprimé text_tip_task_begin_day: tâche commençant ce jour text_tip_task_end_day: tâche finissant ce jour text_tip_task_begin_end_day: tâche commençant et finissant ce jour -text_project_identifier_info: '12 caractères maximum. Lettres (a-z), chiffres (0-9) et tirets autorisés.<br />Un fois sauvegardé, l''identifiant ne pourra plus être modifié.' +text_project_identifier_info: 'Lettres minuscules (a-z), chiffres et tirets autorisés.<br />Un fois sauvegardé, l''identifiant ne pourra plus être modifié.' +text_caracters_maximum: %d caractères maximum. +text_length_between: Longueur comprise entre %d et %d caractères. default_role_manager: Manager default_role_developper: Développeur diff --git a/lang/it.yml b/lang/it.yml index fc2d405a3..daaed6b79 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -397,7 +397,9 @@ text_journal_deleted: deleted text_tip_task_begin_day: task beginning this day text_tip_task_end_day: task ending this day text_tip_task_begin_end_day: task beginning and ending this day -text_project_identifier_info: '12 characters maximum. Letters (a-z), numbers (0-9) and dashes allowed.<br />Once saved, the identifier can not be changed.' +text_project_identifier_info: 'Lower case letters (a-z), numbers and dashes allowed.<br />Once saved, the identifier can not be changed.' +text_caracters_maximum: %d characters maximum. +text_length_between: Length between %d and %d characters. default_role_manager: Manager default_role_developper: Sviluppatore diff --git a/lang/ja.yml b/lang/ja.yml index db4335c38..bbeb6d453 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -398,7 +398,9 @@ text_journal_deleted: 削除 text_tip_task_begin_day: この日に開始するタスク text_tip_task_end_day: この日に終了するタスク text_tip_task_begin_end_day: この日のうちに開始して終了するタスク -text_project_identifier_info: '12 characters maximum. Letters (a-z), numbers (0-9) and dashes allowed.<br />Once saved, the identifier can not be changed.' +text_project_identifier_info: 'Lower case letters (a-z), numbers and dashes allowed.<br />Once saved, the identifier can not be changed.' +text_caracters_maximum: %d characters maximum. +text_length_between: Length between %d and %d characters. default_role_manager: 管理者 default_role_developper: 開発者 diff --git a/lang/zh.yml b/lang/zh.yml index a0508d34b..5ffcb159b 100644 --- a/lang/zh.yml +++ b/lang/zh.yml @@ -400,7 +400,9 @@ text_journal_deleted: 已删除 text_tip_task_begin_day: 开始于此
text_tip_task_end_day: 在此结束
text_tip_task_begin_end_day: 开始并结束于此
-text_project_identifier_info: '12 characters maximum. Letters (a-z), numbers (0-9) and dashes allowed.<br />Once saved, the identifier can not be changed.'
+text_project_identifier_info: 'Lower case letters (a-z), numbers and dashes allowed.<br />Once saved, the identifier can not be changed.'
+text_caracters_maximum: %d characters maximum.
+text_length_between: Length between %d and %d characters.
default_role_manager: 管理员
default_role_developper: 开发人员
|