Move inventory to new repo
This commit is contained in:
106
inventory-app/templates/base.html
Normal file
106
inventory-app/templates/base.html
Normal file
@@ -0,0 +1,106 @@
|
||||
<html>
|
||||
<head>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <!-- ompiled and minified CSS -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
|
||||
<style>
|
||||
{% if devenv %}
|
||||
body {
|
||||
background-color: lightgreen;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
.table-header-rotated {
|
||||
border-collapse: collapse;
|
||||
.csstransforms & td {
|
||||
width: 30px;
|
||||
}
|
||||
.no-csstransforms & th {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
td {
|
||||
text-align: center;
|
||||
padding: 10px 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
.csstransforms & th.rotate {
|
||||
height: 140px;
|
||||
white-space: nowrap;
|
||||
// Firefox needs the extra DIV for some reason, otherwise the text disappears if you rotate
|
||||
> div {
|
||||
transform:
|
||||
// Magic Numbers
|
||||
translate(25px, 51px)
|
||||
// 45 is really 360-45
|
||||
rotate(315deg);
|
||||
width: 30px;
|
||||
}
|
||||
> div > span {
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
}
|
||||
th.row-header {
|
||||
padding: 0 10px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.auto-height * {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.placeholder-dark *::placeholder {
|
||||
color: rgb(66, 73, 73);
|
||||
}
|
||||
|
||||
.line-clamp {
|
||||
display: -webkit-box !important;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<script
|
||||
src="https://code.jquery.com/jquery-3.5.1.min.js"
|
||||
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="//timeago.yarp.com/jquery.timeago.js" type="text/javascript"></script>
|
||||
<nav>
|
||||
<div class="nav-wrapper">
|
||||
<a href="#" data-target="mobile-demo" class="sidenav-trigger"><i class="material-icons">menu</i></a>
|
||||
<ul id="nav-mobile" class="left hide-on-med-and-down">
|
||||
{% include "menu.html" %}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<ul class="sidenav" id="mobile-demo">
|
||||
{% include "menu.html" %}
|
||||
</ul>
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
$("time.timeago").timeago();
|
||||
var elems = document.querySelectorAll('.tooltipped');
|
||||
var instances = M.Tooltip.init(elems, {});
|
||||
|
||||
var elems = document.querySelectorAll('.sidenav');
|
||||
var instances = M.Sidenav.init(elems, {});
|
||||
|
||||
var elems = document.querySelectorAll('select');
|
||||
var instances = M.FormSelect.init(elems, {});
|
||||
|
||||
var elems = document.querySelectorAll('.materialboxed');
|
||||
var instances = M.Materialbox.init(elems, {});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
38
inventory-app/templates/inventory.html
Normal file
38
inventory-app/templates/inventory.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
{% include "inventory_filter.html" %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Slug</th>
|
||||
<th>Public</th>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Owner</th>
|
||||
<th>User</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
<tr>
|
||||
<td>
|
||||
{% if item.shortener %}
|
||||
<a href="http://k6.ee/{{ item.shortener.slug }}">{{ item.shortener.slug }}</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{% if item.inventory.public %}<i class="material-icons">check_circle</i>{% else %} {% endif %}</td>
|
||||
<td><a href="/m/inventory/{{ item._id }}/view">{{ item | format_name }} {{ item.comment }}</a></td>
|
||||
<td>{{ item.type }}</td>
|
||||
<td>{{ item | owner_link}}</td>
|
||||
<td>{{ item | user_link}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
<a class="waves-effect waves-light btn" href="/m/inventory/add">Add item</a>
|
||||
</p>
|
||||
</div>
|
||||
{% endblock %}
|
23
inventory-app/templates/inventory_add_slug.html
Normal file
23
inventory-app/templates/inventory_add_slug.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
|
||||
<h3>New slug: {{ slug }}</h3>
|
||||
<p>
|
||||
You are adding a new slug to the collection.
|
||||
It can be assigned to an existing item or a new item can be created.
|
||||
</p>
|
||||
<h3>Actions</h3>
|
||||
<div class="row">
|
||||
<a href="/m/inventory/add-by-slug/{{ slug }}" class="waves-effect waves-light btn">Add new item</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<a href="/m/inventory/assign-slug/{{ slug }}" class="waves-effect waves-light btn">Assign to existing item</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<a href="/m/inventory/clone-with-slug/{{ slug }}" class="waves-effect waves-light btn">Clone existing item</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
192
inventory-app/templates/inventory_edit.html
Normal file
192
inventory-app/templates/inventory_edit.html
Normal file
@@ -0,0 +1,192 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<form method="POST" autocomplete="off">
|
||||
{{ form.csrf_token }}
|
||||
<p>Inventory item.</p>
|
||||
|
||||
<div id="errors" style="background-color: red;">
|
||||
{% for field, errors in form.errors.items() %}
|
||||
<div>
|
||||
{{ form[field].label.text }} :
|
||||
{% if errors.items %}
|
||||
{% for error, msg in errors.items() %}
|
||||
{{ form[field][error].label.text }} :
|
||||
{{ ", ".join(msg) }}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{{ ", ".join(errors) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if custom_errors %}
|
||||
{% for field, error in custom_errors.items() %}
|
||||
<div>{{ field }} : {{ error }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Key</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td>Type</td>
|
||||
<td>{{ form["type"] }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Vendor</td>
|
||||
<td>{{ form.hardware.vendor }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Product</td>
|
||||
<td>{{ form.hardware.product }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Serial number</td>
|
||||
<td>{{ form.hardware.serial }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>{{ form.name }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Comment</td>
|
||||
<td>{{ form.comment }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Owner</td>
|
||||
<td>{{ form.inventory.owner.foreign_id }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Current user</td>
|
||||
<td>{{ form.inventory.user.foreign_id }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Issue Tracker</td>
|
||||
<td>{{ form.issue_tracker }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>URL slug</td>
|
||||
<td>{{ form.shortener.slug }}</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<label>
|
||||
{{ form.inventory.usable }}
|
||||
<span>Usable, if available other members can make use of this inventory item</span>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label>
|
||||
{{ form.inventory.public }}
|
||||
<span>Public, show this inventory item for unauthenticated users</span>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<h5>Tags</h5>
|
||||
<div class="placeholder-dark chips">
|
||||
<input style="width: auto !important;">
|
||||
</div>
|
||||
<h5>Description</h5>
|
||||
<p class="auto-height placeholder-dark">
|
||||
{{ form.description(rows='15',cols='100') }}
|
||||
</p>
|
||||
|
||||
<button class="btn waves-effect waves-light" type="submit" name="action">Submit
|
||||
<i class="material-icons right">send</i>
|
||||
</button>
|
||||
{% for tag in item_tags %}
|
||||
<input class="tag" type="hidden" name="tags[]" value="{{ tag }}">
|
||||
{% endfor %}
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
$("input#hardware-vendor, input#hardware-product, input#hardware-serial").keyup(function(){
|
||||
updateName();
|
||||
});
|
||||
|
||||
function updateName() {
|
||||
var names = [$("input#hardware-vendor").val(), $("input#hardware-product").val(), $("input#hardware-serial").val()];
|
||||
$("input#name").val(names.filter(x => x).join(" "));
|
||||
}
|
||||
{% if not has_errors %}
|
||||
{% if slug %}
|
||||
location.href="#shortener-slug";
|
||||
$("input#shortener-slug").focus();
|
||||
{% endif %}
|
||||
{% if clone_item_id %}
|
||||
updateName();
|
||||
{% endif %}
|
||||
{% else %}
|
||||
location.href="#errors";
|
||||
{% endif %}
|
||||
setupTags();
|
||||
|
||||
$(document).click(function() {
|
||||
$('li[id^="select-options"]').on('touchend', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
|
||||
function setupTags() {
|
||||
$('.chips').chips({
|
||||
placeholder: 'Enter a tag',
|
||||
secondaryPlaceholder: '+Tag',
|
||||
data: [
|
||||
{% for tag in item_tags %}
|
||||
{ tag: '{{ tag }}', },
|
||||
{% endfor %}
|
||||
],
|
||||
autocompleteOptions: {
|
||||
data: {
|
||||
{% for tag in all_tags %}
|
||||
'{{ tag }}': null,
|
||||
{% endfor %}
|
||||
},
|
||||
limit: Infinity,
|
||||
minLength: 0
|
||||
},
|
||||
onChipAdd: updateTags,
|
||||
onChipDelete: updateTags,
|
||||
});
|
||||
}
|
||||
|
||||
function updateTags(e) {
|
||||
var form = $('form');
|
||||
var instance = M.Chips.getInstance($('.chips'));
|
||||
var tags = instance.chipsData;
|
||||
form.find('input.tag').remove();
|
||||
for (var i = 0; i < tags.length; i++) {
|
||||
var tag = tags[i]["tag"];
|
||||
$('<input>', {
|
||||
'type': 'hidden',
|
||||
'name': 'tags[]',
|
||||
'class': 'tag',
|
||||
'value': tag
|
||||
}).appendTo(form);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
91
inventory-app/templates/inventory_filter.html
Normal file
91
inventory-app/templates/inventory_filter.html
Normal file
@@ -0,0 +1,91 @@
|
||||
<form id="filter-form" method="get" action="?">
|
||||
<div class="row">
|
||||
{% for key, title, values, selected in selectors %}
|
||||
{% if selected | is_list %}
|
||||
<div class="input-field col s12 m2">
|
||||
<select name="{{ key }}" multiple>
|
||||
{% for value in values %}
|
||||
<option value="{{ value }}" {% if value in selected %}selected{% endif %}>
|
||||
{{ value }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<label>{{ title }}</label>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="input-field col s12 m2">
|
||||
<select name="{{ key }}">
|
||||
<option value="" disabled {% if not selected %}selected{% endif %}>All</option>
|
||||
{% for value in values %}
|
||||
{% if value is mapping %}
|
||||
<option value="{{ value.foreign_id }}" {% if value.foreign_id == selected %}selected{% endif %}>
|
||||
{{ value.display_name }}
|
||||
</option>
|
||||
{% else %}
|
||||
<option value="{{ value }}" {% if value == selected %}selected{% endif %}>
|
||||
{{ value }}
|
||||
</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<label>{{ title }}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<div class="input-field col s12 m3">
|
||||
<select name="sort_field">
|
||||
{% for key, value in sort_fields.items() %}
|
||||
<option value="{{ key }}" {% if key == sort_field %}selected{% endif %}>{{ value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<label>Sort field</label>
|
||||
</div>
|
||||
<div class="input-field col s12 m3">
|
||||
<select name="sort_direction">
|
||||
<option value="desc" {% if sort_direction == "desc" %}selected{% endif %}>Descending</option>
|
||||
<option value="asc" {% if sort_direction == "asc" %}selected{% endif %}>Ascending</option>
|
||||
</select>
|
||||
<label>Sort direction</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
{% if not pick %}
|
||||
<div class="input-field col s12 m2">
|
||||
<label>
|
||||
<input type="checkbox" value="true"
|
||||
name="grid" {% if grid %} checked="checked" {% endif %}/>
|
||||
<span>Grid view</span>
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if not public_view %}
|
||||
<div class="input-field col s12 m2">
|
||||
<label>
|
||||
<input type="checkbox" value="true"
|
||||
name="owner_disabled" {% if owner_disabled %} checked="checked" {% endif %}/>
|
||||
<span>Owner disabled</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field col s12 m2">
|
||||
<label>
|
||||
<input type="checkbox" value="true"
|
||||
name="user_disabled" {% if user_disabled %} checked="checked" {% endif %}/>
|
||||
<span>User disabled</span>
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="input-field col s12 m2" name="item_type">
|
||||
<button type="submit">Apply</button>
|
||||
<button type="reset">Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#filter-form button[type='reset']").click(function() {
|
||||
$("#filter-form option").removeAttr("selected");
|
||||
$("#filter-form option[value='']").attr("selected", true);
|
||||
$("#filter-form input[type='checkbox']").attr("checked", false);
|
||||
});
|
||||
});
|
||||
</script>
|
31
inventory-app/templates/inventory_grid.html
Normal file
31
inventory-app/templates/inventory_grid.html
Normal file
@@ -0,0 +1,31 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
{% include "inventory_filter.html" %}
|
||||
<div class="row">
|
||||
{% for item in items %}
|
||||
<div class="col s4">
|
||||
<div class="card medium">
|
||||
<div class="card-image">
|
||||
<img src="{% if item.has_photo %}/m/photo/{{ item._id }}/576{% else %}/static/No_image_available.svg{% endif %}" alt="no photo" loading="lazy">
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<span class="line-clamp card-title activator grey-text text-darken-4">{{ item.name }}</span>
|
||||
{% if public_view %}
|
||||
{% if item.inventory.user %}<p>In use</p>{% endif %}
|
||||
{% else %}
|
||||
<p>Owner: {% if item.inventory.owner %}{{item.inventory.owner.display_name}}{% endif %}</p>
|
||||
<p>Current user: {% if item.inventory.user %}{{item.inventory.user.display_name}}{% endif %}</p>
|
||||
{% endif %}
|
||||
<p><a href="/m/inventory/{{ item._id }}/view">more</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<p>
|
||||
<a class="waves-effect waves-light btn" href="/m/inventory/add">Add item</a>
|
||||
</p>
|
||||
</div>
|
||||
{% endblock %}
|
31
inventory-app/templates/inventory_pick.html
Normal file
31
inventory-app/templates/inventory_pick.html
Normal file
@@ -0,0 +1,31 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h4>{{ action_help }}: {{ slug }}</h4>
|
||||
{% include "inventory_filter.html" %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Owner</th>
|
||||
<th>User</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
<tr>
|
||||
<td>{{ item | format_name }} {{ item.comment }}</td>
|
||||
<td>{% if item.inventory.owner %}<a href="/m/user/{{ item.inventory.owner.foreign_id }}">{{ item.inventory.owner.display_name }}</a>{% endif %}</td>
|
||||
<td>{% if item.inventory.user %}<a href="/m/user/{{ item.inventory.user.foreign_id }}">{{ item.inventory.user.display_name }}</a>{% endif %}</td>
|
||||
<td>
|
||||
<form action="/m/inventory/{{item._id}}/{{action_path}}/{{slug}}" method="get">
|
||||
<button class="waves-effect waves-light btn" type="submit">{{action_label}}</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
32
inventory-app/templates/inventory_public.html
Normal file
32
inventory-app/templates/inventory_public.html
Normal file
@@ -0,0 +1,32 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h6>Please log in to see more details</h6>
|
||||
{% include "inventory_filter.html" %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Slug</th>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>In use</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
<tr>
|
||||
<td>
|
||||
{% if item.shortener %}
|
||||
<a href="http://k6.ee/{{ item.shortener.slug }}">{{ item.shortener.slug }}</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><a href="/m/inventory/{{ item._id }}/view">{{ item | format_name }} {{ item.comment }}</a></td>
|
||||
<td>{{ item.type }}</td>
|
||||
<td>{% if item.inventory.user %}<i class="material-icons">check_circle</i>{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
169
inventory-app/templates/inventory_view.html
Normal file
169
inventory-app/templates/inventory_view.html
Normal file
@@ -0,0 +1,169 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<p>Inventory item.</p>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Key</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td>Type</td>
|
||||
<td>{{ item["type"] }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Vendor</td>
|
||||
<td>{{ item.get("hardware").vendor }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Product</td>
|
||||
<td>{{ item.get("hardware").product }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Serial number</td>
|
||||
<td>{{ item.get("hardware").serial }}</td>
|
||||
</tr>
|
||||
|
||||
{% if item.mac %}
|
||||
<tr>
|
||||
<td>MAC address</td>
|
||||
<td>
|
||||
<span class="tooltipped" data-tooltip="Show in machines view">
|
||||
<a href="/m/machine?mac={{ item.mac | quote_plus }}">
|
||||
{{ item.mac }}
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>{{ item.name }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Comment</td>
|
||||
<td>{{ item.comment }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Owner</td>
|
||||
<td>{{ item.inventory.get("owner").display_name }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Current user</td>
|
||||
<td>{{ item.inventory.get("user").display_name }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>URL slug</td>
|
||||
<td>
|
||||
{% if item.get("shortener").slug %}
|
||||
<a href="http://k6.ee/{{ item.get("shortener").slug }}">
|
||||
k6.ee/{{ item.get("shortener").slug }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Issue tracker</td>
|
||||
<td><a href="{{ item.issue_tracker }}">Issue tracker</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="tooltip" data-tooltip="Unauthenticated user can see this in public list">Public</td>
|
||||
<td>{% if item.inventory.public %}<i class="material-icons">check_circle</i>{% endif %}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="tooltip" data-tooltip="Other members can make use of this inventory item">Usable</td>
|
||||
<td>{% if item.inventory.usable %}<i class="material-icons">check_circle</i>{% endif %}</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Tags</h3>
|
||||
{% for tag in item.tags %}
|
||||
<div class="chip"> {{ tag }} </div>
|
||||
{% endfor %}
|
||||
<h3>Description</h3>
|
||||
<p class="auto-height">
|
||||
{{ item.description | markdown }}
|
||||
</p>
|
||||
|
||||
<h3>Photo</h3>
|
||||
{% if item.has_photo %}
|
||||
<img src="{{ photo_url }}" alt="" style="max-width: 800px; width: 100%;">
|
||||
{% endif %}
|
||||
<form id="photo-form" action="/inventory/{{ item._id }}/upload-photo" method="post" enctype="multipart/form-data">
|
||||
<div class="row placeholder-dark">
|
||||
<div class="file-field input-field col s6">
|
||||
<div class="btn">
|
||||
<span>Select</span>
|
||||
<input type="file" name="file" accept="image/jpeg" />
|
||||
</div>
|
||||
|
||||
<div class="file-path-wrapper">
|
||||
<input class="file-path validate" type="text" placeholder="Upload file" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="file-field input-field col s6">
|
||||
<button class="btn waves-effect waves-light" type="submit" name="action">Upload
|
||||
<i class="material-icons right">add_a_photo</i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<h3>Actions</h3>
|
||||
{% if not item.inventory.user and item.inventory.usable %}
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<form action="/m/inventory/{{ item._id }}/use" method="post" style="display: inline;">
|
||||
<button class="waves-effect waves-light btn" type="submit">Use</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<a href="/m/inventory/{{ item._id }}/edit" class="waves-effect waves-light btn">Edit</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<a href="/m/inventory/{{ item._id }}/clone" class="waves-effect waves-light btn">Clone</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
var photoInput = $("#photo-form input[type=file]");
|
||||
photoInput.change(function () {
|
||||
var fileName = $.trim($(this).val());
|
||||
var button = $("#photo-form button[type=submit]");
|
||||
if (fileName === "") {
|
||||
button.prop("disabled", true);
|
||||
} else {
|
||||
button.prop("disabled", false);
|
||||
}
|
||||
});
|
||||
photoInput.change();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
65
inventory-app/templates/inventory_view_public.html
Normal file
65
inventory-app/templates/inventory_view_public.html
Normal file
@@ -0,0 +1,65 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<p>Inventory item.</p>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Key</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td>Type</td>
|
||||
<td>{{ item["type"] }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Vendor</td>
|
||||
<td>{{ item.get("hardware").vendor }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Product</td>
|
||||
<td>{{ item.get("hardware").product }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>{{ item.name }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>URL slug</td>
|
||||
<td>
|
||||
{% if item.get("shortener").slug %}
|
||||
<a href="http://k6.ee/{{ item.get("shortener").slug }}">
|
||||
k6.ee/{{ item.get("shortener").slug }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="tooltip" data-tooltip="Unauthenticated user can see this in public list">In use</td>
|
||||
<td>{% if item.inventory.user %}<i class="material-icons">check_circle</i>{% endif %}</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Description</h3>
|
||||
<p class="auto-height">
|
||||
{{ item.description | markdown }}
|
||||
</p>
|
||||
|
||||
<h3>Photo</h3>
|
||||
{% if item.has_photo %}
|
||||
<img src="{{ photo_url }}" alt="" style="max-width: 800px; width: 100%;">
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
30
inventory-app/templates/login.html
Normal file
30
inventory-app/templates/login.html
Normal file
@@ -0,0 +1,30 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col s6">
|
||||
{% if not devenv %}
|
||||
<p>If you have active AD account click <a href="/login/authelia">here</a> to login</p>
|
||||
{% else %}
|
||||
<p>Click <a href="/dev_login">here</a> to login as dev user</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col s6">
|
||||
<p>Request a login link to your email address</p>
|
||||
<form action="/login/address" method="post">
|
||||
{{ form.csrf_token }}
|
||||
<p>{{ form.email.label }}</p>
|
||||
<p>{{ form.email }}</p>
|
||||
<p>{{ form.recaptcha }}</p>
|
||||
<button class="waves-effect waves-light btn" type="submit">Request login link</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
12
inventory-app/templates/login_error.html
Normal file
12
inventory-app/templates/login_error.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<p>
|
||||
Your membership is not active or is suspended, please reach out to <a href="mailto:info@k-space.ee">info@k-space.ee</a> for more info
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
10
inventory-app/templates/login_link_request.html
Normal file
10
inventory-app/templates/login_link_request.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
|
||||
<p>If the address is known a login link should have been sent.</p>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
15
inventory-app/templates/menu.html
Normal file
15
inventory-app/templates/menu.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<li><a href="{{ members_host }}/">Public</a></li>
|
||||
<li><a href="{{ members_host }}/m/profile">Me</a></li>
|
||||
<li><a href="{{ members_host }}/m/phonebook">Phonebook</a></li>
|
||||
{% if user and user.access.board %}
|
||||
<li><a href="{{ members_host }}/m/packages">Packages</a></li>
|
||||
<li><a href="{{ members_host }}/m/transactions">Transactions</a></li>
|
||||
<li><a href="{{ members_host }}/m/debtors">Debtors</a></li>
|
||||
{% endif %}
|
||||
<li><a href="{{ members_host }}/m/cashflow">Cashflow</a></li>
|
||||
<li><a href="{{ members_host }}/m/lockers">Lockers</a></li>
|
||||
<li><a href="{{ members_host }}/m/desks">Desks</a></li>
|
||||
<li><a href="{{ members_host }}/m/doorboy">Doorboy™</a></li>
|
||||
<li><a href="{{ members_host }}/m/machine?vlan_number=1">Machines</a></li>
|
||||
<li><a href="/m/inventory?type=machine&type=locker&type=desk">Inventory</a></li>
|
||||
<li><a href="{{ members_host }}/m/cameras">Cams</a></li>
|
11
inventory-app/templates/notice.html
Normal file
11
inventory-app/templates/notice.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<p>Please request one of current members to send you the login link</p>
|
||||
|
||||
<p>We stopped using AD user login on this site to faciliate login for users who don't (want to) have AD account</p>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
42
inventory-app/templates/privacy.html
Normal file
42
inventory-app/templates/privacy.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<p>Contact information for our membership, be gentle!</p>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th class="tooltipped" data-tooltip="This mail alias is shown in Gogs, Nextcloud etc services in order to not expose users personal e-mail address. Mails are forwarded to personal address. This is UPN or 'userPrincipalName' in AD, if alias is shown disabled check that it uses correct UPN suffix @k-space.ee and personal mail attribute is set to enable forwarding">Mail alias</th>
|
||||
<th class="tooltipped" data-tooltip="This is AD 'Pager' field">Personal email</th>
|
||||
<th class="tooltipped" data-tooltip="This is AD 'Telephone number' field. For reaching member out of band">Phone</th>
|
||||
<th class="tooltipped" data-tooltip="This is AD 'Homepage' field">Homepage</th>
|
||||
|
||||
<th class="tooltipped" data-tooltip="This person receives copies of e-mails sent to info@k-space.ee mail alias. Inferred from membership of 'Info' AD group.">Info</th>
|
||||
<th class="tooltipped" data-tooltip="This person can add users in AD domain and reset user passwords. Inferred from membership of 'Onboarding' group.">Onboarding</th>
|
||||
<!-- <th class="tooltipped" data-tooltip="This person can reissue VPN access at ca5.certidude.rocks site. Inferred from membership of 'VPN Admins' AD group.">VPN admin</th>
|
||||
<th class="tooltipped" data-tooltip="This person can administer AD domain and help out in corner cases. Inferred from membership of 'Domain Admins' AD group.">AD admin</th> -->
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for p in members %}
|
||||
{% if p.type != "company" %}
|
||||
<tr style="{% if not p.enabled %}opacity:25%;{% endif %}">
|
||||
<td><a href="/m/user/{{ p.full_name }}">{{ p.full_name }}</a></td>
|
||||
<td><a href="mailto:{{ p.mail_alias }}">{{ p.mail_alias }}</a></td>
|
||||
<td><a href="mailto:{{ p.mail }}">{{ p.mail }}</a></td>
|
||||
<td>{% if p.phone %}<a href="tel:{{p.phone}}">{{ p.phone }}</a>{% else %}-{% endif %}</td>
|
||||
<td>{% if p.homepage %}<a href="http://{{ p.homepage }}">{{ p.homepage }}</a>{% else %}-{% endif %}</td>
|
||||
<td>{% if p.access and p.access.info %}<i class="material-icons">check_circle</i>{% else %} {% endif %}</td>
|
||||
<td>{% if p.access and p.access.onboarding %}<i class="material-icons">check_circle</i>{% else %} {% endif %}</td>
|
||||
<!-- <td>{% if p.access and p.access.vpn_admins %}<i class="material-icons">check_circle</i>{% else %} {% endif %}</td>
|
||||
<td>{% if p.access and p.access.domain_admins %}<i class="material-icons">check_circle</i>{% else %} {% endif %}</td> -->
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user