-
Notifications
You must be signed in to change notification settings - Fork 2k
/
layout_base.html
279 lines (259 loc) · 11.8 KB
/
layout_base.html
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:i18n="http://genshi.edgewall.org/i18n"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
> <!--<![endif]-->
<xi:include href="_util.html" />
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>${page_title()} - ${g.site_title}</title>
<meta name="description" content="" />
<meta name="author" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="${h.url_for_static(g.favicon)}" />
<py:choose>
<py:when test="defined('optional_feed')">
${optional_feed()}
</py:when>
<py:otherwise>
<link rel="alternate" type="application/atom+xml" title="${g.site_title} - Recent Revision History" href="${h.url_for(controller='revision', action='list', format='atom', days=1)}" />
</py:otherwise>
</py:choose>
<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="${h.url_for_static('/scripts/vendor/jqueryui/1.8.14/css/jquery-ui.custom.css')}" type="text/css" media="screen, print" />
<link rel="stylesheet" href="${h.url_for_static('/css/bootstrap.min.css')}" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="${h.url_for_static('/css/chosen.css')}" type="text/css" />
<link rel="stylesheet" href="${h.url_for_static('/css/style.css?v=2')}" />
${jsConditionalForIe(9, '<script type="text/javascript" src="' + h.url_for_static('/scripts/vendor/html5shiv/html5.js') + '"></script>')}
<py:if test="defined('optional_head')">
${optional_head()}
</py:if>
${h.literal(getattr(g, 'template_head_end', ''))}
</head>
<body class="${request.environ.get('pylons.routes_dict', {}).get('action')}
${request.environ.get('pylons.routes_dict', {}).get('controller').split(':')[-1]}
${defined('body_class') and body_class()}
">
<div class="welcome-banner js-welcome-banner" style="display: none;">
<span>First time at ${g.site_title}? Visit our <a href="${h.url_for(controller='home', action='about')}">About page</a> to find out more.</span>
<button class="btn js-kill-button">x</button>
</div>
<div id="wrap">
<div class="header outer">
<header class="container">
<div class="menu account">
<span class="ckan-logged-in" style="display: none;">
<a href="${h.url_for(controller='user',action='me')}">${h.gravatar((c.userobj.email_hash if c and c.userobj else ''),size=20)}${c.user}</a>
<a href="${h.url_for('/user/logout')}">Logout</a>
</span>
<span class="ckan-logged-out">
<a href="${h.url_for(controller='user',action='login')}">Login</a>
<a href="${h.url_for(controller='user',action='register')}">Register</a>
</span>
</div>
<a href="${h.url('home')}">
<img width="64" src="${h.url_for_static(g.site_logo)}" alt="${g.site_title} Logo" title="${g.site_title} Logo" id="logo" />
</a>
<div id="site-name">
<a href="${h.url('home')}">${g.site_title} — ${g.site_description}</a>
</div>
<div class="menu">
<span id="menusearch">
<form action="${h.url(controller='package', action='search')}" method="GET">
<input name="q" value="${c.q if hasattr(c, 'q') else ''}" class="search" placeholder="${_('Find datasets')}" />
</form>
</span>
<div id="mainmenu">
<span py:if="h.check_access('package_create')">${h.nav_link(c, _('Add a dataset'), controller='package', action='new')}</span>
${h.nav_link(c, _('Search'), controller='package', action='search', highlight_actions = 'new index')}
${h.nav_named_link(c, _('Groups'), name='%s_index' % h.default_group_type() )}
${h.nav_link(c, _('About'), controller='home', action='about')}
</div>
</div>
</header>
</div>
<py:with vars="messages = list(h._flash.pop_messages())">
<div class="flash-messages container">
<div class="alert ${m.category}" py:for="m in messages">
${h.literal(m)}
</div>
</div>
</py:with>
<div id="main" class="container" role="main">
<h1 py:if="defined('page_heading')" class="page_heading">${page_heading()}</h1>
<div class="row">
<div class="span12">
<div id="minornavigation">
<minornavigation></minornavigation>
</div>
</div>
</div>
<div class="row">
<div class="span9 content-outer">
<div id="content">
<py:if test="defined('content')">
${content()}
</py:if>
<content>
<p>Master content template placeholder … please replace me.</p>
</content>
</div> <!-- /content -->
</div>
<div class="span3 sidebar-outer">
<div id="sidebar">
<ul class="widget-list">
<py:if test="defined('primary_sidebar_extras')">
${primary_sidebar_extras()}
</py:if>
<primarysidebar>
<!-- Primary Side Bar Goes Here -->
</primarysidebar>
</ul>
</div>
</div>
</div>
</div>
<br/><br/>
</div>
<div class="clearfix"></div>
<div class="footer outer">
<footer class="container">
<div class="row">
<div class="span3">
<h3 class="widget-title">About ${g.site_title}</h3>
<div class="textwidget">
<ul>
<li>${h.link_to(_('About'), h.url_for(controller='home', action='about'))}</li>
<li>
<a href="http://twitter.com/ckanproject">Twitter @ckanproject</a>
</li>
<li>${h.link_to(_('API'), h.url_for(controller='api', action='get_api', ver=1))}</li>
<li>${h.link_to(_('API Docs'), 'http://wiki.ckan.net/API')}</li>
<li>
<a href="http://ckan.org/contact/">Contact Us</a>
</li>
<li>
<a href="http://okfn.org/privacy-policy/">Privacy Policy</a>
</li>
</ul>
</div>
</div>
<div class="span3">
<h3 class="widget-title">Sections</h3>
<div class="textwidget">
<ul>
<li>
<a href="${h.url(controller='user', action='index')}">
Users
</a>
</li>
<li>
<a href="${h.url(controller='tag', action='index')}">
Tags
</a>
</li>
<li py:if="'stats' in config.get('ckan.plugins','').split(' ')">
<a href="${h.url('stats')}">
Statistics
</a>
</li>
<li>
<a href="${h.url(controller='revision', action='index')}">
Revisions
</a>
</li>
<li>
<a href="${h.url(controller='authorization_group', action='index')}">
Authorization Groups
</a>
</li>
<li>
<a href="${h.url_for('ckanadmin_index')}">
Site Admin
</a>
</li>
</ul>
</div>
</div>
<div class="span3">
<h3 class="widget-title">Languages</h3>
<div class="textwidget">
<ul>
<?python
current_url = request.environ['CKAN_CURRENT_URL']
?>
<li py:for="locale in h.get_available_locales()">
<a href="${h.url(current_url, locale=str(locale))}">
${locale.display_name or locale.english_name}
</a>
</li>
</ul>
</div>
</div>
<div class="span3">
<h3 class="widget-title">Meta</h3>
<p id="credits">
© 2012
<img src="http://assets.okfn.org/images/logo/okf_logo_white_and_green_tiny.png" id="footer-okf-logo" />
<a href="http://okfn.org/">Open Knowledge Foundation</a>
Licensed under the <a href="http://opendatacommons.org/licenses/odbl/1.0/">Open Database License</a>
<a href="http://opendefinition.org/"><img alt="This Content and Data is Open" src="http://assets.okfn.org/images/ok_buttons/od_80x15_blue.png" style="border: none ; margin-bottom: -4px;"/></a>
<br/><br/>
Powered by <a href="http://ckan.org">CKAN</a> v${c.__version__}.<br/>
</p>
</div>
</div>
</footer>
</div> <!-- eo #container -->
<script src="${h.url_for_static('/scripts/vendor/jquery/1.7.1/jquery.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/json2.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.tmpl/beta1/jquery.tmpl.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.cookie/jquery.cookie.min.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.chosen/0.9.7/chosen.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.placeholder/jquery.placeholder.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jqueryui/1.8.14/jquery-ui.min.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/bootstrap/2.0.0/bootstrap.js')}"></script>
<!-- for ckanjs etc -->
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/underscore/1.1.6/underscore.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/backbone/0.5.1/backbone.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.fileupload/20110801/jquery.iframe-transport.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/jquery.fileupload/20110801/jquery.fileupload.js')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/vendor/ckanjs/1.0.0/ckanjs.js')}"></script>
<!-- Translated js strings live inside an html template. -->
<xi:include href="js_strings.html" />
<!-- finally our application js that sets everything up-->
<script type="text/javascript" src="${h.url_for_static('/scripts/application.js?lang=${c.locale}')}"></script>
<script type="text/javascript" src="${h.url_for_static('/scripts/templates.js')}"></script>
<script src="${h.url_for_static('/scripts/vendor/modernizr/1.7/modernizr.min.js')}"></script>
<script type="text/javascript">
CKAN.plugins = [
// Declare js array from Python string
${['\'%s\', '%s for s in config.get('ckan.plugins','').split(' ')]}
];
<py:if test="config.get('ckan.storage.bucket', '')">
CKAN.plugins.push('storage');
</py:if>
CKAN.SITE_URL = '${h.url('/')}';
// later use will add offsets with leading '/' so ensure no trailing slash
CKAN.SITE_URL = CKAN.SITE_URL.replace(/\/$/, '');
$(document).ready(function() {
var ckan_user = '${c.user}';
if (ckan_user) {
$(".ckan-logged-out").hide();
$(".ckan-logged-in").show();
}
$('input[placeholder], textarea[placeholder]').placeholder();
$(".chzn-select").chosen();
});
</script>
<py:if test="defined('optional_footer')">
${optional_footer()}
</py:if>
${h.literal(getattr(g, 'template_footer_end', ''))}
</body>
</html>