[ZPT] CVS: Packages/Products/PageTemplates (Products/DC/PageTemplates) - ptAdd.zpt:1.1 ptEdit.zpt:1.1

evan@serenade.digicool.com evan@serenade.digicool.com
Fri, 11 May 2001 19:45:01 -0400


Update of /cvs-repository/Packages/Products/PageTemplates/www
In directory serenade:/home/evan/Zope/pt/lib/python/Products/PageTemplates2/www

Added Files:
	ptAdd.zpt ptEdit.zpt 
Log Message:
Created PageTemplateFile module and class.
Implemented alternate path '|' operator.
Added 'default' builtin.
Made Expression types available to python expressions as functions.
Changed the way render() calls DTML.



--- Added File ptAdd.zpt in package Packages/Products/PageTemplates ---
<h1 tal:replace="structure here/manage_page_header">Header</h1>

<h2 tal:define="form_title string:Add Page Template"
    tal:replace="structure here/manage_form_title">Form Title</h2>

<p class="form-help">
Page Templates allow you to use simple HTML or XML attributes to
create dynamic templates.  You may choose to upload the template text
from a local file by typing the file name or using the <em>browse</em>
button.
</p>

<form action="manage_addPageTemplate" method="post" 
 enctype="multipart/form-data">
<table cellspacing="0" cellpadding="2" border="0">
  <tr>
    <td align="left" valign="top">
    <div class="form-label">
    Id
    </div>
    </td>
    <td align="left" valign="top">
    <input type="text" name="id" size="40" />
    </td>
  </tr>
  <tr>
    <td align="left" valign="top">
    <div class="form-optional">
    File
    </div>
    </td>
    <td align="left" valign="top">
    <input type="file" name="file" size="25" value="" />
    </td>
  </tr>
  <tr>
    <td align="left" valign="top">
    </td>
    <td align="left" valign="top">
    <div class="form-element">
    <input class="form-element" type="submit" name="submit" 
     value=" Add " /> 
    <input class="form-element" type="submit" name="submit" 
     value=" Add and Edit " />
    </div>
    </td>
  </tr>
</table>
</form>

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

--- Added File ptEdit.zpt in package Packages/Products/PageTemplates ---
<h1 tal:replace="structure here/manage_page_header">Header</h1>
<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
    tal:replace="structure here/manage_tabs">Tabs</h2>

<form action="" method="post"
      tal:define="body request/text | here/read"
      tal:attributes="action request/URL1">
<input type="hidden" name=":default_method" value="pt_changePrefs">
<table width="100%" cellspacing="0" cellpadding="2" border="0">
  <tr>
    <td align="left" valign="middle">
    <div class="form-optional">
    Title
    </div>
    </td>
    <td align="left" valign="middle">
    <input type="text" name="title" size="40" 
           tal:attributes="value request/title | here/title" />
    </td>
    <td align="left" valign="middle">
    <div class="form-optional">
    Content-Type
    </div>
    </td>
    <td align="left" valign="middle">
    <input type="text" name="content_type" size="14" 
           tal:attributes="value request/content_type | here/content_type" />
    </td>
  </tr>
  <tr>
    <td align="left" valign="middle">
    <div class="form-label">
    Last Modified
    </div>
    </td>
    <td align="left" valign="middle">
    <div class="form-text" 
     tal:content="python:here.bobobase_modification_time().strftime('%Y-%m-%d %I:%M %p')">1/1/2000
    </div>
    </td>
    <td align="left" valign="top" colspan=2>
      <a href="source.html" tal:condition="here/html">Browse HTML source</a>
      <a href="source.xml" tal:condition="not:here/html">Browse XML source</a>
      <br>
      <input type="hidden" name="expand:int:default" value="0">
      <input type="checkbox" value="1" name="expand:int"
       tal:attributes="checked request/expand | here/expand">
      Expand macros when editing
    </td>
  </tr>
  <tr>
    <td align="left" valign="top" colspan="4">
  <div style="width: 100%;">
  <textarea name="text:text" wrap="off" style="width: 100%;"
   cols="50" rows="20"
   tal:attributes="cols request/form/dtpref_cols | request/dtpref_cols | default; rows request/form/dtpref_rows | request/dtpref_rows | default"
   tal:content="body">Template Body</textarea>
  </div>
    </td>
  </tr>

<tr>
  <td align="left" valign="top" colspan="4">
  <div class="form-element">
    <em tal:condition="here/wl_isLocked">Locked by WebDAV</em>
    <input tal:condition="not:here/wl_isLocked"
     class="form-element" type="submit" 
     name="pt_editAction:method" value="Save Changes">
  &nbsp;&nbsp;
  <input class="form-element" type="submit" name="height" value="Taller">
  <input class="form-element" type="submit" name="height" value="Shorter">
  <input class="form-element" type="submit" name="width" value="Wider">
  <input class="form-element" type="submit" name="width" value="Narrower">
  </div>
  </td>
</tr>
</table>
</form>

<p class="form-help">
You may upload the text for <span tal:replace="here/title_and_id" />
 using the form below.
Choose an existing file from your local computer by clicking
<em>browse</em> The contents of the file should be HTML or XML.  You
may click the following link to <a href="document_src">view or
download</a> the current text.
</p>

<form action="pt_upload" method="post" 
 enctype="multipart/form-data">
<table cellpadding="2" cellspacing="0" border="0">
<tr>
  <td align="left" valign="top">
  <div class="form-label">
  File &nbsp;
  </div>
  </td>
  <td align="left" valign="top">
  <input type="file" name="file" size="25" value="">
  </td>
</tr>
<tr>
  <td></td>
  <td align="left" valign="top">
  <div class="form-element">
    <em tal:condition="here/wl_isLocked">Locked by WebDAV</em>
    <input tal:condition="not:here/wl_isLocked"
    class="form-element" type="submit" value="Upload File">
  </div>
  </td>
</tr>
</table>
</form>

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