2013-09-28 11:39:57 +02:00
|
|
|
{% load static from staticfiles %}
|
|
|
|
<!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
|
|
|
|
2013-11-06 03:42:07 +01:00
|
|
|
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css" rel="stylesheet">
|
2013-11-06 04:45:36 +01:00
|
|
|
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/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' %}" />
|
2013-09-28 13:56:54 +02:00
|
|
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.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-11-06 04:33:17 +01:00
|
|
|
<a href="{% url 'home' %}"><i class="fa fa-home fa-fw"></i> Home</a>
|
2013-09-29 17:06:39 +02:00
|
|
|
</li>
|
2013-10-18 15:55:37 -07:00
|
|
|
{% if request.user.is_authenticated %}
|
2013-09-29 17:06:39 +02:00
|
|
|
<li{% if nav_overview %} class="active"{% endif %}>
|
2013-11-06 13:14:03 +01:00
|
|
|
<a href="{% url 'overview' %}"><i class="fa fa-list fa-fw"></i> Hosts</a>
|
2013-11-02 12:12:13 +01:00
|
|
|
</li>
|
|
|
|
<li{% if nav_domain_overview %} class="active"{% endif %}>
|
2013-11-06 13:14:03 +01:00
|
|
|
<a href="{% url 'domain_overview' %}"><i class="fa fa-list fa-fw"></i> Domains</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-11-06 13:14:03 +01:00
|
|
|
<a href="{% url 'status' %}"><i class="fa fa-list fa-fw"></i> 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-11-06 04:33:17 +01:00
|
|
|
<a href="{% url 'about' %}"><i class="fa fa-comment fa-fw"></i> 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-11-06 04:33:17 +01:00
|
|
|
class="navbar-link" title="Open docs in new window" target="_blank"><i class="fa fa-eye fa-fw"></i> 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-11-06 04:33:17 +01:00
|
|
|
<li{% if nav_register %} class="active"{% endif %}><a href="{% url 'registration_register' %}"><i class="fa fa-asterisk fa-fw"></i> Register</a></li>
|
|
|
|
<li{% if nav_login %} class="active"{% endif %}><a href="{% url 'auth_login' %}"><i class="fa fa-sign-in fa-fw"></i> Login</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-11-06 04:33:17 +01:00
|
|
|
<li><a href="{% url 'account_profile' %}"><i class="fa fa-cogs fa-fw"></i> Profile</a></li>
|
|
|
|
<li><a href="{% url 'password_change' %}"><i class="fa fa-key fa-fw"></i> Change password</a></li>
|
2013-09-29 14:08:22 +02:00
|
|
|
{% if request.user.is_staff %}
|
2013-11-06 04:33:17 +01:00
|
|
|
<li><a href="/admin/"><i class="fa fa-wrench fa-fw"></i> Admin</a></li>
|
2013-09-29 14:08:22 +02:00
|
|
|
{% endif %}
|
2013-11-06 04:33:17 +01:00
|
|
|
<li><a href="{% url 'auth_logout' %}?next={% url 'auth_login' %}"><i class="fa fa-sign-out fa-fw"></i> Logout</a></li>
|
2013-09-28 16:46:33 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
2013-09-28 11:39:57 +02:00
|
|
|
</ul>
|
|
|
|
</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>
|
2013-11-03 05:24:54 +01:00
|
|
|
Your (http) connection is unencrypted and thus insecure.
|
|
|
|
{% if WE_HAVE_SSL %}
|
|
|
|
Please use our <a href="https://{{ WWW_HOST }}/">secure https site</a>.
|
|
|
|
{% endif %}
|
2013-11-03 10:55:49 +01:00
|
|
|
{% if COOKIE_SECURE %}
|
|
|
|
At least some of the required cookies will only work on the secure https site,
|
|
|
|
expect malfunctioning on the http site.
|
|
|
|
{% endif %}
|
2013-11-02 01:09:24 +01:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
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">
|
|
|
|
<p class="text-muted credit">
|
2013-10-03 03:09:09 +02:00
|
|
|
<a href="{% url 'legal' %}">Legal notice</a>
|
2013-10-03 22:43:44 +02:00
|
|
|
|
|
2013-10-17 23:11:15 -07:00
|
|
|
<a href="http://validator.w3.org/check/referer">Valid HTML</a>
|
2013-10-03 22:43:44 +02:00
|
|
|
|
|
|
|
|
<a href="http://jigsaw.w3.org/css-validator/check/referer">Valid CSS</a>
|
2013-09-28 23:13:36 +02:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2013-11-06 03:42:07 +01:00
|
|
|
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.1/js/bootstrap.min.js"></script>
|
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
|
|
|
|
"loading" until both "images" are loaded or timed out (if e.g. you don't have ip v6).
|
|
|
|
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.
|
|
|
|
d) we detect both ipv4 and v6 in the same way. this could be optimized to use the
|
|
|
|
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-01 06:03:36 +01:00
|
|
|
$('#ipv6').text(data['ipv6']);
|
|
|
|
});
|
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>
|