view zpt/project/edit_basic.zpt @ 273:79f3f6492ec9

restrict projectType values in input field.
author casties
date Tue, 30 Sep 2014 16:31:02 +0200
parents 4eddd388d490
children
line wrap: on
line source

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html metal:use-macro="here/edit_template/macros/page">
<head>
</head>
<body>
  <tal:block metal:fill-slot="navsel" tal:define="global menusel string:basic" />
  <tal:block metal:fill-slot="body">
    <form method="post" action="editMPIWGProject">
      <input type="hidden" name="fromEdit" value="yes" />
      <table>
        <tr>
          <td><b>Project Title</b></td>
          <td><input name="WEB_title" tal:attributes="value here/getProjectTitle" size="80" /></td>
        </tr>
        <tal:block tal:repeat="field here/getEditableFields">
          <tr>
            <td><b tal:content="python:here.getFieldLabels()[field]" /></td>
            <td><input tal:attributes="name field; value python:here.getContent(field)" size=80 /></td>
          </tr>
        </tal:block>
        <tr tal:define="hasChildren here/getSubProjects">
          <td>Project is visible</td>
          <tal:x tal:condition="python:hasChildren and here.isActiveProject()">
            <td>visible (status cannot be changed, because the project has visible children.) <input
              tal:attributes="name python:'active'" value="true" type="hidden"></td>
          </tal:x>
          <tal:x tal:condition="python:(not hasChildren) or (hasChildren and not here.isActiveProject())">
            <td tal:condition="python:here.isActiveProject()"><input tal:attributes="name python:'active'" value="true" checked
              type="checkbox"></td>
            <td tal:condition="not:python:here.isActiveProject()"><input tal:attributes="name python:'active'" value="true"
              type="checkbox"> <tal:x tal:condition="hasChildren">
			 	 WARNING: This project is not visible, but has visible children.
			</tal:x></td>
          </tal:x>
        </tr>
        <tr>
          <td>Started at:</td>
          <td><input tal:attributes="name python:'startedAt';
								   value python:here.getStartedAt()" type="text" size="10" />
            (format dd.mm.yyyy or mm.yyyy or yyyy)</td>
        </tr>
        <tr>
          <td>Completed at:</td>
          <td><input tal:attributes="name python:'completedAt';
                   value python:here.getCompletedAt()"
            type="text" size="10" /> (format dd.mm.yyyy or mm.yyyy or yyyy)</td>
        </tr>
        <tr>
          <td>Type of project page:</td>
          <td>
            <select name="projectType">
              <option tal:repeat="val python:[None, 'Project', 'Department', 'Working Group', 'Theme', 'Info Page']" 
                tal:attributes="value val; selected python:(val == here.getProjectType());" tal:content="val"/>
            </select>
          </td>
        </tr>
      </table>

      <h2>Names</h2>
      <table tal:define="global count python:0;
        identifiedNames python:here.identifyNames(here.getResponsibleScientists());">
        <tr>
          <th>Name in project</th><th>MPIWG member object</th>
        </tr>
        <tr tal:condition="identifiedNames" tal:repeat="identifiedName identifiedNames/items">
          <tal:x tal:define="global count python:count+1" />
          <td><input type="hidden"
            tal:attributes="value python:identifiedName[0]; name python:'responsibleScientist_name_%s'%count" /> <span
            tal:replace="python:identifiedName[0]" /> <!-- <pre tal:content="python:repr(identifiedName)"/> --></td>
          <td>
            <table>
              <tr tal:repeat="member python:identifiedName[1]">
                <td tal:content="python:member.key" />
                <td tal:content="python:member.e_mail" />
                <td><input type="checkbox"
                  tal:attributes="name python:'responsibleScientist_key_%s'%count; value python:member.key;
                      checked python:here.isResponsibleScientist(member.key)" />
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      <p>
        <input type="submit" value="change" />
      </p>
    </form>

  </tal:block>
</body>
</html>