Make the translation button condition more readable
I was finding this part hard to follow, but after changing the name of the condition suddenly I understood what was going on.
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
<div class="remote-translations-button">
|
<div class="remote-translations-button">
|
||||||
<% if display_remote_translation_button? %>
|
<% if translations_in_progress? %>
|
||||||
|
<%= t("remote_translations.all_remote_translations_enqueued_text") %>
|
||||||
|
<% else %>
|
||||||
<%= form_tag remote_translations_path do %>
|
<%= form_tag remote_translations_path do %>
|
||||||
<%= hidden_field_tag :remote_translations, remote_translations.to_json %>
|
<%= hidden_field_tag :remote_translations, remote_translations.to_json %>
|
||||||
<%= t("remote_translations.text") %>
|
<%= t("remote_translations.text") %>
|
||||||
<%= submit_tag t("remote_translations.button") %>
|
<%= submit_tag t("remote_translations.button") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
|
||||||
<%= t("remote_translations.all_remote_translations_enqueued_text") %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Layout::RemoteTranslationsButtonComponent < ApplicationComponent
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def display_remote_translation_button?
|
def translations_in_progress?
|
||||||
remote_translations.none?(&:enqueued?)
|
remote_translations.any?(&:enqueued?)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user