<% @page_heading = _('Database migration') %>
<% subtabs_for(:settings) %>

<div id="settings">
  <div id="gensettings">
    <h3><%= _("Information")%></h3>
    <p>
      <label><%= _("Current database version")%>:</label>
      <span class="db_version"><%= @current_version %></span>
    </p>
    <p>
      <label><%= _("New database version")%>:</label>
      <span class="db_version"><%= @needed_version %></span>
    </p>
    <p>
      <label><%= _("Your database supports migrations")%>:</label>
      <span class="db_version"><%= @support ? _('yes') : _('no') %></span>
    </p>
  </div>

  <% unless @needed_migrations.blank? %>
  <div id="need">
    <h3><%= _("Needed migrations")%></h3>
    <ul>
      <% for migration in @needed_migrations %>
      <li><%= migration.humanize %></li>
      <% end %>
    </ul>
  </div>
  <% end %>

</div>

<% form_tag :action => 'migrate' do %>
<div id="operations" class="paginate l">
  <% if @current_version == @needed_version %>
  <strong><%= _("You are up to date!")%></strong>
  <% else %>
  <%= save(_("Update database now")) %>  <small><%= _("may take a moment")%></small>
  <% end %>
</div>
<% end %>
