diff --git a/app/models/legislation/annotation.rb b/app/models/legislation/annotation.rb index 2bdfb3fca..b038b5e51 100644 --- a/app/models/legislation/annotation.rb +++ b/app/models/legislation/annotation.rb @@ -1,4 +1,5 @@ class Legislation::Annotation < ActiveRecord::Base + COMMENTS_PAGE_SIZE = 5 acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases diff --git a/app/views/admin/legislation/draft_versions/_form.html.erb b/app/views/admin/legislation/draft_versions/_form.html.erb index 1f221cd76..a29a93ea4 100644 --- a/app/views/admin/legislation/draft_versions/_form.html.erb +++ b/app/views/admin/legislation/draft_versions/_form.html.erb @@ -20,7 +20,7 @@ <%= f.label :title %>
- <%= f.text_field :title, label: false %> + <%= f.text_field :title, label: false, placeholder: t('admin.legislation.draft_versions.form.title_placeholder') %>
@@ -30,7 +30,7 @@ <%= t('admin.legislation.draft_versions.form.use_markdown') %>
- <%= f.text_area :changelog, label: false, rows: 5 %> + <%= f.text_area :changelog, label: false, rows: 5, placeholder: t('admin.legislation.draft_versions.form.changelog_placeholder') %>
@@ -77,7 +77,7 @@ <% end %>
- <%= f.text_area :body, label: false %> + <%= f.text_area :body, label: false, placeholder: t('admin.legislation.draft_versions.form.body_placeholder') %>
diff --git a/app/views/admin/legislation/processes/_form.html.erb b/app/views/admin/legislation/processes/_form.html.erb index 8f8ee348f..b796049e1 100644 --- a/app/views/admin/legislation/processes/_form.html.erb +++ b/app/views/admin/legislation/processes/_form.html.erb @@ -119,7 +119,8 @@
<%= f.text_field :title, - label: false %> + label: false, + placeholder: t('admin.legislation.processes.form.title_placeholder') %>
@@ -131,7 +132,8 @@
<%= f.text_area :description, label: false, - rows: 5 %> + rows: 5, + placeholder: t('admin.legislation.processes.form.description_placeholder') %>
@@ -143,7 +145,8 @@
<%= f.text_area :target, label: false, - rows: 5 %> + rows: 5, + placeholder: t('admin.legislation.processes.form.target_placeholder') %>
@@ -155,7 +158,8 @@
<%= f.text_area :how_to_participate, label: false, - rows: 5 %> + rows: 5, + placeholder: t('admin.legislation.processes.form.how_to_participate_placeholder') %>
@@ -167,7 +171,8 @@
<%= f.text_area :additional_info, label: false, - rows: 10 %> + rows: 10, + placeholder: t('admin.legislation.processes.form.additional_info_placeholder') %>
diff --git a/app/views/admin/legislation/questions/_form.html.erb b/app/views/admin/legislation/questions/_form.html.erb index 9608f3d7d..4b0cf8ce5 100644 --- a/app/views/admin/legislation/questions/_form.html.erb +++ b/app/views/admin/legislation/questions/_form.html.erb @@ -20,7 +20,7 @@ <%= f.label :title %>
- <%= f.text_area :title, rows: 5, label: false %> + <%= f.text_area :title, rows: 5, label: false, placeholder: t('admin.legislation.questions.form.title_placeholder') %>
diff --git a/app/views/admin/legislation/questions/_question_option_fields.html.erb b/app/views/admin/legislation/questions/_question_option_fields.html.erb index 0578e65ae..ef77872fa 100644 --- a/app/views/admin/legislation/questions/_question_option_fields.html.erb +++ b/app/views/admin/legislation/questions/_question_option_fields.html.erb @@ -2,7 +2,7 @@
- <%= f.text_field :value, label: false %> + <%= f.text_field :value, label: false, placeholder: t('admin.legislation.questions.form.value_placeholder') %>
<%= link_to_remove_association " #{t('.remove_option')}".html_safe, f %> diff --git a/app/views/legislation/annotations/_comments_box.html.erb b/app/views/legislation/annotations/_comments_box.html.erb index 24e87b141..4f33d45ef 100644 --- a/app/views/legislation/annotations/_comments_box.html.erb +++ b/app/views/legislation/annotations/_comments_box.html.erb @@ -6,20 +6,22 @@ <% end %>
- <% annotation.comments.roots.each do |comment| %> + <% annotation.comments.roots.limit(5).each do |comment| %>
-

<%= comment.body %>

+

<%= truncate comment.body, length: 250 %>

-
- <%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation) do %> - <%= t('legislation.annotations.comments.see_complete') %> - <% end %> -
+ <% if comment.body.length > 250 %> +
+ <%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation) do %> + <%= t('legislation.annotations.comments.see_complete') %> + <% end %> +
+ <% end %>
- <%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation) do %> + <%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation, anchor: "comment_#{comment.id}") do %> <%= t('legislation.annotations.comments.replies_count', count: comment.children.size) %> <% end %>
@@ -35,8 +37,10 @@
diff --git a/app/views/legislation/draft_versions/show.html.erb b/app/views/legislation/draft_versions/show.html.erb index df3d49047..c0fe8789a 100644 --- a/app/views/legislation/draft_versions/show.html.erb +++ b/app/views/legislation/draft_versions/show.html.erb @@ -14,7 +14,9 @@ <%= select_tag "draft_version_id", options_from_collection_for_select(@draft_versions_list, 'id', 'display_title', @draft_version.id), "aria-label": t('.select_draft_version') %> <%= submit_tag t('.select_version_submit'), class: "button" %> <% end %> - <%= link_to t('.see_changes'), legislation_process_draft_version_changes_path(@process, @draft_version) %> + <% if @draft_version.changelog.present? %> + <%= link_to t('.see_changes'), legislation_process_draft_version_changes_path(@process, @draft_version) %> + <% end %>
<%= t('.updated_at', date: format_date(@draft_version.updated_at)) %>
diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index f259cd0f7..1392aa75e 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -198,6 +198,11 @@ en: start: Start end: End use_markdown: Use Markdown to format the text + title_placeholder: The title of the process + description_placeholder: Add a description of the process + target_placeholder: Describe who is the target of the process + how_to_participate_placeholder: Describe how to participate + additional_info_placeholder: Add an additional information you consider useful index: create: New process delete: Delete @@ -247,6 +252,9 @@ en: status: draft: You can preview as admin, no one else can see it published: Visible for everybody + title_placeholder: Write the title of the draft version + changelog_placeholder: Add the main changes from the previous version + body_placeholder: Write down the draft text index: title: Draft versions create: Create version @@ -283,6 +291,8 @@ en: error: Error form: add_option: Add option + title_placeholder: Add a title + value_placeholder: Add a closed answer index: back: Back title: Questions associated to this process diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index de228e0c6..368b32c2a 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -198,6 +198,11 @@ es: start: Inicio end: Fin use_markdown: Usa Markdown para formatear el texto + title_placeholder: Escribe el título del proceso + description_placeholder: Añade una descripción del proceso + target_placeholder: Describe a quién va dirigido + how_to_participate_placeholder: Describe cómo participar + additional_info_placeholder: Añade cualquier información adicional que pueda ser de interés index: create: Nuevo proceso delete: Borrar @@ -247,6 +252,9 @@ es: status: draft: Podrás previsualizarlo como logueado, nadie más lo podrá ver published: Será visible para todo el mundo + title_placeholder: Escribe el título de esta versión del borrador + changelog_placeholder: Describe cualquier cambio relevante con la versión anterior + body_placeholder: Escribe el texto del borrador index: title: Versiones del borrador create: Crear versión @@ -283,6 +291,8 @@ es: error: Error form: add_option: +Añadir respuesta cerrada + title_placeholder: Escribe un título a la pregunta + value_placeholder: Escribe una respuesta cerrada index: back: Volver title: Preguntas asociadas a este proceso