Changeset 309
- Timestamp:
- 01/24/2014 04:21:04 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/trac.wordpress.org/templates/site.html
r308 r309 33 33 except (IndexError, KeyError): 34 34 pass 35 36 field_types = [ 'milestone', 'priority', 'type', 'severity', 'version', 'component', 'keywords', 'focuses', ] 37 38 # Sorting function 39 def sort_nicely(field1, field2): 40 try: 41 idx1 = field_types.index(field1['name']) 42 except ValueError: 43 idx1 = 1000 # no match, push to the end 44 45 try: 46 idx2 = field_types.index(field2['name']) 47 except ValueError: 48 idx2 = 1000 # no match, push to the end 49 50 return cmp(idx1, idx2) 51 52 if ticket and 'fields' in locals(): 53 # Sort the fields 54 fields.sort(cmp=sort_nicely) 55 56 # Re-generate fields_map for use within the ticket template 57 fields_map = {} 58 for i in xrange(0, len(fields)): 59 fields_map[ fields[i]['name'] ] = i 35 60 ?> 36 61
Note: See TracChangeset
for help on using the changeset viewer.