Skip to content

Commit 72d57fb

Browse files
authored
Merge pull request #406 from linuxfrorg/title-length
Make the news and comment title field length consistent with the model
2 parents e3b9f99 + ef44425 commit 72d57fb

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

app/models/comment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Comment < ActiveRecord::Base
4141
}
4242

4343
validates :title, presence: { message: "Le titre est obligatoire" },
44-
length: { maximum: 100, message: "Le titre est trop long" }
44+
length: { maximum: 160, message: "Le titre est trop long" }
4545
validates :wiki_body, presence: { message: "Vous ne pouvez pas poster un commentaire vide" }
4646

4747
wikify_attr :body

app/views/comments/_form.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
%p
44
= form.label :title, "Sujet du commentaire"
5-
= form.text_field :title, autocomplete: 'off', required: 'required', spellcheck: 'true', maxlength: 100
5+
= form.text_field :title, autocomplete: 'off', required: 'required', spellcheck: 'true', maxlength: 160
66
%p
77
= form.label :wiki_body, "Commentaire complet"
88
= form.text_area :wiki_body, required: 'required', spellcheck: 'true', class: 'markItUp', placeholder: "Vous pouvez écrire votre commentaire ici.\n\nMerci de rester poli et courtois, on compte sur vous !"

app/views/redaction/news/_form.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
= form.label :section_id, "Section"
33
= form.collection_select :section_id, Section.published, :id, :title
44
= form.label :title, "Titre"
5-
= form.text_field :title, autocomplete: 'off', required: 'required', spellcheck: 'true', maxlength: 100
5+
= form.text_field :title, autocomplete: 'off', required: 'required', spellcheck: 'true', maxlength: 160
66
%button.cancel(type="button") Annuler
77
= form.submit "OK"

app/views/redaction/news/reorganize.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
= form.collection_select :section_id, Section.published, :id, :title
1717
%p
1818
= form.label :title, "Titre"
19-
= form.text_field :title, autocomplete: 'off', required: 'required', spellcheck: 'true', maxlength: 100
19+
= form.text_field :title, autocomplete: 'off', required: 'required', spellcheck: 'true', maxlength: 160
2020
%p
2121
= form.label :wiki_body, "Chapeau"
2222
= form.text_area :wiki_body, required: 'required', spellcheck: 'true', class: 'markItUp'

0 commit comments

Comments
 (0)