<% context = context_form 
   @context = context-%>
<div id="<%= dom_id(context, 'edit') %>" class="edit-form" style="display:none;">
  <% form_tag(context_path(context), {:id => dom_id(context, 'edit_form'), :class => "inline-form "+dom_id(context, 'edit_form')+"-edit-context-form edit-context-form", :method => :put}) do -%>
              <%= error_messages_for 'context' %>
  
    <label for="context_name">Context name</label><br/>
    <%= text_field('context', 'name', :class => 'context-name') %><br/>

    <label for="context_hide">Hide from front page?</label>    
    <%= check_box('context', 'hide', :class => 'context-hide') %>
    <input type="hidden" name="wants_render" value="true" /> 
  
    <div class="submit_box">
      <div class="widgets">
        <button type="submit" class="positive" id="<%= dom_id(context, 'submit') %>" tabindex="15">
          <%=image_tag("accept.png", :alt => "") %>
          Update
        </button>
        <a href="javascript:void(0);" onclick="Element.toggle('<%= dom_id(context) %>');Element.toggle('<%= dom_id(context, 'edit') %>');" class="negative">
          <%=image_tag("cancel.png", :alt => "") %>
          Cancel
        </a>
      </div>
    </div>
    <br/><br/>
  
    <% end %>
  <%= apply_behavior ".edit-context-form", make_remote_form(
      :before => "this.up('div.edit-form').down('button.positive').startWaiting()",
      :condition => "!(this.up('div.edit-form').down('button.positive')).isWaiting()"), 
      :external => true
@context = nil %>
</div>

