Commit a370d3dd authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

Fix issues with caching. Correct templates

parent 3169d5b2
{% extends "base.html" %} {% extends "b3theme/base.html" %}
{% load widget_tweaks %}
{% block title %}Access denied{% endblock %} {% load i18n %}
{% block content %} {% block sidenav %}{% endblock %}
<h3 align="center">Access denied</h3> {% block extraheadbottom %}
<h4 align="center">You do not have sufficient privileges</h4> <style>
@media (min-width: 768px) {
#page-wrapper {
border-left: none;
margin: 0;
}
}
</style>
{% endblock %} {% endblock %}
{% block title %}Access denied{% endblock %}
{% block contentplaceholder %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Access denied</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-danger">
<div class="panel-heading">
<i class="fa fa-info-circle"></i> Access denied
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<div class="alert alert-danger">
You do not have sufficient privileges
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% extends "base.html" %} {% extends "b3theme/base.html" %}
{% load widget_tweaks %}
{% block title %}Page not found{% endblock %} {% load i18n %}
{% block content %} {% block sidenav %}{% endblock %}
<h3 align="center">Page not found</h3> {% block extraheadbottom %}
<h4 align="center">The page that you requested was not found.</h4> <style>
@media (min-width: 768px) {
#page-wrapper {
border-left: none;
margin: 0;
}
}
</style>
{% endblock %} {% endblock %}
{% block title %}Page not found{% endblock %}
{% block contentplaceholder %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Page not found</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-danger">
<div class="panel-heading">
<i class="fa fa-info-circle"></i> Page not found
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<div class="alert alert-danger">
The page that you requested was not found.
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
...@@ -188,6 +188,10 @@ ...@@ -188,6 +188,10 @@
$("#langsel").val(lang); $("#langsel").val(lang);
$("#langform").submit(); $("#langform").submit();
} }
$(document).ready(function() {
$.ajaxSetup({ cache: false });
});
</script> </script>
......
{% extends "base.html" %} {% extends "b3theme/base.html" %}
{% block sidenav %}{% endblock %}
{% load i18n %} {% load i18n %}
{% block title %}{{ flatpage.title }}{% endblock %} {% block title %}{{ flatpage.title }}{% endblock %}
{% block breadcrumbs %} {% block extraheadbottom %}
<li class="active"><span class="divider">/</span> <style>
@media (min-width: 768px) {
{% trans flatpage.title %} #page-wrapper {
</li> border-left: none;
margin: 0;
}
}
</style>
{% endblock %} {% endblock %}
{% block extrahead %} {% block pagejsbottom %}
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <script type="text/javascript">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<style type="text/css">
.headtitle {font-family: "Franklin Gothic Demi", "Franklin Gothic", "ITC Franklin Gothic", Arial, sans-serif; letter-spacing: -1px; }
</style>
<script type="text/javascript" src="{{STATIC_URL}}js/jquery.min.js"></script>
<script type="text/javascript">
function setlang(lang) { function setlang(lang) {
$("#langsel").val(lang); $("#langsel").val(lang);
...@@ -34,15 +30,42 @@ ...@@ -34,15 +30,42 @@
} }
</script> </script>
{% endblock %}
{% block extrahead %}
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
{% endblock %} {% endblock %}
{% block content %} {% block contentplaceholder %}
<h4 class='muted'>{{ flatpage.title }}</h4>
<hr> <div class="container">
<div class="span9"> <div class="row">
{{ flatpage.content|linebreaks }} <div class="col-lg-12">
</div> <h1 class="page-header">{{ flatpage.title }}</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-lg-8">
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa fa-info fa-fw"></i> {{ flatpage.title }}
</div>
<!-- /.panel-heading -->
<div class="panel-body">
{{ flatpage.content|linebreaks }}
</div>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
{% if user.is_authenticated %} {% if user.is_authenticated %}
<p>{% trans "If you have any questions or need help, contact GRNET Helpdesk at <a href='mailto:helpdesk@grnet.gr'>helpdesk@grnet.gr</a> or 800-11-47638." %}</p> <p>{% trans "If you have any questions or need help, contact GRNET Helpdesk at <a href='mailto:helpdesk@grnet.gr'>helpdesk@grnet.gr</a> or 800-11-47638." %}</p>
{% endif %} {% endif %}
<div style="padding-top: 10px;"><a href="https://code.grnet.gr/projects/flowspy">Vesrion: <strong>{{VERSION}}</strong></a> - {% trans "Designed and developed by GRNET NOC" %} <div style="padding-top: 10px;"><a href="https://code.grnet.gr/projects/flowspy">Version: <strong>{{VERSION}}</strong></a> - {% trans "Designed and developed by GRNET NOC" %}
<a href="//facebook.com/noc.grnet.gr" target="_blank"><img src="{{STATIC_URL}}img/facebook_img.png" alt="GRNET NOC on Facebook" title="GRNET NOC on Facebook"/></a> <a href="//twitter.com/grnetnoc" target="_blank"><img src="{{STATIC_URL}}img/twitter_img.png" alt="GRNET NOC on Twitter" title="GRNET NOC on Twitter"/></a> <a href="//facebook.com/noc.grnet.gr" target="_blank"><img src="{{STATIC_URL}}img/facebook_img.png" alt="GRNET NOC on Facebook" title="GRNET NOC on Facebook"/></a> <a href="//twitter.com/grnetnoc" target="_blank"><img src="{{STATIC_URL}}img/twitter_img.png" alt="GRNET NOC on Twitter" title="GRNET NOC on Twitter"/></a>
</div> </div>
<div class="row"><a href="http://noc.grnet.gr">{% trans "GRNET" %} NOC</a> | <a href="/fod/info/{{LANGUAGE_CODE}}/">{% trans "Info" %}</a> | <a href="/fod/tos/{{LANGUAGE_CODE}}/">{% trans "Service Terms" %}</a></div> <div class="row"><a href="http://noc.grnet.gr">{% trans "GRNET" %} NOC</a> | <a href="/info/{{LANGUAGE_CODE}}/">{% trans "Info" %}</a> | <a href="/tos/{{LANGUAGE_CODE}}/">{% trans "Service Terms" %}</a></div>
<div style="padding-top: 10px;"> <div style="padding-top: 10px;">
</div> </div>
......
{% extends "b3theme/base.html" %} {% extends "b3theme/base.html" %}
{% load widget_tweaks %} {% load widget_tweaks %}
{% block sidenav %}{% endblock %}
{% load i18n %} {% load i18n %}
{% block extraheadbottom %} {% block extraheadbottom %}
<style> <style>
......
...@@ -27,7 +27,9 @@ function newMessage(form) { ...@@ -27,7 +27,9 @@ function newMessage(form) {
var message = form.formToDict(); var message = form.formToDict();
var disabled = form.find("input[type=submit]"); var disabled = form.find("input[type=submit]");
disabled.disable(); disabled.disable();
$.postJSON("{% url fetch-new %}", message, function(response) { var date = new Date();
var timestamp = date.getTime();
$.postJSON("{% url fetch-new %}?="+timestamp, message, function(response) {
updater.showMessage(response); updater.showMessage(response);
if (message.id) { if (message.id) {
form.parent().remove(); form.parent().remove();
...@@ -44,7 +46,7 @@ function getCookie(name) { ...@@ -44,7 +46,7 @@ function getCookie(name) {
} }
jQuery.postJSON = function(url, args, callback) { jQuery.postJSON = function(url, args, callback) {
$.ajax({url: url, dataType: "json", type: "POST", $.ajax({url: url, dataType: "json", type: "POST", cache: false,
success: function(response) { success: function(response) {
if (callback) callback(response); if (callback) callback(response);
}, error: function(response) { }, error: function(response) {
...@@ -80,7 +82,9 @@ var updater = { ...@@ -80,7 +82,9 @@ var updater = {
errorSleepTime: 500, errorSleepTime: 500,
cursor: null, cursor: null,
start: function() { start: function() {
$.ajax({url: "{% url fetch-existing %}", type: "POST", dataType: "json", var date = new Date();
var timestamp = date.getTime();
$.ajax({url: "{% url fetch-existing %}?="+timestamp, type: "POST", dataType: "json", cache:false,
success: updater.onFetchExisting, success: updater.onFetchExisting,
error: updater.onError}); error: updater.onError});
}, },
...@@ -91,7 +95,9 @@ var updater = { ...@@ -91,7 +95,9 @@ var updater = {
oTable.fnReloadAjax(refreshUrl); oTable.fnReloadAjax(refreshUrl);
} }
timeout = {{timeout}}; timeout = {{timeout}};
$.ajax({url: "{% url fetch-updates %}", type: "POST", dataType: "json", var date = new Date();
var timestamp = date.getTime();
$.ajax({url: "{% url fetch-updates %}?="+timestamp, type: "POST", dataType: "json", cache:false,
success: updater.onSuccess, success: updater.onSuccess,
timeout: timeout, timeout: timeout,
error: updater.onError}); error: updater.onError});
......
...@@ -28,7 +28,9 @@ function newMessage(form) { ...@@ -28,7 +28,9 @@ function newMessage(form) {
var message = form.formToDict(); var message = form.formToDict();
var disabled = form.find("input[type=submit]"); var disabled = form.find("input[type=submit]");
disabled.disable(); disabled.disable();
$.postJSON("{% url fetch-new %}", message, function(response) { var date = new Date();
var timestamp = date.getTime();
$.postJSON("{% url fetch-new %}?="+timestamp, message, function(response) {
updater.showMessage(response); updater.showMessage(response);
if (message.id) { if (message.id) {
form.parent().remove(); form.parent().remove();
...@@ -45,7 +47,7 @@ function getCookie(name) { ...@@ -45,7 +47,7 @@ function getCookie(name) {
} }
jQuery.postJSON = function(url, args, callback) { jQuery.postJSON = function(url, args, callback) {
$.ajax({url: url, dataType: "json", type: "POST", $.ajax({url: url, dataType: "json", type: "POST", cache: false,
success: function(response) { success: function(response) {
if (callback) callback(response); if (callback) callback(response);
}, error: function(response) { }, error: function(response) {
...@@ -81,7 +83,9 @@ var updater = { ...@@ -81,7 +83,9 @@ var updater = {
errorSleepTime: 500, errorSleepTime: 500,
cursor: null, cursor: null,
start: function() { start: function() {
$.ajax({url: "{% url fetch-existing %}", type: "POST", dataType: "json", var date = new Date();
var timestamp = date.getTime();
$.ajax({url: "{% url fetch-existing %}?="+timestamp, type: "POST", dataType: "json", cache: false,
success: updater.onFetchExisting, success: updater.onFetchExisting,
error: updater.onError}); error: updater.onError});
}, },
...@@ -92,7 +96,10 @@ var updater = { ...@@ -92,7 +96,10 @@ var updater = {
window.setTimeout('location.reload()', 500); window.setTimeout('location.reload()', 500);
} }
timeout = {{timeout}}; timeout = {{timeout}};
$.ajax({url: "{% url fetch-updates %}", type: "POST", dataType: "json", var date = new Date();
var timestamp = date.getTime();
$.ajax({url: "{% url fetch-updates %}?="+timestamp, type: "POST", dataType: "json", cache: false,
success: updater.onSuccess, success: updater.onSuccess,
timeout: timeout, timeout: timeout,
error: updater.onError}); error: updater.onError});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment