Patch #9225 » changeset_rea7e9f7e100db9e5ffda644296b543802039f503.diff
| app/views/projects/_form.rhtml | ||
|---|---|---|
|
<p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p>
|
||
|
<p><%= f.text_field :identifier, :required => true, :size => 60, :disabled => @project.identifier_frozen? %>
|
||
|
<% unless @project.identifier_frozen? %>
|
||
|
<%= javascript_tag "observeProjectIdentifier(#{Project::IDENTIFIER_MAX_LENGTH});observeProjectName(#{Project::IDENTIFIER_MAX_LENGTH});" %>
|
||
|
<br /><em><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info) %></em>
|
||
|
<% end %></p>
|
||
|
<p><%= f.text_field :homepage, :size => 60 %></p>
|
||
| config/locales/de.yml | ||
|---|---|---|
|
text_tip_issue_begin_day: Aufgabe, die an diesem Tag beginnt
|
||
|
text_tip_issue_end_day: Aufgabe, die an diesem Tag endet
|
||
|
text_tip_issue_begin_end_day: Aufgabe, die an diesem Tag beginnt und endet
|
||
|
text_project_identifier_info: 'Kleinbuchstaben (a-z), Ziffern und Bindestriche erlaubt.<br />Einmal gespeichert, kann die Kennung nicht mehr geändert werden.'
|
||
|
text_project_identifier_info: 'Kleinbuchstaben (a-z), Ziffern und Bindestriche erlaubt, muss mit einem Kleinbuchstaben beginnen.<br />Einmal gespeichert, kann die Kennung nicht mehr geändert werden.'
|
||
|
text_caracters_maximum: "Max. %{count} Zeichen."
|
||
|
text_caracters_minimum: "Muss mindestens %{count} Zeichen lang sein."
|
||
|
text_length_between: "Länge zwischen %{min} und %{max} Zeichen."
|
||
| config/locales/en-GB.yml | ||
|---|---|---|
|
text_tip_issue_begin_day: task beginning this day
|
||
|
text_tip_issue_end_day: task ending this day
|
||
|
text_tip_issue_begin_end_day: task beginning and ending this day
|
||
|
text_project_identifier_info: 'Only lower case letters (a-z), numbers and dashes are allowed.<br />Once saved, the identifier cannot be changed.'
|
||
|
text_project_identifier_info: 'Only lower case letters (a-z), numbers and dashes are allowed, must start with a lower case letter.<br />Once saved, the identifier cannot be changed.'
|
||
|
text_caracters_maximum: "%{count} characters maximum."
|
||
|
text_caracters_minimum: "Must be at least %{count} characters long."
|
||
|
text_length_between: "Length between %{min} and %{max} characters."
|
||
| config/locales/en.yml | ||
|---|---|---|
|
text_tip_issue_begin_day: issue beginning this day
|
||
|
text_tip_issue_end_day: issue ending this day
|
||
|
text_tip_issue_begin_end_day: issue beginning and ending this day
|
||
|
text_project_identifier_info: 'Only lower case letters (a-z), numbers and dashes are allowed.<br />Once saved, the identifier cannot be changed.'
|
||
|
text_project_identifier_info: 'Only lower case letters (a-z), numbers and dashes are allowed, must start with a lower case letter.<br />Once saved, the identifier cannot be changed.'
|
||
|
text_caracters_maximum: "%{count} characters maximum."
|
||
|
text_caracters_minimum: "Must be at least %{count} characters long."
|
||
|
text_length_between: "Length between %{min} and %{max} characters."
|
||
| config/locales/fr.yml | ||
|---|---|---|
|
text_tip_issue_begin_day: tâche commençant ce jour
|
||
|
text_tip_issue_end_day: tâche finissant ce jour
|
||
|
text_tip_issue_begin_end_day: tâche commençant et finissant ce jour
|
||
|
text_project_identifier_info: 'Seuls les lettres minuscules (a-z), chiffres et tirets sont autorisés.<br />Un fois sauvegardé, l''identifiant ne pourra plus être modifié.'
|
||
|
text_project_identifier_info: 'Seuls les lettres minuscules (a-z), chiffres et tirets sont autorisés, doit commencer par une minuscule.<br />Un fois sauvegardé, l''identifiant ne pourra plus être modifié.'
|
||
|
text_caracters_maximum: "%{count} caractères maximum."
|
||
|
text_caracters_minimum: "%{count} caractères minimum."
|
||
|
text_length_between: "Longueur comprise entre %{min} et %{max} caractères."
|
||
| public/javascripts/application.js | ||
|---|---|---|
|
return key;
|
||
|
}
|
||
|
// Automatic project identifier generation
|
||
|
var projectIdentifierLocked = false;
|
||
|
function generateProjectIdentifier(identifierMaxLength) {
|
||
|
var identifier = $('project_name').getValue() // project name
|
||
|
identifier = identifier.replace(/ä/g,'ae'); // umlauts
|
||
|
identifier = identifier.replace(/ö/g,'oe'); // umlauts
|
||
|
identifier = identifier.replace(/ü/g,'ue'); // umlauts
|
||
|
identifier = identifier.replace(/Ä/g,'Ae'); // umlauts
|
||
|
identifier = identifier.replace(/Ö/g,'Oe'); // umlauts
|
||
|
identifier = identifier.replace(/Ü/g,'Ue'); // umlauts
|
||
|
identifier = identifier.replace(/ß/g,'ss'); // umlauts
|
||
|
identifier = identifier.replace(/[^a-z0-9]+/gi, '-'); // non-alphanumeric => dash
|
||
|
identifier = identifier.replace(/^[-\d]*|-*$/g, ''); // remove dashes and numbers at beginning and dashes at end
|
||
|
identifier = identifier.toLowerCase(); // to lower
|
||
|
identifier = identifier.substr(0,identifierMaxLength); // max characters
|
||
|
return identifier;
|
||
|
}
|
||
|
function observeProjectName(identifierMaxLength) {
|
||
|
var f = function() {
|
||
|
if(!projectIdentifierLocked) {
|
||
|
$('project_identifier').setValue(generateProjectIdentifier(identifierMaxLength));
|
||
|
}
|
||
|
};
|
||
|
Event.observe('project_name', 'keyup', f);
|
||
|
}
|
||
|
function observeProjectIdentifier(identifierMaxLength) {
|
||
|
var f = function() {
|
||
|
if($('project_identifier').getValue() != '' && $('project_identifier').getValue() != generateProjectIdentifier(identifierMaxLength)) {
|
||
|
projectIdentifierLocked = true;
|
||
|
} else {
|
||
|
projectIdentifierLocked = false;
|
||
|
}
|
||
|
};
|
||
|
Event.observe('project_identifier', 'keyup', f);
|
||
|
}
|
||
|
function observeParentIssueField(url) {
|
||
|
new Ajax.Autocompleter('issue_parent_issue_id',
|
||
|
'parent_issue_candidates',
|
||