opf/openproject

View on GitHub
app/views/enterprises/_current.html.erb

Summary

Maintainability
Test Coverage
<enterprise-active-saved-trial
  data-subscriber="<%= @current_token.subscriber %>"
  data-email="<%= @current_token.mail %>"
  data-company="<%= @current_token.try(:company) %>"
  data-domain="<%= @current_token.try(:domain) %>"
  data-user-count="<%= @current_token.restrictions.nil? ? t('js.admin.enterprise.upsale.unlimited') : @current_token.restrictions[:active_user_count] %>"
  data-starts-at="<%= format_date @current_token.starts_at %>"
  data-expires-at="<%= (!@current_token.will_expire?) ? t('js.admin.enterprise.upsale.unlimited') : (format_date @current_token.expires_at) %>"
  data-is-expired="<%= @current_token.expired?(reprieve: false) %>"
  data-reprieve-days-left="<%= @current_token.reprieve_days_left %>"
>
</enterprise-active-saved-trial>

<%= form_tag(enterprise_path,
             method: :delete,
             data: augmented_confirmation_dialog(
             danger_zone: true,
             text: t('admin.enterprise.delete_token_modal.text'),
             title: t('admin.enterprise.delete_token_modal.title'),
             button_continue: t(:button_delete),
             icon_continue: 'delete'
            )
    ) do %>
  <%= styled_button_tag t(:button_delete),
                        method: :delete,
                        class: '-with-icon icon-delete' %>
<% end %>