Changeset 5199 for WAeUP_SRP


Ignore:
Timestamp:
20 May 2010, 10:03:40 (15 years ago)
Author:
Henrik Bettermann
Message:

show creation date of pin batches

Location:
WAeUP_SRP/trunk/skins/waeup_pins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_pins/pins_view.pt

    r3079 r5199  
    6565            tal:attributes="class python:test(repeat['line'].even(), 'even ajaxtd', 'odd ajaxtd')">
    6666            <span tal:repeat="row line">
    67               <td align="left" valign="middle" style="width: 5px;">
     67              <td align="left" valign="middle" style="width: 5px;" tal:define="id python:row['id']">
    6868                <input type="checkbox" name="ids:list" value="" id="" class="noborder"
    69                        tal:define="id row"
     69                       
    7070                       tal:condition="archive_allowed"                       
    7171                       tal:attributes="value id;
     
    7474                       />
    7575              </td>
    76               <td><a href="view" tal:attributes="href string:${context/absolute_url}/${row}">
    77                   <strong tal:content="row" /></a> </td>
     76              <td width="8pt"><span tal:content="python:row['date_str']" /></td> 
     77              <td><a href="view" tal:attributes="href python:row['url']">
     78                  <strong tal:content="python:row['id']" /></a>
     79              </td>
    7880            </span>
    7981          </tr>
  • WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py

    r4203 r5199  
    1717    def set_trace():
    1818        pass
     19
     20import datetime
    1921
    2022request = REQUEST
     
    117119    view = context.batch_view
    118120elif context.portal_type == "ScratchCardBatchesFolder":
    119     batches = context.objectIds()
    120     batches.sort()
     121
     122    batches = []
     123    for id, object in context.objectItems():
     124        batch = {}
     125        batch['id'] = id
     126        batch['date'] = object.creation_date
     127        batch['url'] = object.absolute_url()
     128        batch['date_str'] = object.creation_date.strftime("%d/%m/%y")
     129        batches.append(batch)
     130    batches.sort(cmp=lambda x,y: cmp(x['id'].lower(), y['id'].lower()))
     131    #batches.sort(cmp=lambda x,y: cmp(x['date'], y['date']))
     132
     133    #from Products.zdb import set_trace;set_trace()
     134    #batches = context.objectIds()
     135    #batches.sort()
    121136    l = []
    122     cols = 6
     137    cols = 4
    123138    rows,rest = divmod(len(batches),cols)
    124139    bis = 0
Note: See TracChangeset for help on using the changeset viewer.