<% # encoding: utf-8 %>

  <%= f.error_messages %>

	<!--Widget start-->
	
	<div id="sub-wiget">
		  
		<div id="widget-status" class="widget-box widget-size-300">
			<div class="widget-action clear">
				<a class="action"><i title="Setting the announcement state" class="icon-exclamation-sign icon-white tip"></i></a>
			</div>
			<h3 class="widget-title"><i class="icons-star-thin icons-white"></i>Status</h3>
			<div class="widget-content clear">
				<div class="controls">
					<%= content_tag :label,:class => "checkbox inline" do -%>
						<%= f.check_box :is_top %>
						<%= t('top') %>
					<% end -%>
					<%= content_tag :label,:class => "checkbox inline" do -%>
						<%= f.check_box :is_hot %>
						<%= t('hot') %>
					<% end -%>
					<%= content_tag :label,:class => "checkbox inline" do -%>
						<%= f.check_box :is_hidden %>
						<%= t('hide') %>
					<% end -%>
				</div>
			</div>
		</div>

		<div id="widget-tags" class="widget-box widget-size-300">
			<div class="widget-action clear">
				<a class="action"><i title="Setting" class="icon-cog icon-white tip"></i></a>
			</div>
			<h3 class="widget-title"><i class="icons-tag icons-white"></i>Tags</h3>
			<div class="widget-content clear form-horizontal">
				<% @tags.each do |tag| %>
					<%= content_tag :label,:class => "checkbox inline" do -%>
						<%= check_box_tag 'web_link[tag_ids][]', tag.id, @web_link.tag_ids.include?(tag.id)%>
						<%= tag[I18n.locale] %>
					<% end %>
				<% end %>
			</div>
		</div>  
  
	</div>
  
  
<!--Wiget End-->
<!--Post Start-->

	<div id="post-body">
		<div id="post-body-content" class="clear">
		
			<%= f.label :category ,t("web_resource.category")%>
			<%= f.select :web_link_category_id, @web_link_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ]} %>
			
			<ul class="nav nav-tabs">
				<% @site_valid_locales.each_with_index do |locale, i| %>
			    <li <%= ( i == 0 ) ? " class='active'" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
				<% end %>
			</ul>
			
			<div class="tab-content">
			
				<% @site_valid_locales.each_with_index do |locale, i| %>
				
				<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
					<div class="title">
						<%= f.label :name ,t("web_resource.name")%>
						<%= f.fields_for :name, (@web_link.new_record? ? @web_link.build_name : @web_link.name ) do |f| %>
							<%= I18nVariable.from_locale(locale) %>
							<%= f.text_field locale, :class=>'post-title' %>
						<% end %>
					</div>

					<div class="title">
						<%= f.label :describe,t("web_resource.describe") %>
						<%= f.fields_for :context, (@web_link.new_record? ? @web_link.build_context : @web_link.context ) do |f| %>
								<%= I18nVariable.from_locale(locale) %>
								<%= f.text_area locale, :style=>"width:100%" %>
						<% end %>
					</div>
					
				</div>

				<% end %>
				
			</div>

			<div class="title">
				<%= f.label :url,t("web_resource.url") %>
				<%= f.text_field :url %>
			</div>
			
		</div>
	
<!--Post End-->
	</div>

  
	<div class="form-actions">
	<%= f.submit t('submit'), :class=>'btn btn-primary' %>
	<%= link_to t('cancel'), get_go_back, :class=>"btn" %> 
	</div> 