docbrown/app/views/admin/invitations/new.html.erb
Ridhwana aa6d80bc5d
Only enable user invitations page when SMTP is enabled (#15219)
* first pass of styling of the page

* feat: scroll to the position in the config controller in stimulus

* feat: add the tooltip and a cursor thats not allowed

* feat: add a disabled property for all that needs smtp to be enabled

* feat: update the form styling

* feat: update the form

* specs: update the label name

* fix: syntax error

* chore: update the newline

* spec: test the invitation flow

* fix test

* feat: update the form as per suggestions

* spec: update the tests to match the new workflow

* oops committed debugging code

* chore: add a before to set the smtp_enabled method

* feat: update the boldness and fontsize of the link

* feat: remove size
2021-10-29 17:41:30 +02:00

44 lines
1.8 KiB
Text

<% smtp_enabled = ForemInstance.smtp_enabled? %>
<% unless smtp_enabled %>
<div class="crayons-card">
<div class="crayons-card__body p-4">
<h1 class="fw-heavy fs-3xl">Setup SMTP to invite users</h1>
<div class="my-4">
SMTP settings are required so that your Forem can send emails.
If you wish to send invites, email digests and activity notifications you will need to
specify which email host will relay those messages for you. You can
<a href="https://admin.forem.com/docs/advanced-customization/config/smtp-settings" target="_blank">read more about SMTP Settings in our admin guide</a>.
</div>
<div class="my-4">
Please note that you will need to reload this page after configuring your SMTP Settings.
</div>
<div class="fw-bold">
<%= link_to "Configure your SMTP Settings here.", admin_config_path(anchor: "smtp-section"), target: "_blank", rel: :noopener %>
</div>
</div>
</div>
<% end %>
<% if smtp_enabled %>
<h1 class="fw-heavy fs-3xl">Invite Users</h1>
<%= form_for(User.new, url: admin_invitations_path) do |f| %>
<div class="crayons-field mt-6">
<%= f.label :email, class: "crayons-field__label" %>
<%= f.text_field :email,
class: "crayons-textfield",
placeholder: "Email of invitee",
required: true %>
</div>
<div class="crayons-field mt-6">
<%= f.label :name, class: "crayons-field__label" %>
<%= f.text_field :name,
class: "crayons-textfield",
placeholder: "Name of invitee",
required: true %>
</div>
<div class="mt-6">
<%= f.submit "Invite User", class: "crayons-btn" %>
</div>
<% end %>
<% end %>