portal-oddajanje-solar/templates/solar-admin.html

145 lines
4.3 KiB
HTML
Raw Normal View History

2021-06-08 06:00:18 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Admin panel - Šolar</title>
<style>
.tableFixHead {
overflow-y: auto;
height: 306px;
2021-06-08 06:00:18 +00:00
}
.tableFixHead thead th {
position: sticky;
top: 0;
}
table {
border-collapse: collapse;
width: 100%;
}
th,
td {
padding: 8px 16px;
border: 1px solid #ccc;
}
th {
background: #eee;
}
</style>
</head>
<body>
{% with messages = get_flashed_messages() %}
{% if messages %}
<div style="background: blue;">
{{ messages[0] }}
</div>
{% endif %}
{% endwith %}
2021-06-08 06:00:18 +00:00
<h2>Uporabniki</h2>
<h3>Dodaj uporabnika</h3>
<form action="/solar/adduser" method="post">
<label for="name">Ime in priimek:</label><br>
<input type="text" id="name" name="name"><br>
<label for="email">Email:</label><br>
<input type="text" id="email" name="email"><br>
<label for="password">Geslo:</label><br>
<input type="password" id="password" name="password"><br>
2021-06-08 06:00:18 +00:00
<input type="submit" value="Dodaj">
</form>
<!--<h3>Odstrani uporabnika</h3>
<form action="/solar/deluser" method="post">
<label for="user_id">ID uporabnika:</label><br>
<input type="text" id="user_id" name="user_id"><br>
<input type="submit" value="Odstrani">
</form>-->
<h3>Seznam vseh aktivnih uporabnikov</h3>
<div class="tableFixHead">
<table>
<thead>
<tr>
<th>ID</th>
<th>Ime in priimek</th>
<th>Email</th>
<th>ID institucije</th>
2021-06-08 06:00:18 +00:00
</tr>
</thead>
<tbody>
{% for item in users %}
<tr>
<td>{{item[0].id}}</td>
<td>{{item[0].name}}</td>
<td>{{item[0].email}}</td>
<td>{{item[1].institution}}</td>
2021-06-08 06:00:18 +00:00
{% endfor %}
</table>
</div>
<h3>Dodeli uporabnika instituciji</h3>
<form action="/solar/addusertoinstitution" method="post">
<label for="user_id">ID uporabnika:</label>
<input type="text" id="user_id" name="user_id"><br>
<label for="institution_id">ID institucije:</label>
<input type="text" id="institution_id" name="institution_id"><br>
<label for="role">Vloga v instituciji:</label>
<select name="role" id="role">
<option value="moderator">Moderator</option>
<option value="user">Uporabnik</option>
</select>
<input type="submit" value="Dodeli">
</form>
<div> </div>
<h2>Institucije</h2>
<h3>Dodaj institucijo</h3>
<form action="/solar/addinstitution" method="post">
<label for="name">Naziv:</label>
<input type="text" id="name" name="name"><br>
<label for="region">Regija:</label>
<input type="text" id="region" name="region"><br>
<input type="submit" value="Dodaj">
</form>
<h3>Seznam vseh instituticij</h3>
<div class="tableFixHead">
<table>
<thead>
<tr>
<th>ID</th>
<th>Naziv</th>
<th>Regija</th>
</tr>
</thead>
<tbody>
{% for item in institutions %}
<tr>
<td>{{item.id}}</td>
<td>{{item.name}}</td>
<td>{{item.region}}</td>
</tr>
{% endfor %}
</table>
</div>
<h3>Seznam uporabnikov, ki niso aktivirani</h3>
<div class="tableFixHead">
<table>
<thead>
<tr>
<th>ID</th>
<th>Ime in priimek</th>
<th>Email</th>
</tr>
</thead>
<tbody>
{% for item in inactive_users %}
<tr>
<td>{{item.id}}</td>
<td>{{item.name}}</td>
<td>{{item.email}}</td>
</tr>
{% endfor %}
</table>
</div>
<h3>Aktiviraj uporabnika</h3>
<form action="/solar/activateuser" method="post">
<label for="id">ID uporabnika:</label>
<input type="text" id="id" name="id"><br>
<input type="submit" value="Aktiviraj">
</form>
2021-06-08 06:00:18 +00:00
</body>