Changeset 3949

Show
Ignore:
Timestamp:
07/03/08 16:42:24 (2 months ago)
Author:
doki_pen
Message:
  • Update template from ClearSilver? to Genshi
  • Update calendar to jquery-ui
  • Updates for Trac-0.11
    CSS is foobar
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • datefieldplugin/0.11/datefield/filter.py

    r2172 r3949  
    88import traceback 
    99 
     10datedict= {'y':'1996', 'm':'01', 'd': '01',} 
     11 
    1012class DateFieldModule(Component): 
    1113    """A module providing a JS date picker for custom fields.""" 
    1214     
    13     date_format = Option('datefield', 'format', default='dmy', 
    14                          doc='The format to use for dates. Valid values are dmy, mdy, and ymd.') 
     15    date_format = Option('datefield', 'format', default='dd/mm/yy', 
     16             doc='The format to use for dates. d - day of month (no ' + 
     17             'leading zero), dd - day of month (two digits), m - month ' + 
     18             '(no leading zero), mm - month (two digits), y - year (two ' + 
     19             'digits), yy - year (four digits), D - name of day (short), DD ' + 
     20             '- name of day (long), M - name of month (short), MM - name of ' + 
     21             'month (long) "..." - literal text \'\' - single quote, ' + 
     22             'anything else - literal text.') 
    1523    date_sep = Option('datefield', 'separator', default='/', 
    1624                      doc='The separator character to use for dates.') 
     
    2331 
    2432    def process_request(self, req): 
    25         req.hdf['datefield.ids'] = list(self._date_fields()) 
    26         req.hdf['datefield.calendar'] = req.href.chrome('datefield', 'calendar.png') 
    27         req.hdf['datefield.format'] = self.date_format 
    28         req.hdf['datefield.sep'] = self.date_sep 
    29          
    30         return 'datefield.cs', 'text/javascript'  
     33        self.log.debug("in datefield process_request") 
     34        global datedict 
     35        datefield = {} 
     36        datefield['calendar'] = req.href.chrome('datefield', 'calendar.png') 
     37        datefield['ids'] = list(self._date_fields()) 
     38        datefield['format'] = self.date_format 
     39        return 'datefield.html', {'datefield': datefield},'text/javascript'  
    3140     
    3241    # IRequestFilter methods 
     
    3443        return handler 
    3544             
    36     def post_process_request(self, req, template, content_type): 
     45    def post_process_request(self, req, template, data, content_type): 
    3746        if req.path_info.startswith('/newticket') or req.path_info.startswith('/ticket'): 
    38             add_script(req, 'datefield/jquery.pack.js') 
    39             add_script(req, 'datefield/jquery.datePicker.js') 
    40             add_stylesheet(req, 'datefield/datePicker.css') 
    41              
    42             # Add my dynamic JS junk 
    43             idx = 0 
    44             while req.hdf.get('chrome.scripts.%i.href'%idx): 
    45                 idx += 1 
    46             req.hdf['chrome.scripts.%s'%idx] = {'href': req.href.datefield('datefield.js'), 'type': 'text/javascript'} 
    47         return template, content_type 
     47            add_script(req, 'datefield/jquery-ui.js') 
     48            #add_stylesheet(req, 'datefield/jquery-ui.css') 
     49 
     50            req.chrome['scripts'].append({'href': req.href.datefield('datefield.js'), 'type': 'text/javascript'}) 
     51        return template, data, content_type 
    4852         
    4953    # ITemplateProvider methods 
  • datefieldplugin/0.11/setup.py

    r3948 r3949  
    88    version = '1.0.1', 
    99    packages = ['datefield'], 
    10     package_data = { 'datefield': ['templates/*.cs', 'htdocs/*.js', 'htdocs/*.css', 'htdocs/*.png' ] }, 
     10    package_data = { 'datefield': ['templates/*.html', 'htdocs/*.css', 'htdocs/*.js', 'htdocs/images/*.*' ] }, 
    1111 
    1212    author = 'Noah Kantrowitz', 
     
    2828    }, 
    2929) 
    30