2013-09-28 11:39:57 +02:00
|
|
|
{% load static from staticfiles %}
|
2014-05-23 17:27:18 +02:00
|
|
|
{% load i18n %}{% load bootstrap %}
|
2013-09-28 11:39:57 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<meta name="description" content="">
|
|
|
|
<meta name="author" content="nsupdate.info team">
|
|
|
|
|
2013-10-07 20:06:41 +02:00
|
|
|
<title>{% block title %}{{ WWW_HOST }}{% endblock %}</title>
|
2013-09-28 11:39:57 +02:00
|
|
|
|
2015-02-08 19:55:04 +01:00
|
|
|
<link href="//netdna.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
|
2015-02-08 20:06:48 +01:00
|
|
|
<link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
|
2013-09-28 11:39:57 +02:00
|
|
|
<link href="{% static 'css/nsupdate.css' %}" rel="stylesheet">
|
2013-09-28 15:34:24 +02:00
|
|
|
<link rel="icon" type="image/png" href="{% static 'favicon.png' %}" />
|
2014-01-26 03:55:11 +01:00
|
|
|
<!-- note: keep jQuery and bootstrap js here,
|
|
|
|
stuff in the include / block right below might depend on it!
|
|
|
|
-->
|
2015-02-08 19:56:54 +01:00
|
|
|
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
|
2015-02-08 19:55:04 +01:00
|
|
|
<script src="//netdna.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
|
2013-11-03 23:37:46 +01:00
|
|
|
{% include "includes/base_head.html" %}
|
2013-11-04 00:03:26 +01:00
|
|
|
{% block html_head %}{% endblock %}
|
2013-09-28 11:39:57 +02:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
|
|
|
<div class="container">
|
|
|
|
<div class="navbar-header">
|
|
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
</button>
|
2013-10-07 20:06:41 +02:00
|
|
|
<a class="navbar-brand" href="{% url 'home' %}"><span style="color: #00ba00">⬥</span> {{ WWW_HOST }}</a>
|
2013-09-28 11:39:57 +02:00
|
|
|
</div>
|
|
|
|
<div class="collapse navbar-collapse">
|
|
|
|
<ul class="nav navbar-nav">
|
2013-09-29 17:06:39 +02:00
|
|
|
<li{% if nav_home %} class="active"{% endif %}>
|
2013-12-29 22:16:22 +01:00
|
|
|
<a href="{% url 'home' %}"><i class="fa fa-home fa-fw"></i> {% trans "Home" %}</a>
|
2013-09-29 17:06:39 +02:00
|
|
|
</li>
|
2013-10-18 15:55:37 -07:00
|
|
|
{% if request.user.is_authenticated %}
|
2014-08-31 01:23:38 +02:00
|
|
|
<li{% if nav_overview %} class="active"{% endif %}>
|
|
|
|
<a href="{% url 'overview' %}"><i class="fa fa-list fa-fw"></i> {% trans "Overview" %}</a>
|
2013-09-29 17:06:39 +02:00
|
|
|
</li>
|
2013-11-03 04:29:14 +01:00
|
|
|
<li{% if nav_status %} class="active"{% endif %}>
|
2013-12-29 22:16:22 +01:00
|
|
|
<a href="{% url 'status' %}"><i class="fa fa-list fa-fw"></i> {% trans "Status" %}</a>
|
2013-11-03 04:29:14 +01:00
|
|
|
</li>
|
2013-10-18 15:55:37 -07:00
|
|
|
{% endif %}
|
2013-09-29 17:06:39 +02:00
|
|
|
<li{% if nav_about %} class="active"{% endif %}>
|
2013-12-29 22:16:22 +01:00
|
|
|
<a href="{% url 'about' %}"><i class="fa fa-comment fa-fw"></i> {% trans "About" %}</a>
|
2013-09-29 17:06:39 +02:00
|
|
|
</li>
|
2013-11-02 23:23:01 +01:00
|
|
|
<li>
|
|
|
|
<a href="http://nsupdateinfo.readthedocs.org/"
|
2013-12-29 22:16:22 +01:00
|
|
|
class="navbar-link" title="Open docs in new window" target="_blank"><i class="fa fa-eye fa-fw"></i> {% trans "Documentation" %}</a>
|
2013-09-29 17:12:32 +02:00
|
|
|
</li>
|
2013-09-28 16:46:33 +02:00
|
|
|
</ul>
|
|
|
|
<ul class="nav navbar-nav pull-right">
|
|
|
|
{% if not request.user.is_authenticated %}
|
2013-12-29 22:16:22 +01:00
|
|
|
<li{% if nav_register %} class="active"{% endif %}><a href="{% url 'registration_register' %}"><i class="fa fa-asterisk fa-fw"></i> {% trans "Sign up" %}</a></li>
|
|
|
|
<li{% if nav_login %} class="active"{% endif %}><a href="{% url 'django.contrib.auth.views.login' %}"><i class="fa fa-sign-in fa-fw"></i> {% trans 'Log in' %}</a></li>
|
2013-09-28 16:46:33 +02:00
|
|
|
{% else %}
|
|
|
|
<li class="dropdown">
|
2013-11-06 04:33:17 +01:00
|
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user fa-fw"></i> {{ request.user.username }} <b class="caret"></b></a>
|
2013-09-28 16:46:33 +02:00
|
|
|
<ul class="dropdown-menu">
|
2013-12-29 22:16:22 +01:00
|
|
|
<li><a href="{% url 'account_profile' %}"><i class="fa fa-cogs fa-fw"></i> {% trans 'Profile' %}</a></li>
|
2014-12-29 17:27:45 +01:00
|
|
|
<li><a href="{% url 'account_settings' %}"><i class="fa fa-key fa-fw"></i> {% trans 'Password change' %}</a></li>
|
2013-09-29 14:08:22 +02:00
|
|
|
{% if request.user.is_staff %}
|
2013-12-29 22:16:22 +01:00
|
|
|
<li><a href="{% url 'admin:index' %}"><i class="fa fa-wrench fa-fw"></i> {% trans 'Admin interface' %}</a></li>
|
2013-09-29 14:08:22 +02:00
|
|
|
{% endif %}
|
2014-09-04 18:48:29 +02:00
|
|
|
<li><a href="{% url 'django.contrib.auth.views.logout_then_login' %}"><i class="fa fa-sign-out fa-fw"></i> {% trans 'Log out' %}</a></li>
|
2013-09-28 16:46:33 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
2013-09-28 11:39:57 +02:00
|
|
|
</ul>
|
2014-08-25 00:01:26 +02:00
|
|
|
<ul class="nav navbar-nav pull-right">
|
|
|
|
<li class="dropdown">
|
|
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-language fa-fw"></i> {{ LANGUAGE_CODE }} <b class="caret"></b></a>
|
|
|
|
<ul class="dropdown-menu">
|
|
|
|
{% get_language_info_list for LANGUAGES as langs %}
|
|
|
|
{% for lang in langs %}
|
|
|
|
{% if lang.code != LANGUAGE_CODE %}
|
|
|
|
<li>
|
2014-11-01 19:37:47 +01:00
|
|
|
<form name="setLang{{ lang.name.split|join:"_" }}" action="{% url 'set_language' %}" method="post">
|
2014-08-25 00:01:26 +02:00
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="language" value="{{ lang.code }}" />
|
|
|
|
</form>
|
2014-11-01 19:37:47 +01:00
|
|
|
<a href="#" onclick="document.setLang{{ lang.name.split|join:"_" }}.submit();return false;">
|
2014-08-25 01:04:01 +02:00
|
|
|
{{ lang.name_local }} ({{ lang.name }}) [{{ lang.code }}]
|
|
|
|
</a>
|
2014-08-25 00:01:26 +02:00
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2013-09-28 11:39:57 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2013-09-30 01:12:05 +02:00
|
|
|
{% block header %}{% endblock %}
|
2013-09-28 23:13:36 +02:00
|
|
|
<div class="container content wrap">
|
2013-09-29 00:28:31 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div id="message_box">
|
2013-11-02 01:09:24 +01:00
|
|
|
{% if not request.is_secure %}
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
2014-05-27 01:36:57 +02:00
|
|
|
{% trans "Your (http) connection is unencrypted and thus insecure." %}
|
2014-05-30 01:18:50 +02:00
|
|
|
{% if WE_HAVE_TLS %}
|
2014-11-01 23:03:02 +01:00
|
|
|
{% blocktrans trimmed %}
|
|
|
|
Please use our <a href="https://{{ WWW_HOST }}/">secure https site</a>.
|
|
|
|
{% endblocktrans %}
|
2013-11-03 05:24:54 +01:00
|
|
|
{% endif %}
|
2013-11-03 10:55:49 +01:00
|
|
|
{% if COOKIE_SECURE %}
|
2014-11-01 23:03:02 +01:00
|
|
|
{% blocktrans trimmed %}
|
|
|
|
At least some of the required cookies will only work on the secure https site,
|
|
|
|
expect malfunctioning on the http site.
|
|
|
|
{% endblocktrans %}
|
2013-11-03 10:55:49 +01:00
|
|
|
{% endif %}
|
2013-11-02 01:09:24 +01:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2013-11-12 14:28:50 +01:00
|
|
|
<noscript>
|
|
|
|
<div class="alert alert-warning">
|
|
|
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
2014-05-27 01:36:57 +02:00
|
|
|
{% trans "Some functionality on this site requires that you have JavaScript enabled in your browser." %}
|
2013-11-12 14:28:50 +01:00
|
|
|
</div>
|
|
|
|
</noscript>
|
2013-09-29 00:28:31 +02:00
|
|
|
{% if messages %}
|
|
|
|
{% for message in messages %}
|
2013-11-06 01:25:28 +01:00
|
|
|
<div class="alert {{ message.tags }}">
|
2013-09-29 00:28:31 +02:00
|
|
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
|
|
|
{{ message }}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
2013-09-28 23:03:34 +02:00
|
|
|
</div>
|
2013-09-28 11:39:57 +02:00
|
|
|
{% block content %}
|
2013-09-29 14:08:22 +02:00
|
|
|
Here goes the content.
|
2013-09-28 11:39:57 +02:00
|
|
|
{% endblock %}
|
|
|
|
</div>
|
|
|
|
|
2013-09-28 23:13:36 +02:00
|
|
|
<div class="footer">
|
|
|
|
<div class="container">
|
2013-11-18 09:10:04 +01:00
|
|
|
{% include "includes/base_footer.html" %}
|
2013-09-28 23:13:36 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2013-11-03 00:46:46 +01:00
|
|
|
<div id="ip_detection" style="display: none">
|
2013-11-07 03:09:53 +01:00
|
|
|
{% comment %}
|
|
|
|
Why IP detection it is implemented as it is
|
|
|
|
-------------------------------------------
|
|
|
|
a) we use javascript to insert the img tags after the document (DOM) is ready.
|
|
|
|
if we just have them in the html from the beginning, the browser would be visibly
|
2014-09-04 18:48:29 +02:00
|
|
|
"loading" until both "images" are loaded or timed out (if e.g. you don't have IPv6).
|
2013-11-07 03:09:53 +01:00
|
|
|
not nice.
|
|
|
|
b) we use fake img tags because doing it with jQuery.get() would be cross-domain:
|
|
|
|
WWW_HOST -> WWW_IPV4_HOST
|
|
|
|
WWW_HOST -> WWW_IPV6_HOST
|
|
|
|
c) yes, the setTimeout is rather unpretty and might not work for slow connections
|
|
|
|
(when loading the images take more than that timeout), making the IPs appear not
|
|
|
|
on the current view, but when the next view is loaded (or the current one reloaded).
|
|
|
|
if you have a better idea, this is something to improve.
|
2014-09-04 18:48:29 +02:00
|
|
|
d) we detect both IPv4 and v6 in the same way. this could be optimized to use the
|
2013-11-07 03:09:53 +01:00
|
|
|
REMOTE_ADDR we have from the view's http request and then only detect the other
|
|
|
|
kind of ip using the fake img approach.
|
|
|
|
OTOH, doing both IPs the same way is nicer as it is more symmetric.
|
|
|
|
{% endcomment %}
|
2013-11-07 02:43:48 +01:00
|
|
|
{% if not request.session.ipv4 or not request.session.ipv6 %}
|
2013-11-01 06:03:36 +01:00
|
|
|
<script type="text/javascript">
|
2013-11-07 02:43:48 +01:00
|
|
|
$(document).ready(function() {
|
|
|
|
{% if not request.session.ipv4 %}
|
2013-11-03 00:46:46 +01:00
|
|
|
$('#ip_detection').add(
|
|
|
|
'<img src="//{{ WWW_IPV4_HOST }}/detectip/{{ request.session.session_key }}/" >');
|
2013-11-07 02:43:48 +01:00
|
|
|
{% endif %}
|
|
|
|
{% if not request.session.ipv6 %}
|
2013-11-03 00:46:46 +01:00
|
|
|
$('#ip_detection').add(
|
|
|
|
'<img src="//{{ WWW_IPV6_HOST }}/detectip/{{ request.session.session_key }}/" >');
|
2013-11-07 02:43:48 +01:00
|
|
|
{% endif %}
|
2013-11-03 04:58:28 +01:00
|
|
|
function insert_ips() {
|
2013-11-01 06:03:36 +01:00
|
|
|
$.getJSON("{% url 'ajax_get_ips' %}")
|
|
|
|
.done(function(data) {
|
2013-11-03 04:58:28 +01:00
|
|
|
$('#ipv4').text(data['ipv4']);
|
2013-11-27 08:16:49 +01:00
|
|
|
$('#ipv4_rdns').text(data['ipv4_rdns']);
|
2013-11-01 06:03:36 +01:00
|
|
|
$('#ipv6').text(data['ipv6']);
|
2013-11-27 08:16:49 +01:00
|
|
|
$('#ipv6_rdns').text(data['ipv6_rdns']);
|
2013-11-01 06:03:36 +01:00
|
|
|
});
|
2013-11-03 05:57:13 +01:00
|
|
|
}
|
2013-11-10 16:41:29 +01:00
|
|
|
setTimeout(insert_ips, 1500);
|
|
|
|
setTimeout(insert_ips, 3000);
|
2013-11-07 02:43:48 +01:00
|
|
|
});
|
2013-11-01 04:03:34 +01:00
|
|
|
</script>
|
|
|
|
{% endif %}
|
2013-09-29 21:20:07 +02:00
|
|
|
</div>
|
2013-11-03 23:37:46 +01:00
|
|
|
{% include "includes/base_body.html" %}
|
2013-09-28 11:39:57 +02:00
|
|
|
</body>
|
|
|
|
</html>
|