diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b834f54b..abccf57d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -154,4 +154,8 @@ module ApplicationHelper .map { |_currency, money| format_money(money) } .join(separator) end + + def invite_code_required? + ENV["REQUIRE_INVITE_CODE"] == "true" + end end diff --git a/app/views/layouts/auth.html.erb b/app/views/layouts/auth.html.erb index 05c81e68..8c492be1 100644 --- a/app/views/layouts/auth.html.erb +++ b/app/views/layouts/auth.html.erb @@ -8,9 +8,11 @@ <% if controller_name == "sessions" %> -
- <%= t(".or") %> <%= link_to t(".sign_up"), new_registration_path, class: "font-medium text-gray-600 hover:text-gray-400 transition" %> -
+ <% unless invite_code_required? %> ++ <%= t(".or") %> <%= link_to t(".sign_up"), new_registration_path, class: "font-medium text-gray-600 hover:text-gray-400 transition" %> +
+ <% end %> <% elsif controller_name == "registrations" %><%= t(".or") %> <%= link_to t(".sign_in"), new_session_path, class: "font-medium text-gray-600 hover:text-gray-400 transition" %>