<html>


<metal:content define-macro="manager">
    <h1>Wiki Manager</h1>
    <h2>Settings</h2>
    <form method="post">
      <input type="hidden" name="form.action" value="apply" />
      <textarea rows="10" cols="50" name="config"
                tal:content="view/configForEditing" /><br />
      <input type="submit" name="apply" value="Apply" />
    </form>
    <h2>Wikis</h2>
    <table>
      <tr tal:repeat="wiki view/listWikis">
        <td>
          <a tal:attributes="href wiki/absolute_url"
             tal:content="wiki/title" />
        </td>
      </tr>
    </table>
</metal:content>


<metal:content define-macro="wiki">
    <h1 tal:content="context/title">Wiki</h1>
    <div>
      <a tal:attributes="href string:${context/absolute_url}/@@media.html"
         i18n:translate="">Media Manager</a></div>
    <h2 i18n:translate="">Wiki Pages</h2>
    <div tal:repeat="page view/listPages">
      <a tal:attributes="href page/absolute_url"
         tal:content="page/title" /></div>
</metal:content>


<metal:content define-macro="wiki_edit">
    <h1>Edit Wiki: <span tal:content="context/title" /></h1>
    <form method="post">
      <input type="hidden" name="form_action" value="edit" />
      <div><label for="form_name">Short name</label></div>
      <div><input type="text" id="form_name" name="name"
                  tal:attributes="value context/name" /></div>
      <div><label for="form_title">Title</label></div>
      <div><input type="text" id="form_title" name="title"
                  tal:attributes="value context/title" /></div>
      <input type="submit" name="submit" value="Save" />
    </form>
</metal:content>


<metal:content define-macro="wikipage">
    <div metal:define-macro="edit">
      <tal:edit condition="python: view.view_mode == 'edit'">
        <h1>Edit <span tal:content="context/title">Wiki Page</span></h1>
        <form method="post"
              tal:attributes="action context/absolute_url">
          <input type="hidden" name="form_action" value="edit" />
          <div>
            <div>Title</div>
            <div>
                <input name="title" size="40"
                    tal:attributes="value context/title"/></div>
            </div>
          <div>
          <div>Text</div>
            <div>
                <textarea name="text" rows="15" cols="60"
                        tal:content="context/text" /></div>
            </div>
          <div>
            <div><input type="submit" value="Save" /></div><br />
          </div>
        </form>
      </tal:edit>
    </div>
    <div metal:define-macro="show">
      <h1 tal:content="context/title">Wiki Page</h1>
      <div tal:content="structure view/render" />
      <tal:show condition="view/showEditButton">
        <div>&nbsp;</div>
        <div>
          <a tal:attributes="href string:${context/absolute_url}/@@edit.html">Edit</a>
        </div>
      </tal:show>
    </div>
</metal:content>


<metal:portlet define-macro="navigation">
  <p>Menu</p>
</metal:portlet>


</html>
