

<%= render :partial=>"infos"%>

<div id="roles-area" class="input-area">
<%=render :partial=>"user_role_data",:collection=>Role.all.asc("_id")%>
</div>


<% content_for :page_specific_javascript do -%>

<% ( params[:users_new_interface_id].blank? ? @fname = 'new_attribute_values' : @fname = 'attribute_values' ) %>

<!-- Text -->
<script id="template-text" type="text/x-tmpl">
  <div class="input-append">
    <input type="text" id="${roleType+'_text_'+appendIndex}" name="${'user[<%= @fname %>]['+nameNumber+'][value][]'}" class="input-medium" placeholder="">
    <a href="#" class="btn remove-input">
      <i class="icon-trash"></i>
    </a>
  </div>
</script>

<!-- Text Language -->
<script id="template-text-language" type="text/x-tmpl">
  <div class="input-append">
    <div class="tab-content">

      <% VALID_LOCALES.collect do |locale| %>
        <% active = (locale == @site_in_use_locales.first ? "active" : "") %>

      <div class="tab-pane fade <%= active %> in" id="${roleType+'_text_language_<%= locale %>_'+appendIndex}">
        <input type="text" name="${'user[<%= @fname %>]['+nameNumber+'][value][][<%= locale %>]'}" placeholder="<%= I18nVariable.from_locale(locale) %>" value="">
      </div>

      <% end %>

    </div>
    <div class="btn-group" data-toggle="buttons-radio">
      <% VALID_LOCALES.collect do |locale| %>
        <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
      <a class="btn <%= active %>" href="${'#'+roleType+'_text_language_<%= locale %>_'+appendIndex}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
      <% end %>
      <a href="#" class="btn remove-input"><i class="icon-trash"></i></a>
    </div>
  </div>
</script>

<!-- Address -->
<script id="template-address" type="text/x-tmpl">
  <div class="input-append">
    <div class="tab-content">
      <div class="tab-pane fade active in" id="${roleType+'_address_en_'+appendIndex}">
        <input type="text" name="${'user[new_attribute_values]['+nameNumber+'][value][en]'}" placeholder="Address" value="">
        <input type="hidden" id="${roleType+'_street_address_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][street_address]'}" value="">
        <input type="hidden" id="${roleType+'_cityarea_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][county]'}" value="">
        <input type="hidden" id="${roleType+'_city_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][city]'}" value="">
        <input type="hidden" id="${roleType+'_zip_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][zip]'}" value="">
        <input type="hidden" id="${roleType+'_county_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][country]'}" value="">
        <input type="hidden" id="${roleType+'_indicator_en_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][en][indicator]'}" value="">
      </div>
      <div class="tab-pane fade" id="${roleType+'_address_zh_tw_'+appendIndex}">
        <input type="text" name="${'user[new_attribute_values]['+nameNumber+'][value][zh_tw]'}" placeholder="地址" value="">
        <input type="hidden" id="${roleType+'_street_address_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][street_address]'}" value="">
        <input type="hidden" id="${roleType+'_cityarea_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][county]'}" value="">
        <input type="hidden" id="${roleType+'_city_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][city]'}" value="">
        <input type="hidden" id="${roleType+'_zip_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][zip]'}" value="">
        <input type="hidden" id="${roleType+'_county_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][country]'}" value="">
        <input type="hidden" id="${roleType+'_indicator_zh_tw_'+appendIndex}" name="${'user[new_attribute_values]['+nameNumber+'][address_ext][zh_tw][indicator]'}" value="">
      </div>
    </div>
    <div class="btn-group" data-toggle="buttons-radio">
      <a class="btn active" href="${'#'+roleType+'_address_en_'+appendIndex}" data-toggle="tab">English</a>
      <a class="btn" href="${'#'+roleType+'_address_zh_tw_'+appendIndex}" data-toggle="tab">Chinese</a>
      <a class="btn" href="#address-field" role="button" data-toggle="modal"><i class="icon-edit"></i></a>
      <a href="#" class="btn remove-input"><i class="icon-trash"></i></a>
    </div>
  </div>
</script>

<% end -%>