##// END OF EJS Templates
Added a translatable date formatter for every date displayed.
Vincent Duvert -
r2416:44f328d6 beta
parent child Browse files
Show More
@@ -345,6 +345,14 b' short_id = lambda x: x[:12]'
345 345 hide_credentials = lambda x: ''.join(credentials_filter(x))
346 346
347 347
348 def fmt_date(date):
349 if date:
350 return (date.strftime(_(u"%a, %d %b %Y %H:%M:%S").encode('utf8'))
351 .decode('utf8'))
352
353 return ""
354
355
348 356 def is_git(repository):
349 357 if hasattr(repository, 'alias'):
350 358 _type = repository.alias
@@ -25,7 +25,7 b''
25 25 %endif
26 26 </td>
27 27
28 <td>${l.action_date}</td>
28 <td>${h.fmt_date(l.action_date)}</td>
29 29 <td>${l.user_ip}</td>
30 30 </tr>
31 31 %endfor
@@ -46,7 +46,7 b''
46 46 <td>${h.link_to(user.username,h.url('edit_user', id=user.user_id))}</td>
47 47 <td>${user.name}</td>
48 48 <td>${user.lastname}</td>
49 <td>${user.last_login}</td>
49 <td>${h.fmt_date(user.last_login)}</td>
50 50 <td>${h.bool2icon(user.active)}</td>
51 51 <td>${h.bool2icon(user.admin)}</td>
52 52 <td>${h.bool2icon(bool(user.ldap_dn))}</td>
@@ -17,7 +17,7 b''
17 17 h.url('files_home',repo_name=c.repo_name,revision=book[1].raw_id))}</span>
18 18 </span>
19 19 </td>
20 <td><span class="tooltip" title="${h.age(book[1].date)}">${book[1].date}</span></td>
20 <td><span class="tooltip" title="${h.age(book[1].date)}">${h.fmt_date(book[1].date)}</span></td>
21 21 <td title="${book[1].author}">${h.person(book[1].author)}</td>
22 22 <td>
23 23 <div>
@@ -17,7 +17,7 b''
17 17 h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
18 18 </span>
19 19 </td>
20 <td><span class="tooltip" title="${h.age(branch[1].date)}">${branch[1].date}</span></td>
20 <td><span class="tooltip" title="${h.age(branch[1].date)}">${h.fmt_date(branch[1].date)}</span></td>
21 21 <td title="${branch[1].author}">${h.person(branch[1].author)}</td>
22 22 <td>
23 23 <div>
@@ -35,7 +35,7 b''
35 35 h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
36 36 </span>
37 37 </td>
38 <td><span class="tooltip" title="${h.age(branch[1].date)}">${branch[1].date}</span></td>
38 <td><span class="tooltip" title="${h.age(branch[1].date)}">${h.fmt_date(branch[1].date)}</span></td>
39 39 <td title="${branch[1].author}">${h.person(branch[1].author)}</td>
40 40 <td>
41 41 <div>
@@ -57,7 +57,7 b''
57 57 </div>
58 58 <div title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</div>
59 59 </div>
60 <div class="date">${cs.date}</div>
60 <div class="date">${h.fmt_date(cs.date)}</div>
61 61 </div>
62 62 <div class="mid">
63 63 <div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
@@ -31,7 +31,7 b''
31 31 r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
32 32 </div>
33 33 <div class="date">
34 ${c.changeset.date}
34 ${h.fmt_date(c.changeset.date)}
35 35 </div>
36 36 <div class="diff-actions">
37 37 <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show')}" title="${_('raw diff')}" class="tooltip"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a>
@@ -40,7 +40,7 b''
40 40 <td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),14)}"/></div></td>
41 41 <td>${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</td>
42 42 <td><div class="author">${h.person(cs.author)}</div></td>
43 <td><span class="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td>
43 <td><span class="tooltip" title="${h.age(cs.date)}">${h.fmt_date(cs.date)}</span></td>
44 44 <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div></td>
45 45 </tr>
46 46 %endfor
@@ -95,7 +95,7 b''
95 95 </td>
96 96 <td>
97 97 %if node.is_file():
98 <span class="tooltip" title="${node.last_changeset.date}">
98 <span class="tooltip" title="${h.fmt_date(node.last_changeset.date)}">
99 99 ${h.age(node.last_changeset.date)}</span>
100 100 %endif
101 101 </td>
@@ -16,7 +16,7 b''
16 16 <div class="code-header">
17 17 <div class="stats">
18 18 <div class="left img"><img src="${h.url('/images/icons/file.png')}"/></div>
19 <div class="left item"><pre class="tooltip" title="${c.file.changeset.date}">${h.link_to("r%s:%s" % (c.file.changeset.revision,h.short_id(c.file.changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id))}</pre></div>
19 <div class="left item"><pre class="tooltip" title="${h.fmt_date(c.file.changeset.date)}">${h.link_to("r%s:%s" % (c.file.changeset.revision,h.short_id(c.file.changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id))}</pre></div>
20 20 <div class="left item"><pre>${h.format_byte_size(c.file.size,binary=True)}</pre></div>
21 21 <div class="left item last"><pre>${c.file.mimetype}</pre></div>
22 22 <div class="buttons">
@@ -89,7 +89,7 b''
89 89 </td>
90 90 ##LAST CHANGE DATE
91 91 <td>
92 <span class="tooltip" title="${repo['last_change']}">${h.age(repo['last_change'])}</span>
92 <span class="tooltip" title="${h.fmt_date(repo['last_change'])}">${h.age(repo['last_change'])}</span>
93 93 </td>
94 94 ##LAST REVISION
95 95 <td>
@@ -24,7 +24,7 b''
24 24 </span>
25 25 </div>
26 26 <div class="journal_action_params">${h.literal(h.action_parser(entry)[1]())}</div>
27 <div class="date"><span class="tooltip" title="${entry.action_date}">${h.age(entry.action_date)}</span></div>
27 <div class="date"><span class="tooltip" title="${h.fmt_date(entry.action_date)}">${h.age(entry.action_date)}</span></div>
28 28 %endfor
29 29 </div>
30 30 </div>
@@ -19,7 +19,7 b''
19 19 h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id),
20 20 title=cs.message)}
21 21 </td>
22 <td><span class="tooltip" title="${cs.date}">
22 <td><span class="tooltip" title="${h.fmt_date(cs.date)}">
23 23 ${h.age(cs.date)}</span>
24 24 </td>
25 25 <td title="${cs.author}">${h.person(cs.author)}</td>
@@ -18,7 +18,7 b''
18 18 </span>
19 19 </span>
20 20 </td>
21 <td><span class="tooltip" title="${h.age(tag[1].date)}">${tag[1].date}</span></td>
21 <td><span class="tooltip" title="${h.age(tag[1].date)}">${h.fmt_date(tag[1].date)}</span></td>
22 22 <td title="${tag[1].author}">${h.person(tag[1].author)}</td>
23 23 <td>
24 24 <div>
General Comments 0
You need to be logged in to leave comments. Login now