docbrown/app/views/admin/configs/_apple_auth_provider_settings.html.erb
Fernando Valverde 88bd3a1069
Replace authentication_enabled_providers.include? with helper method (#12379)
* Replaces authentication_enabled_providers.include? with helper authentication_provider_enabled?

* Fix typo
2021-01-22 07:54:10 -06:00

77 lines
3.2 KiB
Text

<!--
Apple's config is different compared to the common OAuth provider implemented
before, this makes the generalized `auth_provider_settings` not work well so it
requires a custom partial
-->
<fieldset class="config-authentication-form">
<div
class="crayons-notice crayons-notice--warning auth-warning <%= authentication_provider_enabled?(provider) ? "hidden" : "" %>">
<strong>Note:</strong> This authentication provider will <strong>not</strong> be enabled if the key or secret are missing. Please make sure that you enter your key and secret correctly.
</div>
<div class="crayons-field">
<%= admin_config_label :apple_client_id %>
<p class="crayons-field__description">
<%= Constants::SiteConfig::DETAILS[:apple_client_id][:description] %>
</p>
<%= f.text_field :apple_client_id,
class: "crayons-textfield",
value: SiteConfig.apple_client_id,
placeholder: Constants::SiteConfig::DETAILS[:apple_client_id][:placeholder] %>
</div>
<div class="crayons-field">
<%= admin_config_label :apple_key_id %>
<p class="crayons-field__description">
<%= Constants::SiteConfig::DETAILS[:apple_key_id][:description] %>
<p>
<%= f.text_field :apple_key_id,
class: "crayons-textfield",
value: SiteConfig.apple_key_id,
placeholder: Constants::SiteConfig::DETAILS[:apple_key_id][:placeholder] %>
</div>
<div class="crayons-field">
<%= admin_config_label :apple_pem %>
<p class="crayons-field__description">
<%= Constants::SiteConfig::DETAILS[:apple_pem][:description] %>
<p>
<%= f.text_field :apple_pem,
class: "crayons-textfield",
value: SiteConfig.apple_pem,
placeholder: Constants::SiteConfig::DETAILS[:apple_pem][:placeholder] %>
</div>
<div class="crayons-field">
<%= admin_config_label :apple_team_id %>
<p class="crayons-field__description">
<%= Constants::SiteConfig::DETAILS[:apple_team_id][:description] %>
<p>
<%= f.text_field :apple_team_id,
class: "crayons-textfield",
value: SiteConfig.apple_team_id,
placeholder: Constants::SiteConfig::DETAILS[:apple_team_id][:placeholder] %>
</div>
<div class="flex gap-2">
<% if authentication_provider_enabled?(provider) %>
<button
class="crayons-btn crayons-btn--danger"
data-action="click->config#activateAuthProviderModal"
data-tooltip="<%= tooltip_text_email_or_auth_provider_btns %>"
data-provider-name="<%= provider.provider_name %>"
data-provider-official-name="<%= provider.official_name %>"
<%= disabled_attr_on_auth_provider_enable_btn %>>
Disable
</button>
<button
class="crayons-btn crayons-btn--secondary"
data-provider-name="<%= provider.provider_name %>"
data-action="click->config#hideAuthProviderSettings">
Close
</button>
<% else %>
<button
class="crayons-btn crayons-btn--secondary"
data-provider-name="<%= provider.provider_name %>"
data-action="click->config#disableAuthProvider">
Undo
</button>
<% end %>
</div>
</fieldset>