[Zope-CVS] CVS: Products/NotifyList/skins/notify_list - add_addresses.py:1.1 address_add_form.pt:1.1 address_display_data.py:1.1 address_modify_form.pt:1.1 address_new_email_form.pt:1.1 address_new_group_form.pt:1.1 addresses_form.pt:1.1 change_address_group.py:1.1 change_address_group.py~:1.1 change_email_address.py:1.1 delete_address_group.py:1.1 delete_address_record.py:1.1 new_email_address.py:1.1 new_group_record.py:1.1 remove_addresses.py:1.1

Shane Hathaway shane@cvs.zope.org
Wed, 16 Jan 2002 17:28:21 -0500


Update of /cvs-repository/Products/NotifyList/skins/notify_list
In directory cvs.zope.org:/tmp/cvs-serv30731/skins/notify_list

Added Files:
	add_addresses.py address_add_form.pt address_display_data.py 
	address_modify_form.pt address_new_email_form.pt 
	address_new_group_form.pt addresses_form.pt 
	change_address_group.py change_address_group.py~ 
	change_email_address.py delete_address_group.py 
	delete_address_record.py new_email_address.py 
	new_group_record.py remove_addresses.py 
Log Message:
Notify list manipulation is now 90% functional.


=== Added File Products/NotifyList/skins/notify_list/add_addresses.py ===
## Script (Python) "add_addresses"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=ids=(), group_id=None, REQUEST=None
##title=
##
if group_id:
  context.addToGroupList(group_id, ids)
else:
  context.addToList(ids)

if REQUEST is not None:
  REQUEST['RESPONSE'].redirect(context.absolute_url()
   + '/addresses_form?group_id=' + group_id)


=== Added File Products/NotifyList/skins/notify_list/address_add_form.pt ===
<html>
<body>
<div tal:define="disp_data here/address_display_data;
                 name disp_data/name; infos disp_data/infos;
                 group_id python: request.get('group_id', '')">
<h3 align="center" tal:content="string: Add to ${name}">Notify list: Working at home</h3>

<form action="." method="POST" tal:attributes="action here/absolute_url">
<input type="hidden" name="group_id" tal:attributes="value group_id" />
<p><a href="." tal:attributes="href
      string:${here/absolute_url}/addresses_form?group_id=${group_id}"
      tal:content="python: group_id and 'Return to group' or 'Return to notify list'">
      Return to notify list</a></p>
<table>
 <tr tal:repeat="info python: here.listAllEmailsAndGroups(exclude_my_ids=(not group_id))">
  <td>
   <input type="checkbox" name="ids:list" value="someid" tal:attributes="value info/id" />
   <a href="address_modify_form" tal:attributes="href
      python: '%s/%s?id=%s&group_id=%s' % (
        here.absolute_url(),
        info['is_group'] and 'addresses_form' or 'address_modify_form',
        info['id'],
        info['is_group'] and info['id'] or request.get('group_id', '')
      )" tal:content="info/description">
      John Doe &lt;john@doe.name&gt;</a>
  </td>
 </tr>
 <tr>
  <td>
   <input type="submit" name="add_addresses:method" value="Add to list" />
   <input type="submit" name="address_new_email_form:method" value="New email..." />
   <input type="submit" name="address_new_group_form:method" value="New group..." />
  </td>
 </tr>
</table>
</form>
</div>

</body>
</html>


=== Added File Products/NotifyList/skins/notify_list/address_display_data.py ===
## Script (Python) "address_display_data"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
here = context
request = context.REQUEST

gid = request.get('group_id', None)
if gid:
  return {'name': 'Group: ' + here.getGroupName(gid), 'infos': here.listGroupContents(gid)}
else:
  return {'name': 'Notify list: ' + here.aq_parent.title, 'infos': here.listContents()}


=== Added File Products/NotifyList/skins/notify_list/address_modify_form.pt ===
<html>
<body>

<h3 align="center">Modify email</h3>

<form action="." method="POST" tal:attributes="action here/absolute_url">
<input type="hidden" name="group_id" tal:attributes="value request/group_id|nothing" />
<input type="hidden" name="id" tal:attributes="value request/id" />
<table tal:define="info python: here.getEmailInfo(request['id'])">
 <tr>
  <td>
   Name
  </td>
  <td>
   <input type="text" name="name" tal:attributes="value info/name" />
  </td>
 </tr>
 <tr>
  <td>
   Email
  </td>
  <td>
   <input type="text" name="email" tal:attributes="value info/email" />
  </td>
 </tr>
 <tr>
  <td colspan="2">
   <input type="submit" name="change_email_address:method" value="Modify" />
   <input type="submit" name="delete_address_record:method" value="Delete from all lists" />
   <input type="submit" name="address_add_form:method" value="Cancel" />
  </td>
 </tr>
</table>
</form>

</body>
</html>


=== Added File Products/NotifyList/skins/notify_list/address_new_email_form.pt ===
<html>
<body>

<h3 align="center">New email</h3>

<form action="." method="POST" tal:attributes="action here/absolute_url">
<input type="hidden" name="group_id" tal:attributes="value request/group_id|nothing" />
<table>
 <tr>
  <td>
   Name
  </td>
  <td>
   <input type="text" name="name" />
  </td>
 </tr>
 <tr>
  <td>
   Email
  </td>
  <td>
   <input type="text" name="email" />
  </td>
 </tr>
 <tr>
  <td colspan="2">
   <input type="submit" name="new_email_address:method" value="Add" />
   <input type="submit" name="address_add_form:method" value="Cancel" />
  </td>
 </tr>
</table>
</form>

</body>
</html>


=== Added File Products/NotifyList/skins/notify_list/address_new_group_form.pt ===
<html>
<body>

<h3 align="center">New group</h3>

<form action="." method="POST" tal:attributes="action here/absolute_url">
<input type="hidden" name="group_id" tal:attributes="value request/group_id|nothing" />
<table>
 <tr>
  <td>
   Name
  </td>
  <td>
   <input type="text" name="name" />
  </td>
 </tr>
 <tr>
  <td colspan="2">
   <input type="submit" name="new_group_record:method" value="Add" />
   <input type="submit" name="address_add_form:method" value="Cancel" />
  </td>
 </tr>
</table>
</form>

</body>
</html>


=== Added File Products/NotifyList/skins/notify_list/addresses_form.pt ===
<html>
<body>
<div tal:define="disp_data here/address_display_data;
                 name disp_data/name; infos disp_data/infos">
<h3 align="center" tal:content="name">Notify list: Working at home</h3>

<form action="." method="POST" tal:attributes="action here/absolute_url">
<input type="hidden" name="group_id" tal:attributes="value request/group_id|nothing" />
<table>
 <tr tal:condition="request/group_id|nothing">
  <td>
   <p><a href="." tal:attributes="href string:${here/absolute_url}/addresses_form"
       >Return to notify list</a></p>
   Group name:
   <input type="text" name="name" tal:attributes="value python:
            here.getGroupName(request['group_id'])" />
   <input type="submit" name="change_address_group:method" value="Change" />
   <input type="submit" name="delete_address_group:method" value="Delete group" />
   <br />&nbsp;
  </td>
 </tr>
 <tr tal:repeat="info infos">
  <td>
   <input type="checkbox" name="ids:list" value="someid" tal:attributes="value info/id" />
   <a href="address_modify_form" tal:attributes="href
      python: '%s/%s?id=%s&group_id=%s' % (
        here.absolute_url(),
        info['is_group'] and 'addresses_form' or 'address_modify_form',
        info['id'],
        info['is_group'] and info['id'] or request.get('group_id', '')
      )" tal:content="info/description">
      John Doe &lt;john@doe.name&gt;</a>
  </td>
 </tr>
 <tr>
  <td>
   <input type="submit" name="remove_addresses:method" value="Remove from list" />
   <input type="submit" name="address_add_form:method" value="Add..." />
  </td>
 </tr>
</table>
</form>
</div>

</body>
</html>


=== Added File Products/NotifyList/skins/notify_list/change_address_group.py ===
## Script (Python) "change_address_group"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=group_id, name='', REQUEST=None
##title=
##
context.changeGroup(group_id, name)
if REQUEST is not None:
  REQUEST['RESPONSE'].redirect(context.absolute_url()
   + '/addresses_form?group_id=' + group_id)


=== Added File Products/NotifyList/skins/notify_list/change_address_group.py~ ===
## Script (Python) "address_display_data"
##title=Produce an address list to be displayed TTW
##parameters=
here = context
request = context.REQUEST

gid = request.get('group_id', None)
if gid:
  return {'name': 'Group: ' + here.getGroupName(gid),
          'infos': here.listGroupContents(gid)}
else:
  return {'name': 'Notify list: ' + here.aq_parent.title,
          'infos': here.listContents()}



=== Added File Products/NotifyList/skins/notify_list/change_email_address.py ===
## Script (Python) "change_email_address"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=id, name='', email='', REQUEST=None
##title=
##
context.changeEmail(id, name, email)
if REQUEST is not None:
  REQUEST['RESPONSE'].redirect(context.absolute_url()
   + '/addresses_form?group_id=' + REQUEST.get('group_id', ''))


=== Added File Products/NotifyList/skins/notify_list/delete_address_group.py ===
## Script (Python) "delete_address_group"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=group_id, REQUEST=None
##title=
##
context.deleteRecord(group_id)
if REQUEST is not None:
  REQUEST['RESPONSE'].redirect(context.absolute_url()
   + '/addresses_form?group_id=' + group_id)


=== Added File Products/NotifyList/skins/notify_list/delete_address_record.py ===
## Script (Python) "delete_address_record"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=id
##title=
##
context.deleteRecord(id)
return context.addresses_form()


=== Added File Products/NotifyList/skins/notify_list/new_email_address.py ===
## Script (Python) "new_email_address"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=name='', email='', group_id=None, REQUEST=None
##title=
##
id = context.addEmail(name, email)
if group_id:
  context.addToGroupList(group_id, [id])
else:
  context.addToList([id])
if REQUEST is not None:
  REQUEST['RESPONSE'].redirect(context.absolute_url()
   + '/addresses_form?group_id=' + group_id)


=== Added File Products/NotifyList/skins/notify_list/new_group_record.py ===
## Script (Python) "new_group_record"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=name='', group_id=None, REQUEST=None
##title=
##
id = context.addGroup(name)
if group_id:
  context.addToGroupList(group_id, [id])
else:
  context.addToList([id])
if REQUEST is not None:
  REQUEST['RESPONSE'].redirect(context.absolute_url()
   + '/addresses_form?group_id=' + group_id)


=== Added File Products/NotifyList/skins/notify_list/remove_addresses.py ===
## Script (Python) "remove_addresses"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=ids=(), group_id=None, REQUEST=None
##title=
##
if group_id:
  context.removeFromGroupList(group_id, ids)
else:
  context.removeFromList(ids)
if REQUEST is not None:
  REQUEST['RESPONSE'].redirect(context.absolute_url()
   + '/addresses_form?group_id=' + group_id)