annotate pylons_app/lib/filters.py @ 80:928416088790

reimplemented summary page, added few filters, removed age from models and made it as filter.
author Marcin Kuzminski <marcin@python-blog.com>
date Sat, 17 Apr 2010 22:17:17 +0200
parents cdf4fda66dd9
children db39d0ca5308
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
74
cdf4fda66dd9 Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
1 from mercurial import util
80
928416088790 reimplemented summary page,
Marcin Kuzminski <marcin@python-blog.com>
parents: 74
diff changeset
2 from mercurial.templatefilters import age as _age
74
cdf4fda66dd9 Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
3
80
928416088790 reimplemented summary page,
Marcin Kuzminski <marcin@python-blog.com>
parents: 74
diff changeset
4 age = lambda context, x:_age(x)
74
cdf4fda66dd9 Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
5 capitalize = lambda x: x.capitalize()
cdf4fda66dd9 Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
6 date = lambda x: util.datestr(x)
cdf4fda66dd9 Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
7 email = util.email
80
928416088790 reimplemented summary page,
Marcin Kuzminski <marcin@python-blog.com>
parents: 74
diff changeset
8 hgdate = lambda context, x: "%d %d" % x
928416088790 reimplemented summary page,
Marcin Kuzminski <marcin@python-blog.com>
parents: 74
diff changeset
9 isodate = lambda context, x: util.datestr(x, '%Y-%m-%d %H:%M %1%2')
928416088790 reimplemented summary page,
Marcin Kuzminski <marcin@python-blog.com>
parents: 74
diff changeset
10 isodatesec = lambda context, x: util.datestr(x, '%Y-%m-%d %H:%M:%S %1%2')
928416088790 reimplemented summary page,
Marcin Kuzminski <marcin@python-blog.com>
parents: 74
diff changeset
11 localdate = lambda context, x: (x[0], util.makedate()[1])
74
cdf4fda66dd9 Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
12 rfc822date = lambda context, x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2")
80
928416088790 reimplemented summary page,
Marcin Kuzminski <marcin@python-blog.com>
parents: 74
diff changeset
13 rfc3339date = lambda context, x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2")
928416088790 reimplemented summary page,
Marcin Kuzminski <marcin@python-blog.com>
parents: 74
diff changeset
14 time_ago = lambda context, x: util.datestr(_age(x), "%a, %d %b %Y %H:%M:%S %1%2")