<% @page_heading = _('Search Engine Optimization') %>
<% subtabs_for(:settings) %>

<%= error_messages_for 'blog' %>

<% form_tag :action => 'update' do %>
<div class="admin">
  <fieldset>
    <legend><%= _("Search Engine Optimisation")%></legend>
    <ul>
      <li>
        <label class="float"><%= _("Show blog name")%>:</label>
        <input type="radio" name="setting[title_prefix]" value="1" id="blog_title_prefix_1" <%= 'checked="checked"' if this_blog.title_prefix == 1 %>/>
        <label for="blog_title_prefix_1"><%= _("At the beginning of page title")%></label>
        <span class="float">
          <input type="radio" name="setting[title_prefix]" value="2" id="blog_title_prefix_2" <%= 'checked="checked"' if this_blog.title_prefix == 2 %>/>
          <label for="blog_title_prefix_2"><%= _("At the end of page title")%></label>
        </span>
        <span class="float">
          <input type="radio" name="setting[title_prefix]" value="0" id="blog_title_prefix_0" <%= 'checked="checked"' if this_blog.title_prefix == 0 %>/>
          <label for="blog_title_prefix_0"><%= _("Don't show blog name in page title")%></label>
        </span>
      </li>
      <li>
          <label class="float" for="permalink_format"><%= _("Format of permalink")%></label>
          <input type="text" name="setting[permalink_format]" id="permalink_format" size="25" value="<%=h this_blog.permalink_format %>" />
      </li>
      <li>
          <label class="float" for="google_analytics"><%= _("Google Analytics")%></label>
          <input type="text" name="setting[google_analytics]" id="google_analytics" size="25" value="<%=h this_blog.google_analytics %>" />
      </li>
      <li>
          <label class="float" for="meta_description"><%= _("Meta description")%></label>
          <textarea name="setting[meta_description]" id="meta_description" rows="5" cols="50"><%=h this_blog.meta_description %></textarea>
      </li>
      <li>
          <label class="float" for="meta_keywords"><%= _("Meta keywords")%></label>
          <input type="text" name="setting[meta_keywords]" id="meta_keywords" size="25" value="<%=h this_blog.meta_keywords %>" />
      </li>
      <li class="checkbox">
        <label class="float" for="rss_description"><%= _("Use RSS description")%>:</label>
        <input name="setting[rss_description]" id="rss_description" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.rss_description %> />
       <input name="setting[rss_description]" type="hidden" value="0" />
       <span class="float"><%= "#{_('This will display')} <em>#{_('Original article writen by')} ... #{_('and published on')} <a href='#{this_blog.base_url}'>#{this_blog.blog_name}</a> | <a href='#{this_blog.base_url}'>#{_('direct link to this article')}</a> | #{_('If you are reading this article elsewhere than')} <a href='#{this_blog.base_url}'>#{this_blog.blog_name}</a>, #{_('it has been illegally reproduced and without proper authorization')}</em> #{_('at the bottom of each of your post in the RSS feed')}"%></span>
      </li>
      <li class="checkbox">
        <label class="float" for="index_categories"><%= _("Index categories")%>:</label>
        <input name="setting[index_categories]" id="index_categories" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.index_categories %> />
        <input name="setting[index_categories]" type="hidden" value="0" />
        <span class="float"><%= _("Unchecking this box will add <code>noindex, follow</code> meta tags in every category page, removing them from search engines and preventing duplicate content issues") %></span>
      </li>
      <li class="checkbox">
        <label class="float" for="index_tags"><%= _("Index tags")%>:</label>
        <input name="setting[index_tags]" id="index_tags" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.index_tags %> />
        <input name="setting[index_tags]" type="hidden" value="0" />
        <span class="float"><%= _("Unchecking this box will add <code>noindex, follow</code> meta tags in every tags page, removing them from search engines and preventing duplicate content issues") %></span>
      </li>
      <li>
        <label class="float" for="robots"><%= _("Robots.txt")%></label>
        <textarea name="setting[robots]" id="robots" <%= 'readonly="true"' unless robot_writable? %> rows="10" cols="50"><%=h this_blog.robots %></textarea>
        <% unless robot_writable? -%>
          <span class=' float mandatory'><small><%= _("You robots.txt file is not writeable. Typo won't be able to write it")%></small></span>
        <% end -%>
      </li>
    </ul>
  </fieldset>
  <%= hidden_field_tag 'from', 'seo' %>  
  <%= render :partial => 'submit' %>
</div>
<% end %>
