Download this file

lib.html    201 lines (182 with data), 8.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<html xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
py:strip="True">
<?python from allura.lib.security import has_neighborhood_access ?>
<ul py:def="project_tree(project)">
<li py:for="p in project.direct_subprojects">
<a href="${p.url()}">$p.shortname</a>
<py:if test="p.direct_subprojects">
${project_tree(p)}
</py:if>
</li>
</ul>
<py:def function="nav(s)">
<li>
<a py:if="s.url" href="$s.url" class="$s.className">$s.label</a>
<span py:if="not s.url" class="$s.className">$s.label</span>
<ul py:if="s.children">
<py:for each="ss in s.children">${nav(ss)}</py:for>
</ul>
</li>
</py:def>
<py:def function="main_menu()">
<div class="nav">
<div id="mainmenu" class="row">
<div class="column grid_2"><a href="/" class="sf_logo"><img src="${g.forge_static('images/sf10.png')}" alt="SourceForge" width="110" height="14"/></a></div>
<div class="column grid_10 tright">
<a href="/account/" py:if="c.user and c.user._id">Account</a>
<a href="/users/${c.user.username}" py:if="c.user and c.user._id">$c.user.display_name</a>
<a href="/auth/create_account" py:if="not c.user or not c.user._id">Register</a>
<a href="/auth/logout" py:if="c.user and c.user._id">Log Out</a>
<a href="${g.login_url}" py:if="not c.user or not c.user._id">Log In</a>
</div>
</div>
</div>
</py:def>
<py:def function="nav_menu()">
<div id="nav_menu_missing" py:if="not c.project"/>
<py:if test="c.project">
<div class="column grid_1">
<img py:if="c.project.icon" src="${c.project.url()}/icon" class="project_icon"/>
<img py:if="not c.project.icon" src="${g.forge_static('images/project_default.png')}" class="project_icon"/>
</div>
<div class="column grid_9">
<h1>
<a href="${c.project.url()}" py:if="c.project.shortname.endswith('--init--')">$c.project.neighborhood.name</a>
<a py:if="not c.project.shortname.endswith('--init--')" href="${c.project.url()}">$c.project.name</a>
</h1>
</div>
<div class="column grid_2">
<p class="neighborhood tright" py:if="c.project.neighborhood.name not in ['Projects', 'Users']">
<a href="${c.project.neighborhood.url()}">
<small>Project by</small><br/>
$c.project.neighborhood.name
<img py:if="c.project.neighborhood.icon" src="${c.project.neighborhood.url()}/icon" alt="$c.project.neighborhood.name Project"/>
<img py:if="not c.project.neighborhood.icon" src="${g.forge_static('images/project_default.png')}" alt="$c.project.neighborhood.name Project"/>
</a>
</p>
</div>
</py:if>
</py:def>
<py:def function="top_nav()">
<div id="nav_menu" class="row project" py:if="c.project">
<div class="column grid_9">
<ul class="ui-tab">
<li py:for="s in c.project.sitemap()" class="$s.className ${s.url in request.url and 'active' or ''}">
<a py:if="s.url" href="$s.url" class="ico-l"><b class="ui-icon ui-icon-${s.ui_icon or 'admin'}"></b> <span>$s.label</span></a>
<span py:if="not s.url">$s.label</span>
</li>
</ul>
</div>
</div>
</py:def>
<py:def function="sidebar_item(s)">
<li py:if="s.url" class="${request.url.find(s.url,-len(s.url)) != -1 and 'active' or None}">
<a href="$s.url" class="$s.className${s.ui_icon and ' ico-l' or ''}"><b py:if="s.ui_icon" class="ui-icon ui-icon-$s.ui_icon"></b> <span>$s.label</span><small py:if="s.small is not None">$s.small</small></a>
</li>
<py:if test="not s.url">
${Markup('&lt;/ul>')}
<span py:if="s.label" class="$s.className nav_head"><span py:if="s.ui_icon" class="ui-icon ui-icon-$s.ui_icon"></span>$s.label</span>
${Markup('&lt;ul class="sidebarmenu">')}
</py:if>
</py:def>
<py:def function="sidebar_menu()">
<div id="sidebar" class="column grid_2 menu">
<form id="search" py:if="c.app and c.app.searchable" method="GET" action="${c.app.url + 'search/'}">
<input name="q" class="border defaultText" type="text" title="Search ${c.app.config.options.mount_point.title()}"/>
</form>
<div py:if="not c.app or not c.app.searchable">&nbsp;</div>
<ul class="sidebarmenu">
<py:if test="getattr(c, 'custom_sidebar_menu', None)">
<py:for each="s in c.custom_sidebar_menu">${sidebar_item(s)}</py:for>
</py:if>
<py:if test="getattr(c, 'app', None)">
<py:for each="s in c.app.sidebar_menu()">${sidebar_item(s)}</py:for>
</py:if>
<py:if test="getattr(c, 'project', None) and not getattr(c, 'app', None)">
<py:for each="s in c.project.sidebar_menu()">${sidebar_item(s)}</py:for>
</py:if>
</ul>
</div>
</py:def>
<py:def function="crumbs(trail)">
<py:for each="i, (label, url) in enumerate(trail)">
<li class="${i == 0 and 'first' or None}">
<a py:if="url" href="$url">$label</a>
<span py:if="not url">$label</span>
</li>
</py:for>
</py:def>
<py:def function="path_links(parts)">
<py:for each="i, part in enumerate(parts)">/
<a href="${'./' + '../' * (len(parts)-i-1)}">$part
</a>
</py:for>/
</py:def>
<py:def function="text_field(name, label, value=None)">
<label for="$name">$label</label><br/>
<input type="text" id="$name" name="$name" class="text" value="$value"/><br/>
</py:def>
<py:def function="file_field(name, label)">
<label for="$name" py:if="label">$label</label>
<input type="file" id="$name" name="$name" class="text" /><br/>
</py:def>
<py:def function="text_area(name, label, value=None, **kw)">
<label for="$name">$label</label><br/>
<textarea id="$name" name="$name" py:attrs="kw">$value</textarea><br/>
</py:def>
<py:def function="select_field(name, label, options, value=None)">
<label for="$name">$label</label><br/>
<select id="$name" name="$name">
<py:for each="olbl, oval in options">
<option value="$oval" selected="${oval == value or None}">$olbl</option>
</py:for>
</select>
<br/>
</py:def>
<py:def function="radio_button(name, label, option, value=None)">
<py:if test="label">
<label for="$name">$label</label><br/>
</py:if>
<input type="radio" id="$name" name="$name" class="text" value="$option"
checked="${option==value and 'on' or None}"/><br/>
</py:def>
<py:def function="checkbox(name, label, checked)">
<input type="checkbox" id="$name" name="$name"
checked="${checked or None}"/>
<py:if test="label">
<label for="$name">$label</label>
</py:if>
<br/>
</py:def>
<py:def function="submit_button(value, name=None)">
<input type="submit" name="$name" value="$value"/><br/>
</py:def>
<py:def function="gravatar(user, **kw)">
<img py:if="user.preferences.email_address and 'size' in kw"
src="${g.gravatar(user.preferences.email_address, default=g.url('/u/'+user.username.replace('_', '-')+'/user_icon'), **kw)}"
alt="${user.display_name}"
title="${user.display_name}"
height="${kw['size']}"
width="${kw['size']}"/>
<img py:if="user.preferences.email_address and 'size' not in kw"
src="${g.gravatar(user.preferences.email_address, default=g.url('/u/'+user.username.replace('_', '-')+'/user_icon'), **kw)}"
alt="${user.display_name}"
title="${user.display_name}"/>
<img py:if="not user.preferences.email_address and 'size' in kw"
src="${'/u/'+user.username.replace('_', '-')+'/user_icon'}"
alt="${user.display_name}"
title="${user.display_name}"
height="${kw['size']}"
width="${kw['size']}"/>
<img py:if="not user.preferences.email_address and 'size' not in kw"
src="${'/u/'+user.username.replace('_', '-')+'/user_icon'}"
alt="${user.display_name}"
title="${user.display_name}"/>
</py:def>
<py:def function="email_gravatar(email, title=None, **kw)">
<img py:if="email" src="${g.gravatar(email, **kw)}" alt="${title or email}" title="${title or email}"/>
<img py:if="not email and 'size' not in kw" src="${g.forge_static('images/user.png')}" alt="${title}" title="${title}"/>
<img py:if="not email and 'size' in kw" src="${g.forge_static('images/user.png')}" alt="${title}" title="${title}" width="${kw['size']}" height="${kw['size']}"/>
</py:def>
</html>