ncbo/bioportal_web_ui

View on GitHub
app/views/admin/licenses/_form.html.haml

Summary

Maintainability
Test Coverage
= form_with(model: [:admin, license]) do |form|
  - if license.errors.any?
    %div.alert.alert-danger{role: "alert"}
      %h5.alert-heading
        = pluralize(license.errors.count, "error") 
        prohibited this license from being saved:
      - license.errors.full_messages.each do |message|
        %p.font-italic.pl-3.mb-0= message
  %div.form-group
    %label{for: "license_encrypted_key"} License key
    = text_area(:license, :encrypted_key, rows: 10, required: true, class: "form-control", aria: { describedBy: "licenseKeyHelpBlock" })
    %small#licenseKeyHelpBlock.form-text.text-muted
      Paste your license key into the text area
  %div.form-group
    = form.submit "Submit", class: "btn btn-primary"