remove the unused templates
This commit is contained in:
parent
d2c5c03d12
commit
b53ecfd080
|
@ -1,16 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}Delete Backup{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>Are you sure you want delete the backup "{{ object }}" for "{{ object.computer }}"?</p>
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,14 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Add Backup{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{% url 'computer' view.kwargs.pk %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,92 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}{{ backup.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card mt-3">
|
||||
<h2 class="card-header">Backup Details</h2>
|
||||
<div class="card-body">
|
||||
<p><b>Description</b></p>
|
||||
<div class="card-text"><p>{{ backup.description }}</p></div>
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>Computer:</b></td>
|
||||
<td><a href="{% url 'computer' backup.computer.id %}">{{ backup.computer }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Backup Method:</b></td>
|
||||
<td>{{ backup.method }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Backup Software:</b></td>
|
||||
<td>{{ backup.software }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Exec Time:</b></td>
|
||||
<td>{{ backup.exec_time }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Exec Day:</b></td>
|
||||
<td>
|
||||
{% for backup in backup.exec_days.all %}{{ backup }}<br/>{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if target_device_list %}
|
||||
<div class="col">
|
||||
<div class="card mt-3">
|
||||
<h2 class="card-header">Target Devices</h2>
|
||||
<div class="card-body">
|
||||
{% for device in target_device_list %}
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>Target Device:</b></td>
|
||||
<td><a href="{% url 'computer' device.device.id %}">{{ device.device }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Target Path:</b></td>
|
||||
<td>{{ device.target_path }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if notifications %}
|
||||
<div class="col">
|
||||
<div class="card mt-3">
|
||||
<h2 class="card-header">Notifications</h2>
|
||||
<div class="card-body">
|
||||
{% for notification in notifications %}
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>Name:</b></td>
|
||||
<td>{{ notification.notification }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Description:</b></td>
|
||||
<td>{{ notification.notification.description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Recipient:</b></td>
|
||||
<td>{{ notification.notification.recipient }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Type:</b></td>
|
||||
<td>{{ notification.notification.notification_type }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
|
@ -1,8 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% block section_title %}List of Backups{% endblock %}
|
||||
{% block content %}
|
||||
<div class="table-responsive">
|
||||
{% render_table backups %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,168 +0,0 @@
|
|||
/* Sakura.css v1.0.0
|
||||
* ================
|
||||
* Minimal css theme.
|
||||
* Project: https://github.com/oxalorg/sakura
|
||||
*/
|
||||
/* Body */
|
||||
html {
|
||||
font-size: 62.5%;
|
||||
font-family: sans-serif; }
|
||||
|
||||
body {
|
||||
font-size: 1.8rem;
|
||||
line-height: 1.618;
|
||||
max-width: 38em;
|
||||
margin: auto;
|
||||
color: #4a4a4a;
|
||||
background-color: #f9f9f9;
|
||||
padding: 13px; }
|
||||
|
||||
@media (max-width: 684px) {
|
||||
body {
|
||||
font-size: 1.53rem; } }
|
||||
|
||||
@media (max-width: 382px) {
|
||||
body {
|
||||
font-size: 1.35rem; } }
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
line-height: 1.1;
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
font-weight: 700;
|
||||
overflow-wrap: break-word;
|
||||
word-wrap: break-word;
|
||||
-ms-word-break: break-all;
|
||||
word-break: break-word;
|
||||
-ms-hyphens: auto;
|
||||
-moz-hyphens: auto;
|
||||
-webkit-hyphens: auto;
|
||||
hyphens: auto; }
|
||||
|
||||
h1 {
|
||||
font-size: 2.35em; }
|
||||
|
||||
h2 {
|
||||
font-size: 2.00em; }
|
||||
|
||||
h3 {
|
||||
font-size: 1.75em; }
|
||||
|
||||
h4 {
|
||||
font-size: 1.5em; }
|
||||
|
||||
h5 {
|
||||
font-size: 1.25em; }
|
||||
|
||||
h6 {
|
||||
font-size: 1em; }
|
||||
|
||||
footer {
|
||||
font-size: 0.5em; }
|
||||
|
||||
small, sub, sup {
|
||||
font-size: 75%; }
|
||||
|
||||
hr {
|
||||
border-color: #338618; }
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #338618; }
|
||||
a:hover {
|
||||
color: #5e5e5e;
|
||||
border-bottom: 2px solid #4a4a4a; }
|
||||
|
||||
ul {
|
||||
padding-left: 1.4em; }
|
||||
|
||||
li {
|
||||
margin-bottom: 0.4em; }
|
||||
|
||||
blockquote {
|
||||
font-style: italic;
|
||||
margin-left: 1.5em;
|
||||
padding-left: 1em;
|
||||
border-left: 3px solid #338618; }
|
||||
|
||||
img {
|
||||
max-width: 100%; }
|
||||
|
||||
/* Pre and Code */
|
||||
pre {
|
||||
background-color: #C7E3BE;
|
||||
display: block;
|
||||
padding: 1em;
|
||||
overflow-x: auto; }
|
||||
|
||||
code {
|
||||
font-size: 0.9em;
|
||||
padding: 0 0.5em;
|
||||
background-color: #C7E3BE;
|
||||
white-space: pre-wrap; }
|
||||
|
||||
pre > code {
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
white-space: pre; }
|
||||
|
||||
/* Tables */
|
||||
table {
|
||||
text-align: justify;
|
||||
width: 60%;
|
||||
border-collapse: collapse; }
|
||||
|
||||
td, th {
|
||||
padding: 0.2em;
|
||||
border: 1px solid #C7E3BE; }
|
||||
|
||||
/* Buttons, forms and input */
|
||||
input, textarea {
|
||||
border: 1px solid #4a4a4a; }
|
||||
input:focus, textarea:focus {
|
||||
border: 1px solid #338618; }
|
||||
|
||||
textarea {
|
||||
width: 100%; }
|
||||
|
||||
.button, button, input[type="submit"], input[type="reset"], input[type="button"] {
|
||||
display: inline-block;
|
||||
padding: 5px 10px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
background-color: #338618;
|
||||
color: #f9f9f9;
|
||||
border-radius: 1px;
|
||||
border: 1px solid #338618;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box; }
|
||||
.button[disabled], button[disabled], input[type="submit"][disabled], input[type="reset"][disabled], input[type="button"][disabled] {
|
||||
cursor: default;
|
||||
opacity: .5; }
|
||||
.button:focus, .button:hover, button:focus, button:hover, input[type="submit"]:focus, input[type="submit"]:hover, input[type="reset"]:focus, input[type="reset"]:hover, input[type="button"]:focus, input[type="button"]:hover {
|
||||
background-color: #5e5e5e;
|
||||
border-color: #5e5e5e;
|
||||
color: #f9f9f9;
|
||||
outline: 0; }
|
||||
|
||||
textarea, select, input[type] {
|
||||
color: #4a4a4a;
|
||||
padding: 6px 10px;
|
||||
/* The 6px vertically centers text on FF, ignored by Webkit */
|
||||
margin-bottom: 10px;
|
||||
background-color: #C7E3BE;
|
||||
border: 1px solid #C7E3BE;
|
||||
border-radius: 4px;
|
||||
box-shadow: none;
|
||||
box-sizing: border-box; }
|
||||
textarea:focus, select:focus, input[type]:focus {
|
||||
border: 1px solid #338618;
|
||||
outline: 0; }
|
||||
|
||||
input[type="checkbox"]:focus {
|
||||
outline: 1px dotted #338618; }
|
||||
|
||||
label, legend, fieldset {
|
||||
display: block;
|
||||
margin-bottom: .5rem;
|
||||
font-weight: 600; }
|
|
@ -1,495 +0,0 @@
|
|||
/*
|
||||
SortTable
|
||||
version 2
|
||||
7th April 2007
|
||||
Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/
|
||||
|
||||
Instructions:
|
||||
Download this file
|
||||
Add <script src="sorttable.js"></script> to your HTML
|
||||
Add class="sortable" to any table you'd like to make sortable
|
||||
Click on the headers to sort
|
||||
|
||||
Thanks to many, many people for contributions and suggestions.
|
||||
Licenced as X11: http://www.kryogenix.org/code/browser/licence.html
|
||||
This basically means: do what you want with it.
|
||||
*/
|
||||
|
||||
|
||||
var stIsIE = /*@cc_on!@*/false;
|
||||
|
||||
sorttable = {
|
||||
init: function() {
|
||||
// quit if this function has already been called
|
||||
if (arguments.callee.done) return;
|
||||
// flag this function so we don't do the same thing twice
|
||||
arguments.callee.done = true;
|
||||
// kill the timer
|
||||
if (_timer) clearInterval(_timer);
|
||||
|
||||
if (!document.createElement || !document.getElementsByTagName) return;
|
||||
|
||||
sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;
|
||||
|
||||
forEach(document.getElementsByTagName('table'), function(table) {
|
||||
if (table.className.search(/\bsortable\b/) != -1) {
|
||||
sorttable.makeSortable(table);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
makeSortable: function(table) {
|
||||
if (table.getElementsByTagName('thead').length == 0) {
|
||||
// table doesn't have a tHead. Since it should have, create one and
|
||||
// put the first table row in it.
|
||||
the = document.createElement('thead');
|
||||
the.appendChild(table.rows[0]);
|
||||
table.insertBefore(the,table.firstChild);
|
||||
}
|
||||
// Safari doesn't support table.tHead, sigh
|
||||
if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];
|
||||
|
||||
if (table.tHead.rows.length != 1) return; // can't cope with two header rows
|
||||
|
||||
// Sorttable v1 put rows with a class of "sortbottom" at the bottom (as
|
||||
// "total" rows, for example). This is B&R, since what you're supposed
|
||||
// to do is put them in a tfoot. So, if there are sortbottom rows,
|
||||
// for backwards compatibility, move them to tfoot (creating it if needed).
|
||||
sortbottomrows = [];
|
||||
for (var i=0; i<table.rows.length; i++) {
|
||||
if (table.rows[i].className.search(/\bsortbottom\b/) != -1) {
|
||||
sortbottomrows[sortbottomrows.length] = table.rows[i];
|
||||
}
|
||||
}
|
||||
if (sortbottomrows) {
|
||||
if (table.tFoot == null) {
|
||||
// table doesn't have a tfoot. Create one.
|
||||
tfo = document.createElement('tfoot');
|
||||
table.appendChild(tfo);
|
||||
}
|
||||
for (var i=0; i<sortbottomrows.length; i++) {
|
||||
tfo.appendChild(sortbottomrows[i]);
|
||||
}
|
||||
delete sortbottomrows;
|
||||
}
|
||||
|
||||
// work through each column and calculate its type
|
||||
headrow = table.tHead.rows[0].cells;
|
||||
for (var i=0; i<headrow.length; i++) {
|
||||
// manually override the type with a sorttable_type attribute
|
||||
if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col
|
||||
mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/);
|
||||
if (mtch) { override = mtch[1]; }
|
||||
if (mtch && typeof sorttable["sort_"+override] == 'function') {
|
||||
headrow[i].sorttable_sortfunction = sorttable["sort_"+override];
|
||||
} else {
|
||||
headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);
|
||||
}
|
||||
// make it clickable to sort
|
||||
headrow[i].sorttable_columnindex = i;
|
||||
headrow[i].sorttable_tbody = table.tBodies[0];
|
||||
dean_addEvent(headrow[i],"click", sorttable.innerSortFunction = function(e) {
|
||||
|
||||
if (this.className.search(/\bsorttable_sorted\b/) != -1) {
|
||||
// if we're already sorted by this column, just
|
||||
// reverse the table, which is quicker
|
||||
sorttable.reverse(this.sorttable_tbody);
|
||||
this.className = this.className.replace('sorttable_sorted',
|
||||
'sorttable_sorted_reverse');
|
||||
this.removeChild(document.getElementById('sorttable_sortfwdind'));
|
||||
sortrevind = document.createElement('span');
|
||||
sortrevind.id = "sorttable_sortrevind";
|
||||
sortrevind.innerHTML = stIsIE ? ' <font face="webdings">5</font>' : ' ▴';
|
||||
this.appendChild(sortrevind);
|
||||
return;
|
||||
}
|
||||
if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) {
|
||||
// if we're already sorted by this column in reverse, just
|
||||
// re-reverse the table, which is quicker
|
||||
sorttable.reverse(this.sorttable_tbody);
|
||||
this.className = this.className.replace('sorttable_sorted_reverse',
|
||||
'sorttable_sorted');
|
||||
this.removeChild(document.getElementById('sorttable_sortrevind'));
|
||||
sortfwdind = document.createElement('span');
|
||||
sortfwdind.id = "sorttable_sortfwdind";
|
||||
sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾';
|
||||
this.appendChild(sortfwdind);
|
||||
return;
|
||||
}
|
||||
|
||||
// remove sorttable_sorted classes
|
||||
theadrow = this.parentNode;
|
||||
forEach(theadrow.childNodes, function(cell) {
|
||||
if (cell.nodeType == 1) { // an element
|
||||
cell.className = cell.className.replace('sorttable_sorted_reverse','');
|
||||
cell.className = cell.className.replace('sorttable_sorted','');
|
||||
}
|
||||
});
|
||||
sortfwdind = document.getElementById('sorttable_sortfwdind');
|
||||
if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); }
|
||||
sortrevind = document.getElementById('sorttable_sortrevind');
|
||||
if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); }
|
||||
|
||||
this.className += ' sorttable_sorted';
|
||||
sortfwdind = document.createElement('span');
|
||||
sortfwdind.id = "sorttable_sortfwdind";
|
||||
sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾';
|
||||
this.appendChild(sortfwdind);
|
||||
|
||||
// build an array to sort. This is a Schwartzian transform thing,
|
||||
// i.e., we "decorate" each row with the actual sort key,
|
||||
// sort based on the sort keys, and then put the rows back in order
|
||||
// which is a lot faster because you only do getInnerText once per row
|
||||
row_array = [];
|
||||
col = this.sorttable_columnindex;
|
||||
rows = this.sorttable_tbody.rows;
|
||||
for (var j=0; j<rows.length; j++) {
|
||||
row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]];
|
||||
}
|
||||
/* If you want a stable sort, uncomment the following line */
|
||||
//sorttable.shaker_sort(row_array, this.sorttable_sortfunction);
|
||||
/* and comment out this one */
|
||||
row_array.sort(this.sorttable_sortfunction);
|
||||
|
||||
tb = this.sorttable_tbody;
|
||||
for (var j=0; j<row_array.length; j++) {
|
||||
tb.appendChild(row_array[j][1]);
|
||||
}
|
||||
|
||||
delete row_array;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
guessType: function(table, column) {
|
||||
// guess the type of a column based on its first non-blank row
|
||||
sortfn = sorttable.sort_alpha;
|
||||
for (var i=0; i<table.tBodies[0].rows.length; i++) {
|
||||
text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
|
||||
if (text != '') {
|
||||
if (text.match(/^-?[£$¤]?[\d,.]+%?$/)) {
|
||||
return sorttable.sort_numeric;
|
||||
}
|
||||
// check for a date: dd/mm/yyyy or dd/mm/yy
|
||||
// can have / or . or - as separator
|
||||
// can be mm/dd as well
|
||||
possdate = text.match(sorttable.DATE_RE)
|
||||
if (possdate) {
|
||||
// looks like a date
|
||||
first = parseInt(possdate[1]);
|
||||
second = parseInt(possdate[2]);
|
||||
if (first > 12) {
|
||||
// definitely dd/mm
|
||||
return sorttable.sort_ddmm;
|
||||
} else if (second > 12) {
|
||||
return sorttable.sort_mmdd;
|
||||
} else {
|
||||
// looks like a date, but we can't tell which, so assume
|
||||
// that it's dd/mm (English imperialism!) and keep looking
|
||||
sortfn = sorttable.sort_ddmm;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sortfn;
|
||||
},
|
||||
|
||||
getInnerText: function(node) {
|
||||
// gets the text we want to use for sorting for a cell.
|
||||
// strips leading and trailing whitespace.
|
||||
// this is *not* a generic getInnerText function; it's special to sorttable.
|
||||
// for example, you can override the cell text with a customkey attribute.
|
||||
// it also gets .value for <input> fields.
|
||||
|
||||
if (!node) return "";
|
||||
|
||||
hasInputs = (typeof node.getElementsByTagName == 'function') &&
|
||||
node.getElementsByTagName('input').length;
|
||||
|
||||
if (node.getAttribute("sorttable_customkey") != null) {
|
||||
return node.getAttribute("sorttable_customkey");
|
||||
}
|
||||
else if (typeof node.textContent != 'undefined' && !hasInputs) {
|
||||
return node.textContent.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else if (typeof node.innerText != 'undefined' && !hasInputs) {
|
||||
return node.innerText.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else if (typeof node.text != 'undefined' && !hasInputs) {
|
||||
return node.text.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else {
|
||||
switch (node.nodeType) {
|
||||
case 3:
|
||||
if (node.nodeName.toLowerCase() == 'input') {
|
||||
return node.value.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
case 4:
|
||||
return node.nodeValue.replace(/^\s+|\s+$/g, '');
|
||||
break;
|
||||
case 1:
|
||||
case 11:
|
||||
var innerText = '';
|
||||
for (var i = 0; i < node.childNodes.length; i++) {
|
||||
innerText += sorttable.getInnerText(node.childNodes[i]);
|
||||
}
|
||||
return innerText.replace(/^\s+|\s+$/g, '');
|
||||
break;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
reverse: function(tbody) {
|
||||
// reverse the rows in a tbody
|
||||
newrows = [];
|
||||
for (var i=0; i<tbody.rows.length; i++) {
|
||||
newrows[newrows.length] = tbody.rows[i];
|
||||
}
|
||||
for (var i=newrows.length-1; i>=0; i--) {
|
||||
tbody.appendChild(newrows[i]);
|
||||
}
|
||||
delete newrows;
|
||||
},
|
||||
|
||||
/* sort functions
|
||||
each sort function takes two parameters, a and b
|
||||
you are comparing a[0] and b[0] */
|
||||
sort_numeric: function(a,b) {
|
||||
aa = parseFloat(a[0].replace(/[^0-9.-]/g,''));
|
||||
if (isNaN(aa)) aa = 0;
|
||||
bb = parseFloat(b[0].replace(/[^0-9.-]/g,''));
|
||||
if (isNaN(bb)) bb = 0;
|
||||
return aa-bb;
|
||||
},
|
||||
sort_alpha: function(a,b) {
|
||||
if (a[0]==b[0]) return 0;
|
||||
if (a[0]<b[0]) return -1;
|
||||
return 1;
|
||||
},
|
||||
sort_ddmm: function(a,b) {
|
||||
mtch = a[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; m = mtch[2]; d = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt1 = y+m+d;
|
||||
mtch = b[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; m = mtch[2]; d = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt2 = y+m+d;
|
||||
if (dt1==dt2) return 0;
|
||||
if (dt1<dt2) return -1;
|
||||
return 1;
|
||||
},
|
||||
sort_mmdd: function(a,b) {
|
||||
mtch = a[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; d = mtch[2]; m = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt1 = y+m+d;
|
||||
mtch = b[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; d = mtch[2]; m = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt2 = y+m+d;
|
||||
if (dt1==dt2) return 0;
|
||||
if (dt1<dt2) return -1;
|
||||
return 1;
|
||||
},
|
||||
|
||||
shaker_sort: function(list, comp_func) {
|
||||
// A stable sort function to allow multi-level sorting of data
|
||||
// see: http://en.wikipedia.org/wiki/Cocktail_sort
|
||||
// thanks to Joseph Nahmias
|
||||
var b = 0;
|
||||
var t = list.length - 1;
|
||||
var swap = true;
|
||||
|
||||
while(swap) {
|
||||
swap = false;
|
||||
for(var i = b; i < t; ++i) {
|
||||
if ( comp_func(list[i], list[i+1]) > 0 ) {
|
||||
var q = list[i]; list[i] = list[i+1]; list[i+1] = q;
|
||||
swap = true;
|
||||
}
|
||||
} // for
|
||||
t--;
|
||||
|
||||
if (!swap) break;
|
||||
|
||||
for(var i = t; i > b; --i) {
|
||||
if ( comp_func(list[i], list[i-1]) < 0 ) {
|
||||
var q = list[i]; list[i] = list[i-1]; list[i-1] = q;
|
||||
swap = true;
|
||||
}
|
||||
} // for
|
||||
b++;
|
||||
|
||||
} // while(swap)
|
||||
}
|
||||
}
|
||||
|
||||
/* ******************************************************************
|
||||
Supporting functions: bundled here to avoid depending on a library
|
||||
****************************************************************** */
|
||||
|
||||
// Dean Edwards/Matthias Miller/John Resig
|
||||
|
||||
/* for Mozilla/Opera9 */
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener("DOMContentLoaded", sorttable.init, false);
|
||||
}
|
||||
|
||||
/* for Internet Explorer */
|
||||
/*@cc_on @*/
|
||||
/*@if (@_win32)
|
||||
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
|
||||
var script = document.getElementById("__ie_onload");
|
||||
script.onreadystatechange = function() {
|
||||
if (this.readyState == "complete") {
|
||||
sorttable.init(); // call the onload handler
|
||||
}
|
||||
};
|
||||
/*@end @*/
|
||||
|
||||
/* for Safari */
|
||||
if (/WebKit/i.test(navigator.userAgent)) { // sniff
|
||||
var _timer = setInterval(function() {
|
||||
if (/loaded|complete/.test(document.readyState)) {
|
||||
sorttable.init(); // call the onload handler
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
|
||||
/* for other browsers */
|
||||
window.onload = sorttable.init;
|
||||
|
||||
// written by Dean Edwards, 2005
|
||||
// with input from Tino Zijdel, Matthias Miller, Diego Perini
|
||||
|
||||
// http://dean.edwards.name/weblog/2005/10/add-event/
|
||||
|
||||
function dean_addEvent(element, type, handler) {
|
||||
if (element.addEventListener) {
|
||||
element.addEventListener(type, handler, false);
|
||||
} else {
|
||||
// assign each event handler a unique ID
|
||||
if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++;
|
||||
// create a hash table of event types for the element
|
||||
if (!element.events) element.events = {};
|
||||
// create a hash table of event handlers for each element/event pair
|
||||
var handlers = element.events[type];
|
||||
if (!handlers) {
|
||||
handlers = element.events[type] = {};
|
||||
// store the existing event handler (if there is one)
|
||||
if (element["on" + type]) {
|
||||
handlers[0] = element["on" + type];
|
||||
}
|
||||
}
|
||||
// store the event handler in the hash table
|
||||
handlers[handler.$$guid] = handler;
|
||||
// assign a global event handler to do all the work
|
||||
element["on" + type] = handleEvent;
|
||||
}
|
||||
};
|
||||
// a counter used to create unique IDs
|
||||
dean_addEvent.guid = 1;
|
||||
|
||||
function removeEvent(element, type, handler) {
|
||||
if (element.removeEventListener) {
|
||||
element.removeEventListener(type, handler, false);
|
||||
} else {
|
||||
// delete the event handler from the hash table
|
||||
if (element.events && element.events[type]) {
|
||||
delete element.events[type][handler.$$guid];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function handleEvent(event) {
|
||||
var returnValue = true;
|
||||
// grab the event object (IE uses a global event object)
|
||||
event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
|
||||
// get a reference to the hash table of event handlers
|
||||
var handlers = this.events[event.type];
|
||||
// execute each event handler
|
||||
for (var i in handlers) {
|
||||
this.$$handleEvent = handlers[i];
|
||||
if (this.$$handleEvent(event) === false) {
|
||||
returnValue = false;
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
function fixEvent(event) {
|
||||
// add W3C standard event methods
|
||||
event.preventDefault = fixEvent.preventDefault;
|
||||
event.stopPropagation = fixEvent.stopPropagation;
|
||||
return event;
|
||||
};
|
||||
fixEvent.preventDefault = function() {
|
||||
this.returnValue = false;
|
||||
};
|
||||
fixEvent.stopPropagation = function() {
|
||||
this.cancelBubble = true;
|
||||
}
|
||||
|
||||
// Dean's forEach: http://dean.edwards.name/base/forEach.js
|
||||
/*
|
||||
forEach, version 1.0
|
||||
Copyright 2006, Dean Edwards
|
||||
License: http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
// array-like enumeration
|
||||
if (!Array.forEach) { // mozilla already supports this
|
||||
Array.forEach = function(array, block, context) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
block.call(context, array[i], i, array);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// generic enumeration
|
||||
Function.prototype.forEach = function(object, block, context) {
|
||||
for (var key in object) {
|
||||
if (typeof this.prototype[key] == "undefined") {
|
||||
block.call(context, object[key], key, object);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// character enumeration
|
||||
String.forEach = function(string, block, context) {
|
||||
Array.forEach(string.split(""), function(chr, index) {
|
||||
block.call(context, chr, index, string);
|
||||
});
|
||||
};
|
||||
|
||||
// globally resolve forEach enumeration
|
||||
var forEach = function(object, block, context) {
|
||||
if (object) {
|
||||
var resolve = Object; // default
|
||||
if (object instanceof Function) {
|
||||
// functions have a "length" property
|
||||
resolve = Function;
|
||||
} else if (object.forEach instanceof Function) {
|
||||
// the object implements a custom forEach method so use that
|
||||
object.forEach(block, context);
|
||||
return;
|
||||
} else if (typeof object == "string") {
|
||||
// the object is a string
|
||||
resolve = String;
|
||||
} else if (typeof object.length == "number") {
|
||||
// the object is array-like
|
||||
resolve = Array;
|
||||
}
|
||||
resolve.forEach(object, block, context);
|
||||
}
|
||||
};
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}List of Computers{% endblock %}
|
||||
{% block content %}
|
||||
<p>
|
||||
<form action="" method="get" class="form form-inline">
|
||||
{% csrf_token %}
|
||||
{{ filter.form|crispy }}
|
||||
<input type="submit" value="Filter" class="btn btn-primary">
|
||||
</form>
|
||||
</p>
|
||||
<div class="table-responsive">
|
||||
{% render_table table %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,14 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Create Computer{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{% url 'computers' view.kwargs.pk %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,133 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}{{ device }}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{% block device_details %}
|
||||
{% include "devices/device_details_block.html" %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
{% block warranty %}
|
||||
{% include "devices/warranty_block.html" %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
{% block ips %}
|
||||
{% include "devices/ip_block.html" %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
<h2>Host</h2>
|
||||
{% if device.host %}
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{% url 'computer' device.host.id %}">{{ device.host }}</a>
|
||||
<a href="{% url 'computer_update' pk %}" class="edit" title="Edit" data-toggle="tooltip"><i class="material-icons">edit</i></a>
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
<p><a href="{% url 'computer_update' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></p>
|
||||
{% endif %}
|
||||
|
||||
<h2>Operating System</h2>
|
||||
{% if device.os %}
|
||||
<ul>
|
||||
<li>
|
||||
{{ device.os }}
|
||||
<a href="{% url 'computer_update' pk %}" class="edit" title="Edit" data-toggle="tooltip"><i class="material-icons">edit</i></a>
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
<p><a href="{% url 'computer_update' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></p>
|
||||
{% endif %}
|
||||
|
||||
<h2>Software</h2>
|
||||
<ul>
|
||||
{% for software in software_relations %}
|
||||
<li>{{ software.software }} <a href="{% url 'software_relation_delete' software.pk %}" class="delete" title="Delete" data-toggle="tooltip"><i class="material-icons">clear</i></a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p><a href="{% url 'software_relation_create' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></p>
|
||||
|
||||
{% block license %}
|
||||
{% include "licenses/license_block.html" %}
|
||||
{% endblock %}
|
||||
|
||||
<h2>Backup</h2>
|
||||
<ul>
|
||||
{% for backup in backup_relations %}
|
||||
<li><a href="{% url 'backup' backup.id %}">{{ backup }}</a> <a href="{% url 'backup_delete' backup.pk %}" class="delete" title="Delete" data-toggle="tooltip"><i class="material-icons">clear</i></a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p><a href="{% url 'backup_create' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="card mt-3">
|
||||
<h2 class="card-header">Hardware</h2>
|
||||
<div class="card-body">
|
||||
<p><b>CPUs:</b></p>
|
||||
{% for cpu in cpu_relations %}
|
||||
{{ cpu.amount }}x {{ cpu.cpu }} <a href="{% url 'cpu_relation_delete' cpu.pk %}" class="delete" title="Delete" data-toggle="tooltip"><i class="material-icons">clear</i></a><br>
|
||||
{% endfor %}
|
||||
<p><a href="{% url 'cpu_relation_create' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></p>
|
||||
|
||||
<p><b>GPUs:</b></p>
|
||||
{% for gpu in gpu_relations %}
|
||||
{{ gpu.amount }}x {{ gpu.gpu }} <a href="{% url 'gpu_relation_delete' gpu.pk %}" class="delete" title="Delete" data-toggle="tooltip"><i class="material-icons">clear</i></a><br>
|
||||
{% endfor %}
|
||||
<p><a href="{% url 'gpu_relation_create' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></p>
|
||||
|
||||
<p><b>RAM Modules:</b></p>
|
||||
{% for module in ram_relations %}
|
||||
{{ module.amount }}x {{ module.ram }} <a href="{% url 'ram_relation_delete' module.pk %}" class="delete" title="Delete" data-toggle="tooltip"><i class="material-icons">clear</i></a><br>
|
||||
{% endfor %}
|
||||
<p><a href="{% url 'ram_relation_create' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></p>
|
||||
|
||||
<p><b>Disks:</b></p>
|
||||
{% for disk in disks_relations %}
|
||||
{{ disk.amount }}x {{ disk.disk }} <a href="{% url 'disk_relation_delete' disk.pk %}" class="delete" title="Delete" data-toggle="tooltip"><i class="material-icons">clear</i></a><br>
|
||||
{% endfor %}
|
||||
<p><a href="{% url 'disk_relation_create' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></p>
|
||||
|
||||
<h3>RAID</h3>
|
||||
{% for raid, disks in raid_disk_pairs.items %}
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>Type:</b></td>
|
||||
<td>{{ raid.raid_type }}</td>
|
||||
<td><b>Usable Space</b></td>
|
||||
<td>{{ raid.usable_space }}</td>
|
||||
<td><a href="{% url 'raid_delete' raid.pk %}" class="delete" title="Delete" data-toggle="tooltip"><i class="material-icons">delete</i></a></td>
|
||||
</tr>
|
||||
{% if disks %}
|
||||
{% for disk in disks %}
|
||||
<tr>
|
||||
<td><b>Disk Type</b></td>
|
||||
<td>{{ disk.disk }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Amount</b></td>
|
||||
<td>{{ disk.disk_amount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</table>
|
||||
{% endfor %}
|
||||
<p><a href="{% url 'raid_create' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,17 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% block section_title %}List of Computers{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<form action="{% url 'computer_create' pk %}">{% csrf_token %}
|
||||
<input type="submit" value="Add Computer" class="btn btn-primary">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{% render_table computers %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,20 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Edit Computer{% endblock %}
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
{% csrf_token %}
|
||||
<div class="col">
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
{{ form|crispy }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
</form>
|
||||
{% endblock %}
|
|
@ -1,14 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Add RAM{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{% url 'computer' view.kwargs.pk %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,28 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}{{ cronjob.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
<b>Host:</b> <a href="{% url 'computer' cronjob.host.id %}">{{ cronjob.host }}</a>
|
||||
</p>
|
||||
<p>
|
||||
<b>Command:</b><br/>
|
||||
<code>{{ cronjob.command }}</code>
|
||||
</p>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Minute</th>
|
||||
<th>Hour</th>
|
||||
<th>Day of Week</th>
|
||||
<th>Day of Month</th>
|
||||
<th>Month</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ cronjob.minutes }}</td>
|
||||
<td>{{ cronjob.hours }}</td>
|
||||
<td>{{ cronjob.weekday }}</td>
|
||||
<td>{{ cronjob.day }}</td>
|
||||
<td>{{ cronjob.month }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
|
@ -1,28 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}List of Cron Jobs{% endblock %}
|
||||
{% block content %}
|
||||
{% if cronjob_list %}
|
||||
<table class="sortable">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Hostname</th>
|
||||
<th>Minute</th>
|
||||
<th>Hour</th>
|
||||
<th>Day of Week</th>
|
||||
<th>Day of Month</th>
|
||||
<th>Month</th>
|
||||
</tr>
|
||||
{% for cronjob in cronjob_list %}
|
||||
<tr>
|
||||
<td><a href="{% url 'cronjob' cronjob.id %}">{{ cronjob.name }}</a></td>
|
||||
<td>{{ cronjob.host }}</td>
|
||||
<td>{{ cronjob.minutes }}</td>
|
||||
<td>{{ cronjob.hours }}</td>
|
||||
<td>{{ cronjob.weekday }}</td>
|
||||
<td>{{ cronjob.day }}</td>
|
||||
<td>{{ cronjob.month }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,14 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Add RAM{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{% url 'computer' view.kwargs.pk %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,14 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Add RAM{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{% url 'computer' view.kwargs.pk %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,14 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Add RAID{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{% url 'computer' view.kwargs.pk %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,14 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Add RAM{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{% url 'computer' view.kwargs.pk %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,17 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load core_extras %}
|
||||
{% block section_title %}Remove {{ object|verbose_name|title }}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>Are you sure you want to remove the "{{ object|verbose_name }}" from "{{ object }}"?</p>
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,14 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Add Sofware{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{% url 'computer' view.kwargs.pk %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,35 +0,0 @@
|
|||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link rel="stylesheet" type="text/css" href="{% static "core/css/bootstrap.min.css" %}">
|
||||
<link rel="stylesheet" type="text/css" href="{% static "core/css/material-icons.css" %}">
|
||||
<link rel="shortcut icon" type="image/vnd.microsoft.icon" href="{% static 'core/img/favicon.ico' %}"/>
|
||||
<title>Network Inventory</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<a href="{% url 'customers' %}">Home</a> |
|
||||
<a href="{% url 'warranties' %}">Warranties</a> |
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="{% url 'all_computers' %}">All Computers</a> |
|
||||
{% endif %}
|
||||
{% if user.is_authenticated %}
|
||||
<a href="{% url 'logout' %}">Logout</a> |
|
||||
{% else %}
|
||||
<a href="{% url 'login' %}" >Login</a> |
|
||||
{% endif %}
|
||||
<h1>{% block section_title %}Device Inventory{% endblock %}</h1>
|
||||
{% block content %}{% endblock %}
|
||||
<footer>
|
||||
{% block footer %}
|
||||
<div class="row mt-3">
|
||||
<p class="copyright">Created by Andreas Zweili licensed under GPLv3.0</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,24 +0,0 @@
|
|||
{% extends 'core/base.html' %}
|
||||
|
||||
{% block section_title %}Login{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form id="login" name="login" method="post">
|
||||
{% csrf_token %}
|
||||
<p>
|
||||
<label for="id_username">Username:</label>
|
||||
<div class="ui input">
|
||||
<input type="text" name="username" autofocus required id="id_username">
|
||||
</div>
|
||||
</p>
|
||||
<p>
|
||||
<label for="id_password">Password:</label>
|
||||
<div class="ui input">
|
||||
<input type="password" name="password" required id="id_password">
|
||||
</div>
|
||||
</p>
|
||||
<p>
|
||||
<button name="button_login" type="submit" class="ui button">Login</button>
|
||||
</p>
|
||||
</form>
|
||||
{% endblock %}
|
|
@ -1,16 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}Delete Customer{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>Are you sure you want to delete the customer "{{ object }}"?</p>
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
<a href="{% url 'customers' %}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,14 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Create Customer{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{% url 'customers' %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,17 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}{{ customer.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col mt-3">
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
<h4>Description</h4>
|
||||
<div class="card-text"><p>{{ customer.description }}</p></div>
|
||||
<p>{{ customer.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,22 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% block section_title %}List of Customers{% endblock %}
|
||||
{% block content %}
|
||||
{% if request.user.is_superuser %}
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<form action="{% url 'customer_create' %}">
|
||||
<input type="submit" value="Add Customer" class="btn btn-primary">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="table-responsive">
|
||||
{% render_table customers %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
|
@ -1,16 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}Delete Device{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>Are you sure you want to delete the device "{{ object }}"?</p>
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
<a href="{% url 'devices' object.customer.pk %}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,14 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Create Device{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{% url 'devices' view.kwargs.pk %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,23 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}{{ device.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col mt-3">
|
||||
{% block device_details %}
|
||||
{% include "devices/device_details_block.html" %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
<div class="col mt-3">
|
||||
{% block warranty_details %}
|
||||
{% include "devices/warranty_block.html" %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
<div class="col mt-3">
|
||||
{% block ips %}
|
||||
{% include "devices/ip_block.html" %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,46 +0,0 @@
|
|||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
<h4>Description</h4>
|
||||
<div class="card-text"><p>{{ device.description }}</p></div>
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>Serial Number:</b></td>
|
||||
<td><code>{{ device.serialnumber }}</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Category:</b></td>
|
||||
<td>{{ device.category }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Owner:</b></td>
|
||||
<td>{{ device.owner }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Customer:</b></td>
|
||||
<td><a href="{% url 'customer' device.customer.id %}">{{ device.customer }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Manufacturer:</b></td>
|
||||
{% if device.manufacturer %}
|
||||
<td><a href="{% url 'manufacturer' device.manufacturer.id %}">{{ device.manufacturer }}</a></td>
|
||||
{% else %}
|
||||
<td>{{ device.manufacturer }}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Model:</b></td>
|
||||
<td>{{ device.model }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><b>Location:</b></td>
|
||||
<td>{{ device.location }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Installation Date:</b></td>
|
||||
<td>{{ device.installation_date }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<a href="{% url 'device_update' pk %}" class="edit" title="Edit" data-toggle="tooltip"><i class="material-icons">edit</i></a>
|
||||
</div>
|
||||
</div>
|
|
@ -1,17 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}Delete Warranty{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>Are you sure you want to delete the IP "{{ object.ip }}" for "{{ object.device }}"?</p>
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,20 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Add Device to Net{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,27 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Edit Device in Net{% endblock %}
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
{% csrf_token %}
|
||||
<div class="col">
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
{{ form|crispy }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
|
@ -1,19 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% block section_title %}List of General Devices{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<form action="{% url 'device_create' pk %}">
|
||||
<input type="submit" value="Add Device" class="btn btn-primary">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="table-responsive">
|
||||
{% render_table devices %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,27 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Edit Device{% endblock %}
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
{% csrf_token %}
|
||||
<div class="col">
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
{{ form|crispy }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
|
@ -1,22 +0,0 @@
|
|||
<div class="card mt-3">
|
||||
<h2 class="card-header">IPs <a href="{% url 'device_in_net_create' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></h2>
|
||||
<div class="card-body">
|
||||
<table class="table table-bordered">
|
||||
{% if net_relations %}
|
||||
{% for net in net_relations %}
|
||||
<tr>
|
||||
<td><b>{{ net.net }}</b></td>
|
||||
<td>
|
||||
<a href="{% url 'net' net.net.pk %}">{{ net }}</a><br>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'device_in_net_update' net.pk %}" class="edit" title="Edit" data-toggle="tooltip"><i class="material-icons">edit</i></a>
|
||||
<a href="{% url 'device_in_net_delete' net.pk %}" class="delete" title="Delete" data-toggle="tooltip"><i class="material-icons">delete</i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}{{ devicemanufacturer.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col mt-3">
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
<h4>Description</h4>
|
||||
<div class="card-text"><p>{{ devicemanufacturer.description }}</p></div>
|
||||
<p>{{ devicemanufacturer.description }}</p>
|
||||
Phone: <a href="tel:{{ devicemanufacturer.phone_number }}">{{ devicemanufacturer.phone_number }}</a><br/>
|
||||
Email: <a href="mailto:{{ devicemanufacturer.email_address }}">{{ devicemanufacturer.email_address }}</a><br/>
|
||||
Website: <a href="{{ devicemanufacturer.website }}">{{ devicemanufacturer.website }}</a><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,6 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% block section_title %}List of Device Warranties{% endblock %}
|
||||
{% block content %}
|
||||
{% render_table devices %}
|
||||
{% endblock %}
|
|
@ -1,37 +0,0 @@
|
|||
<div class="card mt-3">
|
||||
<h2 class="card-header">Warranty <a href="{% url 'warranty_create' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></h2>
|
||||
<div class="card-body">
|
||||
{% if warranty_relations %}
|
||||
{% for warranty in warranty_relations %}
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>Valid From:</b></td>
|
||||
<td>
|
||||
{{ warranty.valid_from }}<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Valid Until:</b></td>
|
||||
<td>
|
||||
{{ warranty.valid_until }}<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Duration:</b></td>
|
||||
<td>
|
||||
{{ warranty.duration_in_years }}<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Type:</b></td>
|
||||
<td>
|
||||
{{ warranty.warranty_type }}<br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<a href="{% url 'warranty_update' warranty.pk %}" class="edit" title="Edit" data-toggle="tooltip"><i class="material-icons">edit</i></a>
|
||||
<a href="{% url 'warranty_delete' warranty.pk %}" class="delete" title="Delete" data-toggle="tooltip"><i class="material-icons">delete</i></a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
|
@ -1,16 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}Delete Warranty{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>Are you sure you want to delete the warranty for "{{ object }}"?</p>
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,20 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Add Warranty{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,27 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Edit Warranty{% endblock %}
|
||||
{% block content %}
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
{% csrf_token %}
|
||||
<div class="col">
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
{{ form|crispy }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||
<h2>Licenses</h2>
|
||||
<table class="table table-bordered">
|
||||
{% for license in license_list %}
|
||||
<tr>
|
||||
<td>{{ license.license.software }}</td>
|
||||
<td><code>{{ license.license.key }}</code></td>
|
||||
<td><a href="{% url 'license_with_computer_delete' license.pk %}" class="delete" title="Delete" data-toggle="tooltip"><i class="material-icons">delete</i></a></tr>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<p><a href="{% url 'license_with_computer_create' pk %}" class="add" title="Add" data-toggle="tooltip"><i class="material-icons">add</i></a></p>
|
|
@ -1,16 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}Delete License{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>Are you sure you want unasign the license "{{ object }}"?</p>
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
<a href="{% url 'licenses' object.customer.pk %}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,11 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% block section_title %}Licenses{% endblock %}
|
||||
{% block content %}
|
||||
<h3>User Licenses</h3>
|
||||
{% render_table user_licenses %}
|
||||
<h3>Computer Licenses</h3>
|
||||
<div class="table-responsive">
|
||||
{% render_table computer_licenses %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,16 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}Delete License Relation{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>Are you sure you want unasign the license "{{ object.license }}" from "{{ object.computer }}"?</p>
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
<a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,14 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block section_title %}Add License{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" value="Save" class="btn btn-primary">
|
||||
<a href="{% url 'computer' view.kwargs.pk %}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,16 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}Delete net{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>Are you sure you want to delete the net "{{ object }}"?</p>
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
<a href="{% url 'nets' object.customer.pk %}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,9 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% block section_title %}{{ net.name }}{% endblock %}
|
||||
{% block content %}
|
||||
{% if net.description %}
|
||||
<p>{{ net.description }}</p>
|
||||
{% endif %}
|
||||
{% render_table table %}
|
||||
{% endblock %}
|
|
@ -1,8 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% block section_title %}List of Nets{% endblock %}
|
||||
{% block content %}
|
||||
<div class="table-responsive">
|
||||
{% render_table nets %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,16 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}Delete user{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<form method="post">{% csrf_token %}
|
||||
<p>Are you sure you want to delete the user "{{ object }}"?</p>
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
<a href="{% url 'users' object.customer.pk %}" class="btn btn-primary">Cancel</a>
|
||||
<input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
|
||||
</form>
|
||||
<script>
|
||||
prev = document.getElementById("previous_page");
|
||||
prev.value = document.referrer;
|
||||
</script>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,122 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% block section_title %}{{ user }}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
<h4>Description</h4>
|
||||
<div class="card-text"><p>{{ user.description }}</p></div>
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>Customer</b></td>
|
||||
<td><a href="{% url 'customer' user.customer.id %}">{{ user.customer }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>AD Login</b></td>
|
||||
<td>{{ user.ad_login }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>AD Password</b></td>
|
||||
<td>{{ user.ad_pw }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Email Address</b></td>
|
||||
<td>{{ user.ad_login }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Mail Password</b></td>
|
||||
<td>{{ user.mail_pw }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>User is activ</b></td>
|
||||
<td>{{ user.enabled }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Comptuers</b></td>
|
||||
<td>
|
||||
{% for computer in computers %}
|
||||
<a href="{% url 'computer' computer.id %}">{{ computer}}</a>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if ad_groups or mail_groups or mail_alias %}
|
||||
<div class="col">
|
||||
{% if mail_alias %}
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">Mail Alias</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-bordered">
|
||||
{% for alias in mail_alias %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ alias }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if ad_groups %}
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">AD Groups</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-bordered">
|
||||
{% for group in ad_groups %}
|
||||
<tr>
|
||||
<td>{{ group.group }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if mail_groups %}
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">Mail Groups</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>Group Name</th>
|
||||
<th>Address</th>
|
||||
</tr>
|
||||
{% for group in mail_groups %}
|
||||
<tr>
|
||||
<td>{{ group.group }}</td>
|
||||
<td>{{ group.group.mail_address }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if licenses %}
|
||||
<div class="col">
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">Licenses</div>
|
||||
<div class="card-body">
|
||||
<table class="ui celled table">
|
||||
{% for license in licenses %}
|
||||
<tr>
|
||||
<td>{{ license.license.software }}</td>
|
||||
<td><code>{{ license.license.key }}</code></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,8 +0,0 @@
|
|||
{% extends "core/base.html" %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% block section_title %}Users{% endblock %}
|
||||
{% block content %}
|
||||
<div class="table-responsive">
|
||||
{% render_table users %}
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue