Don’t show new annotation/comment form if allegations phase is not open
This commit is contained in:
@@ -3,4 +3,5 @@
|
|||||||
// * English: https://github.com/consul/consul/blob/master/CUSTOMIZE_EN.md#javascript
|
// * English: https://github.com/consul/consul/blob/master/CUSTOMIZE_EN.md#javascript
|
||||||
// * Spanish: https://github.com/consul/consul/blob/master/CUSTOMIZE_ES.md#javascript
|
// * Spanish: https://github.com/consul/consul/blob/master/CUSTOMIZE_ES.md#javascript
|
||||||
//
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
|||||||
@@ -122,17 +122,6 @@ App.LegislationAnnotatable =
|
|||||||
)
|
)
|
||||||
|
|
||||||
current_user_id = $('html').data('current-user-id')
|
current_user_id = $('html').data('current-user-id')
|
||||||
if current_user_id == ""
|
|
||||||
annotator.ui.editor.Editor.template = [
|
|
||||||
'<div class="annotator-outer annotator-editor annotator-hide">',
|
|
||||||
' <form class="annotator-widget">',
|
|
||||||
' ' + _t('Unregistered'),
|
|
||||||
' <div class="annotator-controls">',
|
|
||||||
' <a href="#cancel" class="annotator-cancel">' + _t('Cancel') + '</a>',
|
|
||||||
' </div>',
|
|
||||||
' </form>',
|
|
||||||
'</div>'
|
|
||||||
].join('\n')
|
|
||||||
|
|
||||||
$(".legislation-annotatable").each ->
|
$(".legislation-annotatable").each ->
|
||||||
$this = $(this)
|
$this = $(this)
|
||||||
|
|||||||
@@ -8,7 +8,11 @@
|
|||||||
|
|
||||||
<div class="comments-wrapper">
|
<div class="comments-wrapper">
|
||||||
<div class="comment-input">
|
<div class="comment-input">
|
||||||
<% if user_signed_in? %>
|
<% if !@process.open_phase?(:allegations) %>
|
||||||
|
<div data-alert class="callout primary">
|
||||||
|
<%= t("legislation.annotations.form.phase_not_open") %>
|
||||||
|
</div>
|
||||||
|
<% elsif user_signed_in? %>
|
||||||
<%= form_for Legislation::Annotation.new, url: legislation_process_draft_version_annotations_path(@process, @draft_version), remote: true do |f| %>
|
<%= form_for Legislation::Annotation.new, url: legislation_process_draft_version_annotations_path(@process, @draft_version), remote: true do |f| %>
|
||||||
<%= f.text_area :text %>
|
<%= f.text_area :text %>
|
||||||
|
|
||||||
@@ -22,10 +26,10 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div data-alert class="callout primary">
|
<div data-alert class="callout primary">
|
||||||
<%= t("debates.show.login_to_comment",
|
<%= t("legislation.annotations.form.login_to_comment",
|
||||||
signin: link_to(t("votes.signin"), new_user_session_path),
|
signin: link_to(t("legislation.annotations.form.signin"), new_user_session_path),
|
||||||
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
|
signup: link_to(t("legislation.annotations.form.signup"), new_user_registration_path)).html_safe %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
<section class="legislation-annotatable"
|
<section class="legislation-annotatable"
|
||||||
data-legislation-draft-version-id="<%= @draft_version.id %>"
|
data-legislation-draft-version-id="<%= @draft_version.id %>"
|
||||||
data-legislation-annotatable-base-url="<%= legislation_process_draft_version_path(@process, @draft_version) %>"
|
data-legislation-annotatable-base-url="<%= legislation_process_draft_version_path(@process, @draft_version) %>"
|
||||||
|
data-legislation-open-phase="<%= @process.open_phase?(:allegations) %>"
|
||||||
>
|
>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= @draft_version.body_html.html_safe %>
|
<%= @draft_version.body_html.html_safe %>
|
||||||
|
|||||||
@@ -237,6 +237,11 @@ en:
|
|||||||
other: "%{count} replies"
|
other: "%{count} replies"
|
||||||
cancel: Cancel
|
cancel: Cancel
|
||||||
publish_comment: Publish Comment
|
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:
|
index:
|
||||||
title: Comments
|
title: Comments
|
||||||
comments_about: Comments about
|
comments_about: Comments about
|
||||||
|
|||||||
@@ -237,6 +237,11 @@ es:
|
|||||||
other: "%{count} respuestas"
|
other: "%{count} respuestas"
|
||||||
cancel: Cancelar
|
cancel: Cancelar
|
||||||
publish_comment: Publicar Comentario
|
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:
|
index:
|
||||||
title: Comentarios
|
title: Comentarios
|
||||||
see_in_context: Ver en contexto
|
see_in_context: Ver en contexto
|
||||||
|
|||||||
Reference in New Issue
Block a user