aboutsummaryrefslogtreecommitdiffstats
path: root/jm2l/templates/layout.mako
diff options
context:
space:
mode:
Diffstat (limited to 'jm2l/templates/layout.mako')
-rw-r--r--jm2l/templates/layout.mako43
1 files changed, 39 insertions, 4 deletions
diff --git a/jm2l/templates/layout.mako b/jm2l/templates/layout.mako
index 0a2c10e..4e1023b 100644
--- a/jm2l/templates/layout.mako
+++ b/jm2l/templates/layout.mako
@@ -45,9 +45,7 @@ DisplayYear = request.session.get('year', 2015)
<small>${DisplayYear}</small>&nbsp;<span class="caret"></span></a>
<ul class="dropdown-menu">
% for tmpyear in range(2015, 2005, -1):
- % if tmpyear==2014:
- <li class="disabled"><a href="#">Pas d'édition 2014</a></li>
- % else:
+ % if tmpyear!=2014:
<li><a href="/year/${tmpyear}">${tmpyear}</a></li>
% endif
% endfor
@@ -64,6 +62,9 @@ DisplayYear = request.session.get('year', 2015)
</a>
<ul class="dropdown-menu">
% if request.user:
+ % if request.user.Staff:
+ <li><a href="/Staff">Partie Staff</a></li>
+ % endif
<li><a href="/sign/out">Me déconnecter</a></li>
% else:
<li><a href="/participer-l-evenement#inscription">Je m'inscris</a></li>
@@ -112,8 +113,42 @@ DisplayYear = request.session.get('year', 2015)
## Then Handle Javascript
<script>
% for jsitem in context._kwargs['postpone_js']:
-${jsitem}
+${jsitem | n}
% endfor
+$.each( $('.fileupload'),
+ function( NumCtrl, Ctrl ) {
+ $("#"+Ctrl.id).fileupload({
+ // Uncomment the following to send cross-domain cookies:
+ //xhrFields: {withCredentials: true},
+ //url: '/uploader/proceed/'
+ url: this.action
+ });
+ // Enable iframe cross-domain access via redirect option:
+ $("#"+Ctrl.id).fileupload(
+ 'option',
+ 'redirect',
+ window.location.href.replace(
+ /\/[^\/]*$/,
+ '/cors/result.html?%s'
+ )
+ );
+ $("#"+Ctrl.id).addClass('fileupload-processing');
+ $.ajax({
+ // Uncomment the following to send cross-domain cookies:
+ //xhrFields: {withCredentials: true},
+ //url: this.action,
+ url: $("#"+Ctrl.id).fileupload('option', 'url'),
+ //url: "uploader/proceed/",
+ dataType: 'json',
+ context: $("#"+Ctrl.id)[0]
+ }).always(function () {
+ $(this).removeClass('fileupload-processing');
+ }).done(function (result) {
+ $(this).fileupload('option', 'done')
+ .call(this, $.Event('done'), {result: result}); //$(this)});
+ });
+ }
+);
</script>
</body>
</html>