Merge branch 'master' into add-global-authentication

This commit is contained in:
Daniel Roschka 2015-06-08 19:24:36 +02:00
commit 515876a2a5
5 changed files with 9 additions and 20 deletions

View File

@ -1,3 +1,4 @@
{% load static from staticfiles %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
{% block header %} {% block header %}
@ -5,14 +6,14 @@
<title>Binder DNS Admin</title> <title>Binder DNS Admin</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}bootstrap/css/bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href="{% static "bootstrap/css/bootstrap.min.css" %}" />
<script src="{{ STATIC_URL }}sorttable.js"></script> <script src="{% static "sorttable.js" %}"></script>
</head> </head>
{% endblock header %} {% endblock header %}
<body> <body>
<script src="{{ STATIC_URL }}jquery-2.1.3.min.js"></script> <script src="{% static "jquery-2.1.3.min.js" %}"></script>
<script src="{{ STATIC_URL }}bootstrap/js/bootstrap.min.js"></script> <script src="{% static "bootstrap/js/bootstrap.min.js" %}"></script>
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
@ -20,7 +21,7 @@
{% block navigation %} {% block navigation %}
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li role="presentation" class="active">Actions</li> <li role="presentation" class="active">Actions</li>
<li role="presentation"><a href="/">Home</a></li> <li role="presentation"><a href="{% url "index" %}">Home</a></li>
<li role="presentation"><a href="{% url "server_list" %}">Server List</a></li> <li role="presentation"><a href="{% url "server_list" %}">Server List</a></li>
{% if user.is_authenticated %} {% if user.is_authenticated %}
<li role="presentation"><a href="{% url "logout" %}">Logout</a></li> <li role="presentation"><a href="{% url "logout" %}">Logout</a></li>

View File

@ -3,7 +3,7 @@
{% block pageheader %}Add CNAME record for {{ originating_record }}{% endblock pageheader %} {% block pageheader %}Add CNAME record for {{ originating_record }}{% endblock pageheader %}
{% block body %} {% block body %}
<form class="form-horizontal" action="/add_cname_record/result/" method="post">{% csrf_token %} <form class="form-horizontal" action="{% url "add_cname_result" %}" method="post">{% csrf_token %}
<legend>Create CNAME record</legend> <legend>Create CNAME record</legend>
<div class="form-group"> <div class="form-group">
<label for="id_dns_server" class="control-label col-md-2">DNS Server</label> <label for="id_dns_server" class="control-label col-md-2">DNS Server</label>

View File

@ -3,7 +3,7 @@
{% block pageheader %}Add record in {{ zone_name }}{% endblock pageheader %} {% block pageheader %}Add record in {{ zone_name }}{% endblock pageheader %}
{% block body %} {% block body %}
<form class="form-horizontal" action="/add_record/result/" method="POST">{% csrf_token %} <form class="form-horizontal" action="{% url "add_record_result" %}" method="POST">{% csrf_token %}
<legend>Create Record</legend> <legend>Create Record</legend>
<div class="form-group"> <div class="form-group">
<label for="id_dns_server" class="control-label col-md-2">DNS Server</label> <label for="id_dns_server" class="control-label col-md-2">DNS Server</label>

View File

@ -3,7 +3,7 @@
{% block pageheader %}Delete record(s) in {{ zone_name }}{% endblock pageheader %} {% block pageheader %}Delete record(s) in {{ zone_name }}{% endblock pageheader %}
{% block body %} {% block body %}
<form action="/delete_record/result/" method="POST"> <form action="{% url "delete_record_result" %}" method="POST">
{% csrf_token %} {% csrf_token %}
<table class="sortable table table-hover"> <table class="sortable table table-hover">
<tr> <tr>

View File

@ -1,12 +0,0 @@
from django.test import TestCase
from binder import models, helpers
class HelperTests(TestCase):
def test_ipinfo_ResolutionFail(self):
response = helpers.ip_info("foobar.doesnotexist.local")
self.assertEqual([['Error', u'Unable to resolve foobar.doesnotexist.local: [Errno -2] Name or service not known']],
response)
response = helpers.ip_info("localhost")
self.assertEqual([['IPv4 (1)', u'127.0.0.1']],
sorted(response))