Sometimes we're interpolating a link inside a translation, and marking the whole translations as HTML safe. However, some translations added by admins to the database or through crowdin are not entirely under our control. Although AFAIK crowdin checks for potential cross-site scripting attacks, it's a good practice to sanitize parts of a string potentially out of our control before marking the string as HTML safe.
24 lines
999 B
Plaintext
24 lines
999 B
Plaintext
<% if user_signed_in? && current_user.organization? %>
|
|
<div class="participation-not-allowed" style="display:none" aria-hidden="false">
|
|
<p>
|
|
<%= t("legislation.questions.participation.organizations") %>
|
|
</p>
|
|
</div>
|
|
<% elsif user_signed_in? && current_user.unverified? %>
|
|
<div class="participation-not-allowed" style="display:none" aria-hidden="false">
|
|
<p>
|
|
<%= sanitize(t("legislation.questions.participation.verified_only",
|
|
verify_account: link_to_verify_account)) %>
|
|
</p>
|
|
</div>
|
|
<% elsif !user_signed_in? %>
|
|
<div class="participation-not-allowed" style="display:none" aria-hidden="false">
|
|
<%= sanitize(t("legislation.questions.participation.unauthenticated",
|
|
signin: link_to_signin, signup: link_to_signup)) %>
|
|
</div>
|
|
<% elsif !@process.debate_phase.open? %>
|
|
<div class="participation-not-allowed" style="display:none" aria-hidden="false">
|
|
<%= t("legislation.questions.participation.debate_phase_not_open") %>
|
|
</div>
|
|
<% end %>
|