Merge branch 'Dunedan-template-cleanup'

This commit is contained in:
jeffrey forman 2015-05-27 20:04:14 -04:00
commit fc946c3fa0
5 changed files with 68 additions and 71 deletions

View File

@ -3,7 +3,9 @@
{% block header %} {% block header %}
<head> <head>
<title>Binder DNS Admin</title> <title>Binder DNS Admin</title>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}bootstrap/css/bootstrap.css" /> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}bootstrap/css/bootstrap.min.css" />
<script src="{{ STATIC_URL }}sorttable.js"></script> <script src="{{ STATIC_URL }}sorttable.js"></script>
</head> </head>
{% endblock header %} {% endblock header %}

View File

@ -6,28 +6,28 @@
<form class="form-horizontal" action="/add_cname_record/result/" method="post">{% csrf_token %} <form class="form-horizontal" action="/add_cname_record/result/" method="post">{% csrf_token %}
<legend>Create CNAME record</legend> <legend>Create CNAME record</legend>
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-2">DNS Server</label> <label for="id_dns_server" class="control-label col-md-2">DNS Server</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
<input type="text" class="form-control" name="dns_server" value="{{dns_server.hostname}}" readonly /> <input type="text" id="id_dns_server" class="form-control" name="dns_server" value="{{dns_server.hostname}}" readonly />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-2">Zone</label> <label for="id_zone_name" class="control-label col-md-2">Zone</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
<input type="text" class="form-control" name="zone_name" value="{{zone_name}}" readonly /> <input type="text" id="id_zone_name" class="form-control" name="zone_name" value="{{zone_name}}" readonly />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-2">Originating Record</label> <label for="id_originating_record" class="control-label col-md-2">Originating Record</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
<input type="text" class="form-control" name="originating_record" value="{{originating_record}}" readonly /> <input type="text" id="id_originating_record" class="form-control" name="originating_record" value="{{originating_record}}" readonly />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-2">CNAME</label> <label for="id_cname" class="control-label col-md-2">CNAME</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
{% if form_errors.cname %} {% if form_errors.cname %}
<div class="alert alert-danger" role="alert"> <div class="alert alert-danger" role="alert">
@ -35,7 +35,7 @@
</div> </div>
{% endif %} {% endif %}
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" name="cname"/> <input type="text" id="id_originating_record" class="form-control" name="cname"/>
<div class="input-group-addon">.{{zone_name}}</div> <div class="input-group-addon">.{{zone_name}}</div>
</div> </div>
</div> </div>
@ -45,17 +45,17 @@
<label class="control-label col-md-2">TTL</label> <label class="control-label col-md-2">TTL</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
{% for ttl, description in ttl_choices %} {% for ttl, description in ttl_choices %}
<label class="radio-inline"> <label for="id_ttl_{{ttl}}" class="radio-inline">
<input type="radio" name="ttl" id="ttl_{{ttl}}" value="{{ttl}}">{{ttl}} ({{description}}) <input type="radio" id="id_ttl_{{ ttl }}" name="ttl" value="{{ttl}}">{{ttl}} ({{description}})
</label> </label>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-2">TSIG Key</label> <label for="id_key_name" class="control-label col-md-2">TSIG Key</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
<select class="form-control" name="key_name"> <select id="id_key_name" class="form-control" name="key_name">
{% for key in tsig_keys %} {% for key in tsig_keys %}
<option value="{{key.id}}"{% if key == dns_server.default_transfer_key %} selected="selected"{% endif %}>{{key}}</option> <option value="{{key.id}}"{% if key == dns_server.default_transfer_key %} selected="selected"{% endif %}>{{key}}</option>
{% empty %} {% empty %}
@ -64,8 +64,7 @@
</select> </select>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-default">Save Changes</button>
<button type="submit" class="btn">Save Changes</button>
<a href="{% url "zone_list" dns_server=dns_server zone_name=zone_name %}" class="btn btn-warning">Cancel</a> <a href="{% url "zone_list" dns_server=dns_server zone_name=zone_name %}" class="btn btn-warning">Cancel</a>
</form> </form>

View File

@ -6,22 +6,22 @@
<form class="form-horizontal" action="/add_record/result/" method="POST">{% csrf_token %} <form class="form-horizontal" action="/add_record/result/" method="POST">{% csrf_token %}
<legend>Create Record</legend> <legend>Create Record</legend>
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-2">DNS Server</label> <label for="id_dns_server" class="control-label col-md-2">DNS Server</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
<input type="text" class="form-control" name="dns_server" value="{{dns_server.hostname}}" readonly /> <input type="text" id="id_dns_server" class="form-control" name="dns_server" value="{{dns_server.hostname}}" readonly />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-2">Zone</label> <label for="id_zone_name" class="control-label col-md-2">Zone</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
<input type="text" class="form-control" name="zone_name" value="{{zone_name}}" readonly> <input type="text" id="id_zone_name" class="form-control" name="zone_name" value="{{zone_name}}" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-2">Record Name</label> <label for="id_record_name" class="control-label col-md-2">Record Name</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
{% if form_errors.record_name %} {% if form_errors.record_name %}
<div class="alert alert-danger" role="alert"> <div class="alert alert-danger" role="alert">
@ -29,7 +29,7 @@
</div> </div>
{% endif %} {% endif %}
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" name="record_name"/> <input type="text" id="id_record_name" class="form-control" name="record_name"/>
<div class="input-group-addon">.{{zone_name}}</div> <div class="input-group-addon">.{{zone_name}}</div>
</div> </div>
</div> </div>
@ -40,20 +40,20 @@
<div class="controls col-md-10"> <div class="controls col-md-10">
{% if "in-addr.arpa" not in zone_name and "ip6.arpa" not in zone_name %} {% if "in-addr.arpa" not in zone_name and "ip6.arpa" not in zone_name %}
{% for type, name in record_type_choices %} {% for type, name in record_type_choices %}
<label class="radio-inline"> <label for="id_record_type_{{ name }}" class="radio-inline">
<input type="radio" name="record_type" id="record_type_{{name}}" value="{{name}}">{{name}} <input type="radio" id="id_record_type_{{ name }}" name="record_type" value="{{name}}">{{name}}
</label> </label>
{% endfor %} {% endfor %}
{% else %} {% else %}
<label class="radio-inline"> <label for="id_record_type" class="radio-inline">
<input type="radio" name="record_type" id="record_type_PTR" value="PTR" checked="checked">PTR <input type="radio" id="id_record_type" name="record_type" id="record_type_PTR" value="PTR" checked="checked">PTR
</label> </label>
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-2">Record Data</label> <label for="id_record_data" class="control-label col-md-2">Record Data</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
{% if form_errors.record_data %} {% if form_errors.record_data %}
<div class="alert alert-danger" role="alert"> <div class="alert alert-danger" role="alert">
@ -61,7 +61,7 @@
</div> </div>
{% endif %} {% endif %}
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" name="record_data"/> <input type="text" id="id_record_data" class="form-control" name="record_data"/>
{% if "in-addr.arpa" not in zone_name and "ip6.arpa" not in zone_name %} {% if "in-addr.arpa" not in zone_name and "ip6.arpa" not in zone_name %}
<div class="input-group-addon">IP Address</div> <div class="input-group-addon">IP Address</div>
{% else %} {% else %}
@ -75,8 +75,8 @@
<label class="control-label col-md-2">TTL</label> <label class="control-label col-md-2">TTL</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
{% for ttl, description in ttl_choices %} {% for ttl, description in ttl_choices %}
<label class="radio-inline"> <label for="id_ttl_{{ ttl }}" class="radio-inline">
<input type="radio" name="ttl" id="ttl_{{ttl}}" value="{{ttl}}">{{ttl}} ({{description}}) <input type="radio" id="id_ttl_{{ ttl }}" name="ttl" value="{{ttl}}">{{ttl}} ({{description}})
</label> </label>
{% endfor %} {% endfor %}
</div> </div>
@ -84,19 +84,19 @@
{% if "in-addr.arpa" not in zone_name and "ip.arpa" not in zone_name %} {% if "in-addr.arpa" not in zone_name and "ip.arpa" not in zone_name %}
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-2">Create PTR?</label> <label for="id_create_reverse" class="control-label col-md-2">Create PTR?</label>
<div class="checkbox controls col-md-10"> <div class="checkbox controls col-md-10">
<label> <label>
<input type="checkbox" name="create_reverse" id="create_reverse" value="True" aria-label="create ptr record?">Yes <input type="checkbox" id="id_create_reverse" name="create_reverse" id="create_reverse" value="True" aria-label="create ptr record?">Yes
</label> <label>
</div> </div>
</div> </div>
{% endif %} {% endif %}
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-2">TSIG Key</label> <label for="id_key_name" class="control-label col-md-2">TSIG Key</label>
<div class="controls col-md-10"> <div class="controls col-md-10">
<select class="form-control" name="key_name"> <select id="id_key_name" class="form-control" name="key_name">
{% for key in tsig_keys %} {% for key in tsig_keys %}
<option value="{{key.id}}"{% if key == dns_server.default_transfer_key %} selected="selected"{% endif %}>{{key}}</option> <option value="{{key.id}}"{% if key == dns_server.default_transfer_key %} selected="selected"{% endif %}>{{key}}</option>
{% empty %} {% empty %}
@ -106,7 +106,7 @@
</div> </div>
</div> </div>
<button type="submit" class="btn">Save Changes</button> <button type="submit" class="btn btn-default">Save Changes</button>
<a href="{% url "zone_list" dns_server=dns_server zone_name=zone_name %}" class="btn btn-warning">Cancel</a> <a href="{% url "zone_list" dns_server=dns_server zone_name=zone_name %}" class="btn btn-warning">Cancel</a>
</form> </form>
{% endblock body %} {% endblock body %}

View File

@ -22,11 +22,11 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td>TSIG Key</td> <td><label for="id_key_name">TSIG Key</label></td>
<td> <td>
<div class="form-group"> <div class="form-group">
<div class="controls"> <div class="controls">
<select class="form-control" name="key_name"> <select id="id_key_name" class="form-control" name="key_name">
{% for key in tsig_keys %} {% for key in tsig_keys %}
<option value="{{key.id}}"{% if key == dns_server.default_transfer_key %} selected="selected"{% endif %}>{{key}}</option> <option value="{{key.id}}"{% if key == dns_server.default_transfer_key %} selected="selected"{% endif %}>{{key}}</option>
{% empty %} {% empty %}
@ -39,7 +39,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<button type="submit" class="btn">Yes, really delete.</button> <button type="submit" class="btn btn-default">Yes, really delete.</button>
<a href="{% url "zone_list" dns_server=dns_server zone_name=zone_name %}" class="btn btn-warning">Cancel</a> <a href="{% url "zone_list" dns_server=dns_server zone_name=zone_name %}" class="btn btn-warning">Cancel</a>
</td> </td>
<td></td> <td></td>

View File

@ -4,10 +4,14 @@
{% block body %} {% block body %}
{% if not errors %} {% if not errors %}
<form action="{% url "delete_record" %}" method="post">{% csrf_token %} <a href="{% url "add_record" dns_server=dns_server zone_name=zone_name %}" class="btn btn-default">Add Record</a>
<table class="table table-condensed table-hover sortable">
<a href="{% url "add_record" dns_server=dns_server zone_name=zone_name %}" class="btn btn-default">Add Record</a></button>
<form action="{% url "delete_record" %}" method="post">{% csrf_token %}
<input type="hidden" name="dns_server" value="{{ dns_server.hostname }}">
<input type="hidden" name="zone_name" value="{{ zone_name }}">
<table class="table table-condensed table-hover sortable">
<tr> <tr>
<th>Select</th> <th>Select</th>
<th>Name</th> <th>Name</th>
@ -18,17 +22,9 @@
<th></th> <th></th>
</tr> </tr>
<input type="hidden" name="dns_server" value="{{ dns_server.hostname }}">
<input type="hidden" name="zone_name" value="{{ zone_name }}">
{% for current_record in zone_array %} {% for current_record in zone_array %}
<tr> <tr>
<td> <td><input type="checkbox" id="rr_{{current_record.rr_name}}" name="rr_list" value="{{ current_record.rr_name }}.{{ zone_name }}" /></td>
<div class="checkbox">
<label>
<input type="checkbox" id="rr_{{current_record.rr_name}}" name="rr_list" value="{{ current_record.rr_name }}.{{ zone_name }}"/>
</label>
</div>
</td>
<td>{{ current_record.rr_name }}</td> <td>{{ current_record.rr_name }}</td>
<td>{{ current_record.rr_ttl }}</td> <td>{{ current_record.rr_ttl }}</td>
<td>{{ current_record.rr_class }}</td> <td>{{ current_record.rr_class }}</td>
@ -37,7 +33,7 @@
<td> <td>
<div class="btn-toolbar" style="margin: 0;"> <div class="btn-toolbar" style="margin: 0;">
<div class="btn-group"> <div class="btn-group">
<button class="btn dropdown-toggle" data-toggle="dropdown">Record Actions <span class="caret"></span></button> <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">Record Actions <span class="caret"></span></button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="#">Edit Record (Coming Soon)</a></li> <li><a href="#">Edit Record (Coming Soon)</a></li>
{% if current_record.rr_type == "A" %} {% if current_record.rr_type == "A" %}