Modify ↓
Opened 16 years ago
Last modified 10 years ago
#3693 new enhancement
Change where to display identicons
Reported by: | ghama | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | HackergotchiPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
I wanted to change where to display icons.
Here is the patch (Please change its option name as you like):
*** /home/ghama/web_ui.py 2008-09-11 12:53:03.000000000 +0900 --- hackergotchi/web_ui.py 2008-09-11 13:00:07.000000000 +0900 *************** *** 20,27 **** --- 20,30 ---- providers = OrderedExtensionsOption('hackergotchi', 'providers', IHackergotchiProvider, default='GravatarHackergotchiProvider, IdenticonHackergotchiProvider') + place = Option('hackergotchi', 'place', default='itemtop', + doc='where to show identicon [itemtop|nearname]') + implements(ITemplateStreamFilter, ITemplateProvider) anon_re = re.compile('([^<]+?)\s+<([^>]+)>', re.U) *************** *** 61,69 **** # Output the combined stream return itertools.chain(elm.generate(), stream) ! stream |= Transformer('//div[@id="content"]/dl/dt/a/span[@class="time"]').filter(f) add_stylesheet(req, 'hackergotchi/hackergotchi.css') return stream # ITemplateProvider methods --- 64,76 ---- # Output the combined stream return itertools.chain(elm.generate(), stream) ! if self.place == 'nearname': ! selector = '//div[@id="content"]/dl/dt/a/span[@class="author"]' ! else: ! selector = '//div[@id="content"]/dl/dt/a/span[@class="time"]' ! stream |= Transformer(selector).filter(f) add_stylesheet(req, 'hackergotchi/hackergotchi.css') return stream
Attachments (0)
Note: See
TracTickets for help on using
tickets.