<%= stylesheet_link_tag "jquery.miniColors" %>
<%= javascript_include_tag "jquery.miniColors.min" %>
<div id="form">
<%= form_for @event_category, :url=>  panel_calendar_new_back_end_event_categories_path(@event_category) do |f| %>
<h2>Add</h2>
  <div class="row-fluid">
    <div class="span2">
       <%= label_tag("color", t("calendar.color")) %>
       <%= f.text_field :color, :class => "color-picker miniColors span5", :size => "7", :maxlength => "7", :autocomplete=>"off",:value=>"9100FF" %>
    </div>
  </div>

  <div>
    <%= f.fields_for :name_translations do |name| %>
      <% @site_valid_locales.each_with_index do |locale, i| %>
        <div class="control-group">
          <%= label_tag(locale, t("calendar.name")+"-"+I18nVariable.from_locale(locale)) %>
          <div class="controls">
            <%= name.text_field locale, :class => "input-xxlarge", :size=>"30" %>
          </div>
        </div>
      <% end %>
    <% end %>
  </div>
  <div class="form-actions form-fixed pagination-right">
    <%= f.submit t("calendar.save"), :class=>"btn  btn-primary" %>
  </div>

<% end %>
</div>
<script type="text/javascript">
if($('.color-picker').length > 0){
    $('.color-picker').miniColors(); // just in category view
}
</script>