<% # encoding: utf-8 %>

  <%= f.error_messages %>
  <%#= debugger %>
	
  <div class="field">
    <%= f.label :category %><br />
	<%= f.select :web_link_category_id, @web_link_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ]} %>
  </div>
  
 <div class="field">
  <%= f.label :name %>
  <%= f.fields_for :name, (@web_link.new_record? ? @web_link.build_name : @web_link.name ) do |f| %>
   <% @site_valid_locales.each do |locale| %>
    <td>
     <%= I18nVariable.from_locale(locale) %>
     <%= f.text_field locale %>
    </td>
   <% end %>
  <% end %>
 </div>
  
  <div class="field">
    <%= f.label :url %><br />
    <%= f.text_field :url, :size => 60 %>
  </div>

 <div class="field">
  <%= f.label :describe %>
  <%= f.fields_for :context, (@web_link.new_record? ? @web_link.build_context : @web_link.context ) do |f| %>
   <% @site_valid_locales.each do |locale| %>
    <td>
     <%= I18nVariable.from_locale(locale) %>
     <%= f.text_area locale, :rows => 10, :cols => 40 %>
    </td>
   <% end %>
  <% end %>
 </div>
  
  <div class="field">
    <%= f.label :status %><br />
    <%= f.check_box :is_top %><%= t('top') %>
    <%= f.check_box :is_hot %><%= t('hot') %>
    <%= f.check_box :is_hidden %><%= t('hidden') %>
  </div>
  
  <div class="field">
    <%= f.label :tags %><br />
	<% @tags.each do |tag| %>
	<%= check_box_tag 'web_link[tag_ids][]', tag.id, @web_link.tag_ids.include?(tag.id)%>
	<%= tag[I18n.locale] %>
	<% end %>
  </div>
  
  <br />
  <br />
  
  
  <div class="actions">
    <%= f.submit %>
  </div>
 