fixed different width in templates
This commit is contained in:
parent
884c86defd
commit
553e02f243
@ -5,9 +5,9 @@ from django.forms import ModelForm
|
||||
|
||||
class Host(models.Model):
|
||||
"""TODO: hash update_secret"""
|
||||
fqdn = models.CharField(max_length=256)
|
||||
fqdn = models.CharField(max_length=256,unique=True)
|
||||
update_secret = models.CharField(max_length=256)
|
||||
comment = models.CharField(max_length=256,default='')
|
||||
comment = models.CharField(max_length=256,default='',blank=True, null=True)
|
||||
|
||||
last_update = models.DateTimeField(auto_now=True)
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
|
@ -4,7 +4,6 @@
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-4">
|
||||
<h3>Delete Host <small><a href="{% url 'overview' %}"><i class="icon-double-angle-left"></i> back to overview</a></small></h3>
|
||||
<form action="" method="post">
|
||||
|
@ -23,8 +23,8 @@
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
<h3>New host</h3>
|
||||
<div class="col-lg-4">
|
||||
<div class="col-lg-4">
|
||||
<h3>New host</h3>
|
||||
<form method="post" action="">
|
||||
{% csrf_token %}
|
||||
{{ form|bootstrap }}
|
||||
@ -33,13 +33,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3>Information</h3>
|
||||
<b>your IPv4:</b> <span class="ipv4adr">{{ request.session.ipv4 }}</span> </br>
|
||||
<b>your IPv6:</b> <span class="ipv6adr">{{ request.session.ipv6 }}</span>
|
||||
</div>
|
||||
<div style="display: none">
|
||||
<img src="//{{ WWW_IPV4_HOST }}/updateip" />
|
||||
<img src="//{{ WWW_IPV6_HOST }}/updateip" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -9,6 +9,7 @@ from django.contrib.auth.decorators import login_required
|
||||
from django.contrib import messages
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.core.urlresolvers import reverse
|
||||
import dns.inet
|
||||
|
||||
from main.forms import HostForm
|
||||
from main.models import Host
|
||||
@ -19,8 +20,11 @@ class HomeView(TemplateView):
|
||||
|
||||
def get_context_data(self, *args, **kwargs):
|
||||
context = super(HomeView, self).get_context_data(*args, **kwargs)
|
||||
context.update(create_context(self.request))
|
||||
context['nav_home'] = True
|
||||
ipaddr = self.request.META['REMOTE_ADDR']
|
||||
af = dns.inet.af_for_address(ipaddr)
|
||||
key = 'ipv4' if af == dns.inet.AF_INET else 'ipv6'
|
||||
self.request.session[key] = ipaddr
|
||||
return context
|
||||
|
||||
|
||||
|
0
nsupdate/manage.py
Normal file → Executable file
0
nsupdate/manage.py
Normal file → Executable file
@ -51,15 +51,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="container content wrap">
|
||||
<div id="message_box">
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ message.tags }}">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div id="message_box">
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ message.tags }}">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block content %}
|
||||
<div class="row" style="background-color: #DDDDDD">
|
||||
@ -88,16 +92,16 @@
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="container">
|
||||
{% if session.ipv4 and session.ipv6 %}
|
||||
{% if request.session.ipv4 and request.session.ipv6 %}
|
||||
<p>We think this are your IPs:</p>
|
||||
{% elif session.ipv4 or session.ipv6 %}
|
||||
{% elif request.session.ipv4 or request.session.ipv6 %}
|
||||
<p>We think this is your IP:</p>
|
||||
{% endif %}
|
||||
|
||||
{% if session.ipv4 %}
|
||||
<h1>{{session.ipv4}}</h1>
|
||||
{% elif session.ipv6 %}
|
||||
<h1>{{session.ipv6}}</h1>
|
||||
{% if request.session.ipv4 %}
|
||||
<h1>{{request.session.ipv4}}</h1>
|
||||
{% elif request.session.ipv6 %}
|
||||
<h1>{{request.session.ipv4}}</h1>
|
||||
{% else %}
|
||||
<h1>HeyHo!</h1>
|
||||
{% endif %}
|
||||
@ -120,6 +124,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: none">
|
||||
<img src="//{{ WWW_IPV4_HOST }}/updateip" />
|
||||
<img src="//{{ WWW_IPV6_HOST }}/updateip" />
|
||||
</div>
|
||||
|
||||
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user