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
17
18
from loggerhead.zptsupport import zpt
40
def file_change_summary(url, entry, modified_file_link):
41
def file_change_summary(url, entry, link_style='normal', currently_showing=None):
42
if link_style == 'fragment':
43
def file_link(filename):
45
print filename, currently_showing, filename == currently_showing
46
if filename == currently_showing:
47
return '<b><a href="#%s">%s</a></b>' % (
48
cgi.escape(filename), cgi.escape(filename))
50
return revision_link(url, entry.revno, filename)
52
return '<a href="#%s">%s</a>' % (
53
cgi.escape(filename), cgi.escape(filename))
55
file_link = lambda filename: revision_link(url, entry.revno, filename)
41
56
return _pt('revisionfilechanges').expand(
42
url=url, entry=entry, modified_file_link=modified_file_link,
57
url=url, entry=entry, file_link=file_link,
58
currently_showing=currently_showing, **templatefunctions)
47
def revisioninfo(url, branch, entry, modified_file_link=None):
62
def revisioninfo(url, branch, entry, include_file_list=False, currently_showing=None):
48
63
from loggerhead import util
49
64
return _pt('revisioninfo').expand(
50
65
url=url, change=entry, branch=branch, util=util,
51
modified_file_link=modified_file_link,
66
include_file_list=include_file_list, currently_showing=currently_showing,
52
67
**templatefunctions)
87
def modified_file_link_rev(url, entry, item):
88
return _pt('modified-file-link-rev').expand(
89
url=url, entry=entry, item=item,
94
def modified_file_link_log(url, entry, item):
95
return _pt('modified-file-link-log').expand(
96
url=url, entry=entry, item=item,
101
102
def search_box(branch, navigation):
102
103
return _pt('search-box').expand(branch=branch, navigation=navigation,
103
104
**templatefunctions)
112
113
def menu(branch, url, fileview_active=False):
113
114
return _pt('menu').expand(branch=branch, url=url,
114
115
fileview_active=fileview_active, **templatefunctions)
119
def annotate_link(url, revno, path):
120
return '<a href="%s" title="Annotate %s">%s</a>'%(
121
url(['/annotate', revno, path]), cgi.escape(path), cgi.escape(path))
124
def revision_link(url, revno, path):
125
return '<a href="%s" title="View changes to %s in revision %s">%s</a>'%(
126
url(['/revision', revno, path]), cgi.escape(path), cgi.escape(revno),