diff --git a/app/assets/javascripts/custom.js b/app/assets/javascripts/custom.js index 50903021a..6c880b3a9 100644 --- a/app/assets/javascripts/custom.js +++ b/app/assets/javascripts/custom.js @@ -1,6 +1,7 @@ // Overrides and adds customized javascripts in this file -// Read more on documentation: +// Read more on documentation: // * English: https://github.com/consul/consul/blob/master/CUSTOMIZE_EN.md#javascript // * Spanish: https://github.com/consul/consul/blob/master/CUSTOMIZE_ES.md#javascript // +// diff --git a/app/assets/javascripts/legislation_annotatable.js.coffee b/app/assets/javascripts/legislation_annotatable.js.coffee index 4baa1a725..cc238835e 100644 --- a/app/assets/javascripts/legislation_annotatable.js.coffee +++ b/app/assets/javascripts/legislation_annotatable.js.coffee @@ -122,17 +122,6 @@ App.LegislationAnnotatable = ) current_user_id = $('html').data('current-user-id') - if current_user_id == "" - annotator.ui.editor.Editor.template = [ - '
', - '
', - ' ' + _t('Unregistered'), - '
', - ' ' + _t('Cancel') + '', - '
', - '
', - '
' - ].join('\n') $(".legislation-annotatable").each -> $this = $(this) @@ -146,8 +135,8 @@ App.LegislationAnnotatable = ann["legislation_draft_version_id"] = ann_id ann.permissions = ann.permissions || {} ann.permissions.admin = [] - .include(annotator.ui.main, { - element: this, + .include(annotator.ui.main, { + element: this, viewerExtensions: [App.LegislationAnnotatable.viewerExtension], editorExtensions: [App.LegislationAnnotatable.editorExtension] }) diff --git a/app/views/legislation/annotations/_form.html.erb b/app/views/legislation/annotations/_form.html.erb index 317a712c8..a757b4612 100644 --- a/app/views/legislation/annotations/_form.html.erb +++ b/app/views/legislation/annotations/_form.html.erb @@ -8,7 +8,11 @@
- <% if user_signed_in? %> + <% if !@process.open_phase?(:allegations) %> +
+ <%= t("legislation.annotations.form.phase_not_open") %> +
+ <% elsif user_signed_in? %> <%= form_for Legislation::Annotation.new, url: legislation_process_draft_version_annotations_path(@process, @draft_version), remote: true do |f| %> <%= f.text_area :text %> @@ -22,10 +26,10 @@ <% end %> <% else %>
- <%= t("debates.show.login_to_comment", - signin: link_to(t("votes.signin"), new_user_session_path), - signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %> -
+ <%= t("legislation.annotations.form.login_to_comment", + signin: link_to(t("legislation.annotations.form.signin"), new_user_session_path), + signup: link_to(t("legislation.annotations.form.signup"), new_user_registration_path)).html_safe %> +
<% end %>
diff --git a/app/views/legislation/draft_versions/show.html.erb b/app/views/legislation/draft_versions/show.html.erb index d89926929..615a86fc8 100644 --- a/app/views/legislation/draft_versions/show.html.erb +++ b/app/views/legislation/draft_versions/show.html.erb @@ -54,6 +54,7 @@
<% end %> <%= @draft_version.body_html.html_safe %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 09eac149c..d65c3b007 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -237,6 +237,11 @@ en: other: "%{count} replies" cancel: Cancel publish_comment: Publish Comment + form: + phase_not_open: This phase is not open + login_to_comment: You must %{signin} or %{signup} to leave a comment. + signin: Sign in + signup: Sign up index: title: Comments comments_about: Comments about diff --git a/config/locales/es.yml b/config/locales/es.yml index 1a9626cc6..708a74ed2 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -237,6 +237,11 @@ es: other: "%{count} respuestas" cancel: Cancelar publish_comment: Publicar Comentario + form: + phase_not_open: Esta fase del proceso no está abierta + login_to_comment: Necesitas %{signin} o %{signup} para comentar. + signin: iniciar sesión + signup: registrarte index: title: Comentarios see_in_context: Ver en contexto