~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/__init__.py

a bit tortuous, but fix the modified files links on the revision page

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
    return zpt(os.path.join(_base, 'templates', name + '.pt'))
9
9
 
10
10
 
11
 
def file_change_summary(url, entry, links=True):
 
11
def file_change_summary(url, entry, modified_file_link):
12
12
    return _pt('revisionfilechanges')(
13
 
        url=url, entry=entry, links=links,
 
13
        url=url, entry=entry, modified_file_link=modified_file_link,
14
14
        **templatefunctions)
15
15
 
16
 
def revisioninfo(url, branch, entry, includefilechanges=False):
 
16
def revisioninfo(url, branch, entry, modified_file_link=None):
17
17
    from loggerhead import util
18
18
    return _pt('revisioninfo')(
19
19
        url=url, change=entry, branch=branch, util=util,
20
 
        includefilechanges=includefilechanges,
 
20
        modified_file_link=modified_file_link,
21
21
        **templatefunctions)
22
22
 
23
 
 
24
23
def collapse_button(group, name, normal='block'):
25
24
    return _pt('collapse-button')(
26
25
        group=group, name=name, normal=normal, tg=turbogears,
38
37
        extra = ''
39
38
    return '(%s%s)'%(entry.revno, extra)
40
39
 
 
40
def modified_file_link_rev(url, entry, item):
 
41
    return _pt('modified-file-link-rev')(
 
42
        url=url, entry=entry, item=item,
 
43
        **templatefunctions)
 
44
 
 
45
def modified_file_link_log(url, entry, item):
 
46
    return _pt('modified-file-link-log')(
 
47
        url=url, entry=entry, item=item,
 
48
        **templatefunctions)
 
49
 
41
50
templatefunctions = {'file_change_summary': file_change_summary,
42
51
                     'revisioninfo': revisioninfo,
43
52
                     'collapse_button': collapse_button,
44
53
                     'collapse_all_button': collapse_all_button,
45
 
                     'revno_with_nick': revno_with_nick}
 
54
                     'revno_with_nick': revno_with_nick,
 
55
                     'modified_file_link_log': modified_file_link_log,
 
56
                     'modified_file_link_rev': modified_file_link_rev}