<div id="display_box">
  <div id="list-contexts">
    <div id="contexts-empty-nd" style="display:<%= @no_contexts ? 'block' : 'none'%>;">
      <div class="message"><p>Currently there are no contexts</p></div>
    </div>
    <%= render :partial => 'context_listing', :collection => @contexts %>
  </div>
</div>

<div id="input_box">
  <a id="toggle-new-context-form" href="#" accesskey="n" title="Create a new context">Create new context &#187;</a>
  <div id="context_new" class="context_new" style="display:block">
    <% form_remote_tag :url => contexts_path, :method => :post, :html=> { :id => 'context-form', :name => 'context', :class => 'inline-form' } do -%>

      <div id="status"><%= error_messages_for('context') %></div>

      <label for="context_name">Context name</label><br />                               
      <%= text_field( "context", "name" ) %><br />

      <label for="new_context_on_front">Hide from front page?</label>
      <%= check_box( "context", "hide" ) %><br />
      
      <input type="submit" value="Add" />
    <% end -%>
  </div>
</div>
<%
sortable_element 'list-contexts', get_listing_sortable_options

apply_behavior '#toggle-new-context-form:click', :prevent_default => true do |page|
  page['context_new'].toggle
  page['context-form'].down('input').focus
  #page << "Form.focusFirstElement('context-form');"
end
-%>