<form xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      name="$name"
      id="$name"
      method="$method"
      action="$action"
      enctype="$enctype"
      py:attrs="attrs">

  <py:def function="subfields(hidden_fields, fields, error_class='fielderror')">
    <py:for each="field in hidden_fields"
            py:with="ctx=c.widget.context_for(field.name)">
      ${field.display(**ctx)}<br/>
    </py:for>
    <py:for each="field in fields"
            py:with="ctx=c.widget.context_for(field.name)">
      <py:if test="field.show_label"><label for="$ctx.name">$field.label</label><br/></py:if>
      <py:if test="ctx.errors and field.show_errors"><span class="$error_class">$ctx.errors</span><br/></py:if>
      ${field.display(**ctx)}<br/>
    </py:for>
  </py:def>

  <py:with vars="ctx=c.widget.context_for('name'); field=fields.name">
    <label for="name">New List Name:</label>
    <py:if test="ctx.errors"><span class="$error_class">$ctx.errors</span><br/></py:if>
    ${c.app.project.shortname}-${field.display(**ctx)}@lists.sourceforge.net
    <br/>
  </py:with>
  <py:with vars="ctx=c.widget.context_for('description'); field=fields.description">
    <label for="description">Description:</label>
    <py:if test="ctx.errors"><span class="$error_class">$ctx.errors</span><br/></py:if>
    ${field.display(**ctx)}
    <br/>
  </py:with>
  <py:with vars="ctx=c.widget.context_for('is_public'); field=fields.is_public">
    <label for="is_public">Is this list public?</label>
    <py:if test="ctx.errors"><span class="$error_class">$ctx.errors</span><br/></py:if>
    ${field.display(**ctx)}
    <br/>
  </py:with>
  <label>&nbsp;</label>
  <py:for each="b in buttons">${b.display()}</py:for>
</form>
