portal: consolidate list templates
This commit is contained in:
parent
473152fe19
commit
a1aa252bc0
9 changed files with 90 additions and 75 deletions
|
@ -1,8 +0,0 @@
|
|||
{% extends "base.html.j2" %}
|
||||
{% from "tables.html.j2" import bridgeconfs_table %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="h2 mt-3">Tor Bridge Configurations</h1>
|
||||
<a href="{{ url_for("portal.new_bridgeconf") }}" class="btn btn-success">Create new configuration</a>
|
||||
{{ bridgeconfs_table(bridgeconfs) }}
|
||||
{% endblock %}
|
|
@ -1,7 +0,0 @@
|
|||
{% extends "base.html.j2" %}
|
||||
{% from "tables.html.j2" import bridges_table %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="h2 mt-3">Tor Bridges</h1>
|
||||
{{ bridges_table(bridges) }}
|
||||
{% endblock %}
|
|
@ -1,30 +0,0 @@
|
|||
{% extends "base.html.j2" %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="h2 mt-3">Groups</h1>
|
||||
<a href="{{ url_for("portal.new_group") }}" class="btn btn-success">Create new group</a>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Description</th>
|
||||
<th scope="col">EOTK</th>
|
||||
<th scope="col">Sites</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for group in groups %}
|
||||
<tr>
|
||||
<td>{{ group.group_name }}</td>
|
||||
<td>{{ group.description }}</td>
|
||||
<td>{% if group.eotk %}✅{% else %}❌{% endif %}</td>
|
||||
<td>{{ group.origins | length }}</td>
|
||||
<td><a href="{{ url_for("portal.edit_group", group_id=group.id) }}" class="btn btn-primary btn-sm">View/Edit</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
25
app/portal/templates/list.html.j2
Normal file
25
app/portal/templates/list.html.j2
Normal file
|
@ -0,0 +1,25 @@
|
|||
{% extends "base.html.j2" %}
|
||||
{% from "tables.html.j2" import bridgeconfs_table, bridges_table,
|
||||
groups_table, mirrorlists_table, origins_table, proxies_table %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="h2 mt-3">{{ title }}</h1>
|
||||
{% if new_link %}
|
||||
<a href="{{ new_link }}" class="btn btn-success">Create new {{ item }}</a>
|
||||
{% endif %}
|
||||
{% if item == "bridge configuration" %}
|
||||
{{ bridgeconfs_table(items) }}
|
||||
{% elif item == "bridge" %}
|
||||
{{ bridges_table(items) }}
|
||||
{% elif item == "eotk" %}
|
||||
{{ eotk_table(items) }}
|
||||
{% elif item == "group" %}
|
||||
{{ groups_table(items) }}
|
||||
{% elif item == "mirror list" %}
|
||||
{{ mirrorlists_table(items) }}
|
||||
{% elif item == "origin" %}
|
||||
{{ origins_table(items) }}
|
||||
{% elif item == "proxy" %}
|
||||
{{ proxies_table(items) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,8 +0,0 @@
|
|||
{% extends "base.html.j2" %}
|
||||
{% from "tables.html.j2" import mirrorlists_table %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="h2 mt-3">Mirror Lists</h1>
|
||||
<a href="{{ url_for("portal.new_mirror_list") }}" class="btn btn-success">Create new mirror list</a>
|
||||
{{ mirrorlists_table(mirrorlists) }}
|
||||
{% endblock %}
|
|
@ -1,8 +0,0 @@
|
|||
{% extends "base.html.j2" %}
|
||||
{% from "tables.html.j2" import origins_table %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="h2 mt-3">Origins</h1>
|
||||
<a href="{{ url_for("portal.new_origin") }}" class="btn btn-success">Create new origin</a>
|
||||
{{ origins_table(origins) }}
|
||||
{% endblock %}
|
|
@ -1,7 +0,0 @@
|
|||
{% extends "base.html.j2" %}
|
||||
{% from "tables.html.j2" import proxies_table %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="h2 mt-3">Proxies</h1>
|
||||
{{ proxies_table(proxies) }}
|
||||
{% endblock %}
|
|
@ -22,6 +22,37 @@
|
|||
</svg>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro eotk_table(eotks) %}
|
||||
<div class="alert alert-danger">Not implemented yet.</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro groups_table(groups) %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Description</th>
|
||||
<th scope="col">EOTK</th>
|
||||
<th scope="col">Sites</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for group in groups %}
|
||||
<tr>
|
||||
<td>{{ group.group_name }}</td>
|
||||
<td>{{ group.description }}</td>
|
||||
<td>{% if group.eotk %}✅{% else %}❌{% endif %}</td>
|
||||
<td>{{ group.origins | length }}</td>
|
||||
<td><a href="{{ url_for("portal.edit_group", group_id=group.id) }}" class="btn btn-primary btn-sm">View/Edit</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro origins_table(origins) %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue