<!--
Copyright (c) 2002-2008 Infrae and contributors. All rights reserved.
See also LICENSE.txt
Version of this file: $Revision: 1.10 $
-->

<tal:block define="dummy python: here.REQUEST.RESPONSE.setHeader('Content-Type', 'text/html;; charset=UTF-8')" />

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>ServiceNews</title>
<link rel="stylesheet" type="text/css" href="/manage_page_style.css">

</head>

<body bgcolor="#ffffff" link="#000099" alink="#000099" vlink="#000099">

<tal:define define="global view here" />

<span tal:define="manage_tabs_message options/manage_tabs_message | nothing"
    tal:replace="structure here/manage_tabs">Tabs</span>

<h4><a href="../manage_services">Silva Services</a></h4>

<div class="upgrade_box" tal:condition="view/upgrade_required">
  <form action="." method="POST">
    <div class="form-title">Upgrade Silva News</div>
    <p class="form-text">
      Software version: <span tal:content="view/software_version" /><br />
      Content version: <span tal:content="view/content_version" /><br />
    </p>
    <p class="form-text" style="width:50%">
      The SilvaNews product that provides this service needs to be upgraded,
      press the button below to upgrade the contents so that they work correctly
      with the newly installed product code.<br /><br />
      Note that this may potentially take a long time and may make your Silva
      less responsive!
    </p>
    <input type="submit" name="upgrade:method" value="Upgrade now" />
  </form>
</div>

<tal:block condition="not:view/upgrade_required">
  <tal:define define="subject_tree view/subject_tree;
                      target_audience_tree view/target_audience_tree;
                      ">

    <table width="100%">
    <tr>
    <td width="50%" valign="top">

    <div class="form-title">Subjects</div><br />
    <form method="POST" action=".">
    <tal:repeat repeat="subjecttuple subject_tree">
    <tal:define define="subject python:subjecttuple[0]; title python: subjecttuple[1]; depth python:int(subjecttuple[2])">
    <input type="checkbox" name="subjects:list" tal:attributes="value subject" class="form-element">
    <span tal:replace="structure python: depth * 3 * '&nbsp;'" /><span tal:content="subject" class="form-text"></span>&nbsp;-&nbsp;<span tal:content="title" class="form-text" /><br />
    </tal:define>
    </tal:repeat>
    <input type="submit" name="manage_rename_start:method" value="Rename subject(s)" class="form-element">
    <input type="submit" name="manage_remove_subject:method" value="Remove subject(s)" class="form-element">
    <br /><br />
    <div class="form-label">Add subject</div>
    <div class="form-text">Id:</div>
    <input type="text" name="subject"><br />
    <div class="form-text">Title:</div>
    <input type="text" name="title"><br />
    <div class="form-text">Parent:</div>
    <select name="parent" class="form-element">
    <option value="" class="form-element">Root (top)</option>
    <tal:repeat repeat="subjecttuple subject_tree">
    <tal:define define="subject python:subjecttuple[0]; depth python:int(subjecttuple[2])">
    <option tal:content="structure python:depth * 2 * '&nbsp;' + subject" tal:attributes="value python:subject" class="form-element"></option>
    </tal:define>
    </tal:repeat>
    </select>
    <input type="submit" value="Add" name="manage_add_subject:method" class="form-element">
    <br /><br />
    </form>

    </td>
    <td valign="top">

    <div class="form-title">Target audiences</div><br />
    <form method="POST" action=".">
    <tal:repeat repeat="tatuple target_audience_tree">
    <tal:define define="target_audience python:tatuple[0]; title python: tatuple[1]; depth python:int(tatuple[2])">
    <input type="checkbox" name="target_audiences:list" tal:attributes="value target_audience" class="form-element">
    <span tal:replace="structure python: depth * 3 * '&nbsp;'" /><span tal:content="target_audience" class="form-text"></span>&nbsp;-&nbsp;<span tal:content="title" class="form-text" /><br />
    </tal:define>
    </tal:repeat>
    <input type="submit" name="manage_rename_start:method" value="Rename target audience(s)" class="form-element">
    <input type="submit" name="manage_remove_target_audience:method" value="Remove target audience(s)" class="form-element">
    <br /><br />
    <div class="form-label">Add target audience</div>
    <div class="form-text">Id:</div>
    <input type="text" name="target_audience"><br />
    <div class="form-text">Title:</div>
    <input type="text" name="title"><br />
    <div class="form-text">Parent:</div>
    <select name="parent" class="form-element">
    <option value="" class="form-element">Root (top)</option>
    <tal:repeat repeat="tatuple target_audience_tree">
    <tal:define define="target_audience python:tatuple[0]; depth python:int(tatuple[2])">
    <option tal:content="structure python:depth * 2 * '&nbsp;' + target_audience" tal:attributes="value python:target_audience" class="form-element"></option>
    </tal:define>
    </tal:repeat>
    </select>
    <input type="submit" value="Add" name="manage_add_target_audience:method" class="form-element">
    <br /><br />
    </form>

    </td>
    </tr>

    <form action="." method="post">
      <tr>
        <td colspan="2" class="form-title">
          Choose the locale
        </td>
      </tr>
      <tr>
        <td class="form-text"><br />
          Enter a country code (lowercase):<br />
          <input type="text" name="locale" tal:attributes="value view/locale" />
        </td>
        <td class="form-text">
        </td>
      </tr>
      <tr>
        <td class="form-text" tal:define="current view/date_format">
          Date format length:<br />
          <select name="date_format">
            <option value="short" tal:attributes="selected python:current == 'short' and 'selected' or None">
              short
            </option>
            <option value="medium" tal:attributes="selected python:current == 'medium' and 'selected' or None">
              medium
            </option>
            <option value="long" tal:attributes="selected python:current == 'long' and 'selected' or None">
              long
            </option>
            <option value="full" tal:attributes="selected python:current == 'full' and 'selected' or None">
              full
            </option>
          </select>
        </td>
        <td class="form-text">
        </td>
      </tr>
      <tr>
        <td class="form-text">
          <input type="submit" name="manage_set_locale:method" value="set locale" />
        </td>
        <td class="form-text">
        </td>
      </tr>
    </form>

    </table>
  </tal:define>
</tal:block>

<span tal:replace="structure here/manage_page_footer">Footer</span>
