This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/views/admin/user_attributes/_form.html.erb

32 lines
961 B
Plaintext

<p>
<%= f.label :name %>
<%= f.text_field :name %>
</p>
<fieldset>
<% @user_attribute.attrs.each_with_index do |attr, i| %>
<p>
<label><%= attr["key"] %></label>
<%= hidden_field_tag "user_attribute[attrs][][key]", attr["key"] %>
<%= text_field_tag "user_attribute[attrs][][name]", attr["name"] %>
<%= select_tag "user_attribute[attrs][][type]", options_for_select(["text_field", "select"], attr["type"]) %>
<a href="#" class="remove">(remove)</a>
</p>
<% end -%>
<p id="newone">
<label>Key</label>
<%= text_field_tag "user_attribute[attrs][][key]", "" %>
<label>Name</label>
<%= text_field_tag "user_attribute[attrs][][name]", "" %>
<%= select_tag "user_attribute[attrs][][type]", options_for_select(["text_field"], "") %>
<a href="#" class="remove">(remove)</a>
</p>
<a href="#" class="add">(add)</a>
</fieldset>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "user_attribute_form" %>
<% end -%>