{% extends "soc/base.html" %}
{% comment %}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{% endcomment %}

{% block body %}
<p>
<p>
{% block instructions %}
Please use this form to set basic home page settings.
{% endblock %}
</p>
<p>
</p>
<form method="POST">
 <table>
	{{ settings_form.as_table }}
{% if home_doc %}
  <tr>
   <td colspan="4">&nbsp;</td>
  </tr>
{% comment %}
TODO(tlarsen): OK, this is pretty lame as well.  I think we need some sort
  of "Document preview" that can be appended to the end of the page. Also,
  There is way too much text on this page.  Can a UI wizard please fix this
  UI?
{% endcomment %}
  <tr>
   <td colspan="4">
An existing Document is currently selected to provide the body contents of the home page:
   </td>
  </tr>
  <tr>
   <td>&nbsp;</td>
   <td colspan="3">
    {{ home_doc.title }}
   </td> 
  </tr>
  <tr>
   <th>Path:</th>
   <td colspan="2">
    {{ home_doc.scope_path }}/{{ home_doc.link_id }}
   </td>
  </tr>
  <tr>
   <th>Created By:</th>
   <td colspan="2">
    {{ home_doc.author.link_id }}
   </td>
  </tr>
  <tr>
   <th>Created On:</th>
   <td colspan="2">
    {{ home_doc.created }}
   </td>
  </tr>
  <tr>
   <th>Modified:</th>
   <td colspan="2">
    {{ home_doc.modified }}
   </td>
  </tr>
{% endif %}
  <tr>
   <td colspan="4">
 <p>
 Any existing Document (to which access is permitted) can be used as the body contents of the home page.
 <ul>
  <li>
<a href="/document/edit">Create a new Document to use for the home page content here.</a>
  </li>
  <li>
<a href="/document/list">Edit an existing Document to use for the home page content here.</a>
  </li>
 </ul>
Then, specify the Document to use below:
</p>
   </td>
  </tr>
  <tr>
   <td colspan="4">&nbsp;</td>
  </tr>
	{{ doc_select_form.as_table }}
  <tr>
   <td colspan="4">&nbsp;</td>
  </tr>
   <table>
   <tr>
     {% block submit_buttons %}
    <td> 
     <input style="font-weight: bold" type="submit" value="Save Changes"/></span>
    </td>
    <td>
     <input type="button" onclick="location.href='/'" value="Cancel"/>
    </td>
    {% endblock %}
   </tr>
  </table>
</form>
</p>
{% endblock %}
