<tal:block replace="nothing">
-*- coding: utf-8 -*-
## CMFPlacefulWorkflow
## Copyright (C)2005 Ingeniweb

## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.

## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.

## You should have received a copy of the GNU General Public License
## along with this program; see the file COPYING. If not, write to the
## Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Workflow policy configuration template

# $Source: /cvsroot/ingeniweb/CMFPlacefulWorkflow/skins/CMFPlacefulWorkflow/placeful_workflow_configuration.pt,v $
# $Id: placeful_workflow_configuration.pt 41245 2007-04-28 10:28:26Z limi $
</tal:block>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      lang="en"
      metal:use-macro="here/main_template/macros/master"
      i18n:domain="cmfplacefulworkflow">

    <div metal:fill-slot="main"
         tal:define="type_list python:here.portal_types.listTypeInfo();
                     wf_list python:here.portal_workflow.objectIds();
                     policy_config python:here.portal_placeful_workflow.getWorkflowPolicyConfig(here);
                     container_policy_config python:here.portal_placeful_workflow.getWorkflowPolicyConfig(container);">

        <h1 i18n:translate="heading_workflow_policies">
            Workflow policies' local configuration management
        </h1>

        <p class="documentDescription"
           i18n:translate="description_workflow_policies">
            Set your workflow policies' local configuration for this folder and below.
        </p>

        <p class="documentDescription"
           tal:condition="python:not policy_config and here.isPrincipiaFolderish">
            <br/>
            <a href="placeful_workflow_configuration_add"
               i18n:translate="description_add_workflow_policy_for_type">
                Add a workflow policy's local configuration in the
                <span tal:content="python:here.translate(here.portal_type)"
                      i18n:name="portal_type">
                    portal type
                </span>
            </a>
            <br/>
            <br/>
        </p>

        <p tal:condition="python:not here.isPrincipiaFolderish and not container_policy_config">
            <a href=""
               tal:attributes="href python:container.absolute_url()+'/placeful_workflow_configuration_add'"
               i18n:translate="description_add_workflow_policy">
                Add Workflow policy's local configuration
            </a>
        </p>

        <p tal:condition="python:not here.isPrincipiaFolderish and container_policy_config">
            <span tal:define="dummy python:context.REQUEST.RESPONSE.redirect(container.absolute_url()+'/placeful_workflow_configuration')" />
        </p>

        <form id="edit_form"
              name="edit_form"
              method="post"
              action="placeful_workflow_configuration_set"
              tal:condition="policy_config">

            <fieldset tal:define="policies python:here.portal_placeful_workflow.getWorkflowPolicies();
                                  policy_in python:policy_config.getPolicyIn();
                                  policy_in_id python:policy_config.getPolicyInId();
                                  policy_below python:policy_config.getPolicyBelow();
                                  policy_below_id python:policy_config.getPolicyBelowId()">

                <legend i18n:translate="legend_publishing_details">
                    Workflow policies
                </legend>

                <strong i18n:translate="label_in_this_folder">For this Folder</strong>
                <div class="formHelp"
                     i18n:translate="description_in_this_folder">
                    Modify the workflows of this folder and below. If you don't want
                    to modify the workflow of this Folder use 'Below this Folder'.
                </div>

                <div class="field">

                    <tal:policy tal:repeat="policy python:policies">

                        <input type="radio"
                               class="noborder"
                               name="policy_in"
                               value="policy"
                               id="cb_policy"
                               tal:attributes="id python:'cb_policy_' + policy.id;
                                               value python:policy.id;
                                               checked python:policy.id==policy_in_id" />

                        <label for="cb_policy"
                               tal:attributes="for python:'cb_'+policy.id"
                               tal:content="python:policy.getTitle() or policy.getId()">
                            Policy Label
                        </label>
                        <br />
                        <span class="formHelp"
                              tal:content="python:policy.getDescription()">
                            Workflow policy description
                        </span>
                        <br />
                    </tal:policy>

                    <input type="radio"
                           class="noborder"
                           name="policy_in"
                           id="cb_default_policy"
                           title=""
                           checked="1"
                           tal:attributes="value python:'';
                                           checked python:not policy_in" />

                    <label for="cb_default_policy"
                           i18n:translate="label_default_policy">
                        Default Policy
                    </label>
                    <br />
                    <span class="formHelp"
                          i18n:translate="help_default_workflow_policy">
                        The default workflow policy.
                    </span>
                    <br />
                </div>

                <hr/>

                <strong i18n:translate="label_below_this_folder">Below this Folder</strong>
                <div class="formHelp"
                     i18n:translate="description_below_this_folder">
                    Modify the workflows only below this Folder. If you want to
                    modify the workflow of this Folder use 'In this Folder'.
                </div>

                <div class="field">

                    <tal:policy tal:repeat="policy python:policies">

                        <input type="radio"
                               class="noborder"
                               name="policy_below"
                               value="policy"
                               id="cb_policy"
                               tal:attributes="id python:'cb_policy_' + policy.id;
                                               value python:policy.id;
                                               checked python:policy.id==policy_below_id" />

                        <label for="cb_policy"
                               tal:attributes="for python:'cb_'+policy.id"
                               tal:content="python:policy.getTitle() or policy.getId()">
                            Policy Label
                        </label>
                        <br />
                        <span class="formHelp"
                              tal:content="python:policy.getDescription()">
                            Workflow policy description
                        </span>
                        <br />

                    </tal:policy>

                    <input type="radio"
                           class="noborder"
                           name="policy_below"
                           id="cb_default_policy"
                           title=""
                           checked="1"
                           tal:attributes="value python:'';
                                           checked python:not policy_below" />

                    <label for="cb_default_policy"
                           i18n:translate="label_default_policy">
                        Default Policy
                    </label>
                    <br />
                    <span class="formHelp"
                          i18n:translate="help_default_workflow_policy">
                        The default workflow policy.
                    </span>
                    <br />

                </div>

                <div class="formControls" i18n:domain="plone">

                    <input class="context"
                           type="submit"
                           name="submit"
                           value="Save"
                           i18n:attributes="value label_save;" />
                    <input class="standalone"
                           type="submit"
                           name="submit"
                           value="Cancel"
                           i18n:attributes="value label_cancel;" />
                </div>
            </fieldset>
        </form>

        <div metal:use-macro="here/document_byline/macros/byline">
            Get the byline - contains details about author and modification date.
        </div>

    </div>
</html>
