<% # encoding: utf-8 %>

<%= form_for(:writing_book_category, :remote => true, :url => @url, :method => @verb, :html => { :id => 'form_writing_book_category' } ) do |f| %>

	<h2><%= (@writing_book_category.new_record? ? 'Add' : 'Edit') %></h2>

	<div id="widget-title">
		<%= f.label :key %>
		<%= f.text_field :key %>
	</div>
	
	<div id="widget-title">
		<% if @types.is_localized?(:title) %>
			<%= f.fields_for :title_translations do |f| %>
			  <% @site_valid_locales.each do |locale| %>
					<div class="control-group">
						<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
						<div class="controls">
							<%= f.text_field locale, :class => 'input-xxlarge', :value => (@writing_book_category.title_translations[locale] rescue nil) %>
						</div>
					</div>
			  <% end %>
			<% end %>
		<% else %>
			<div id="widget-title">
				<%= f.label :title %>
				<%= f.text_field :title %>
			</div>
		<% end %>
	</div>
	
	<div id="widget-title">
		<%#= f.label :display %>
		<%#= f.radio_button :display, "List" List%>
		<%#= f.radio_button :display, "Picture" Picture%>
		<%# <br />顯示方式是設定在前台頁面時，資訊所呈現的樣式 %>
	</div>
  
  <div class="form-actions">
    <%= f.submit t('submit'), :class=>'btn btn-primary' %>
  </div>
  
<% end %>
 