- @pagetitle = 'Add Attribute'

.card
  = render(partial: "webui/#{@container.model_name.singular}/tabs", locals: { project: @project, package: @package })

  .card-body
    %h3= @pagetitle
    = form_for(@attribute) do |form|
      .row
        = form.hidden_field(:project_id)
        = hidden_field_tag(:project_name, @project.name)
        - if @attribute.package_id
          = form.hidden_field(:package_id)
          = hidden_field_tag(:package_name, @package.name)
        .col-12.col-md-auto
          = form.collection_select(:attrib_type_id, @attribute_types, :id, :fullname, {}, class: 'form-control form-select')
        .col-form-label.col-12.col-md
          - @attribute_types.each do |attribute_type|
            %p.d-none{ id: "attribute_type-description-#{attribute_type.id}" }
              = attribute_type.description.presence || 'Sorry, this attribute has no description'
      = link_to('Back', index_attribs_path, class: 'btn btn-outline-secondary', role: 'button')
      = form.submit('Add', class: 'btn btn-primary')
