13
13
# along with this program; if not, write to the Free Software
14
14
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
17
from loggerhead.zptsupport import zpt
41
def file_change_summary(url, entry, file_changes, style='normal', currently_showing=None):
42
if style == 'fragment':
43
def file_link(filename):
44
if currently_showing and filename == currently_showing:
45
return '<b><a href="#%s">%s</a></b>' % (
46
cgi.escape(filename), cgi.escape(filename))
49
url, entry.revno, filename, '#' + filename)
51
def file_link(filename):
52
return '<a href="%s%s" title="View changes to %s in revision %s">%s</a>'%(
53
url(['/revision', entry.revno]), '#' + filename, cgi.escape(filename),
54
cgi.escape(entry.revno), cgi.escape(filename))
40
def file_change_summary(url, entry, modified_file_link):
55
41
return _pt('revisionfilechanges').expand(
56
entry=entry, file_changes=file_changes, file_link=file_link, **templatefunctions)
42
url=url, entry=entry, modified_file_link=modified_file_link,
60
def revisioninfo(url, branch, entry, file_changes=None, currently_showing=None):
47
def revisioninfo(url, branch, entry, modified_file_link=None):
61
48
from loggerhead import util
62
49
return _pt('revisioninfo').expand(
63
50
url=url, change=entry, branch=branch, util=util,
64
file_changes=file_changes, currently_showing=currently_showing,
51
modified_file_link=modified_file_link,
65
52
**templatefunctions)
69
def branchinfo(branch):
70
if branch.served_url is not None:
71
return _pt('branchinfo').expand(branch=branch, **templatefunctions)
77
56
def collapse_button(group, name, branch, normal='block'):
78
57
return _pt('collapse-button').expand(
79
58
group=group, name=name, normal=normal, branch=branch,
79
def modified_file_link_rev(url, entry, item):
80
return _pt('modified-file-link-rev').expand(
81
url=url, entry=entry, item=item,
86
def modified_file_link_log(url, entry, item):
87
return _pt('modified-file-link-log').expand(
88
url=url, entry=entry, item=item,
100
93
def search_box(branch, navigation):
101
94
return _pt('search-box').expand(branch=branch, navigation=navigation,
102
95
**templatefunctions)
111
104
def menu(branch, url, fileview_active=False):
112
105
return _pt('menu').expand(branch=branch, url=url,
113
106
fileview_active=fileview_active, **templatefunctions)
117
def annotate_link(url, revno, path):
118
return '<a href="%s" title="Annotate %s">%s</a>'%(
119
url(['/annotate', revno, path]), cgi.escape(path), cgi.escape(path))
122
def revision_link(url, revno, path, frag=''):
123
return '<a href="%s%s" title="View changes to %s in revision %s">%s</a>'%(
124
url(['/revision', revno, path]), frag, cgi.escape(path),
125
cgi.escape(revno), cgi.escape(path))