From e28dd82aa5beb9ef5ae92b33197d6185e89dd8ac Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 8 Sep 2016 16:04:51 +0200 Subject: [PATCH] Setup ManifestStaticFilesStorage --- common/settings.py | 2 ++ stages/static/js/attribution.js | 10 +++++----- templates/attribution.html | 1 - templates/class.html | 6 +++--- templates/corporation.html | 6 ++++-- templates/student_summary.html | 3 ++- templates/trainings_list.html | 5 +++-- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/common/settings.py b/common/settings.py index 3ada0de..9d5b421 100644 --- a/common/settings.py +++ b/common/settings.py @@ -112,6 +112,8 @@ INSTALLED_APPS = ( FILE_UPLOAD_HANDLERS = ["django.core.files.uploadhandler.TemporaryFileUploadHandler"] +STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage' + ALLOWED_HOSTS = ['localhost', 'stages.pierre-coullery.ch'] # Mapping between column names of a tabular file and Student field names diff --git a/stages/static/js/attribution.js b/stages/static/js/attribution.js index ed99092..a422a31 100644 --- a/stages/static/js/attribution.js +++ b/stages/static/js/attribution.js @@ -151,12 +151,12 @@ $(document).ready(function() { $('#student_detail').load( '/student/' + $(this).val() + '/summary/?period=' + $.cookie('periode'), function() { - $('div#previous_stages_head').toggle(function() { + $('div#previous_stages_head').click(function() { $('ul#previous_stages_list').toggle(); - $(this).find('img').attr('src', static_url + 'img/open.png'); - }, function() { - $('ul#previous_stages_list').toggle(); - $(this).find('img').attr('src', static_url + 'img/closed.png'); + var img = $(this).find('img'); + var cur_img = img.attr('src'); + img.attr('src', img.data('imgtoggle')); + img.data('imgtoggle', cur_img); }); }).addClass("filled"); current_student = $(this).val(); diff --git a/templates/attribution.html b/templates/attribution.html index c9bc996..386147d 100644 --- a/templates/attribution.html +++ b/templates/attribution.html @@ -40,7 +40,6 @@ - {% endblock %} {% block breadcrumbs %} diff --git a/templates/class.html b/templates/class.html index 7ed5d9a..d673c0e 100644 --- a/templates/class.html +++ b/templates/class.html @@ -1,5 +1,5 @@ {% extends "admin/base_site.html" %} -{% load i18n %} +{% load i18n static %} {% block breadcrumbs %}