-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chg: [website] Reorganization and improvements to diffenret views tha…
…t are dedicated to administrators.
- Loading branch information
1 parent
cd7df5d
commit 27088c9
Showing
12 changed files
with
263 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% extends "main.html" %} | ||
{% block title %}Bundles management{% endblock %} | ||
{% block content %} | ||
<div class="container"> | ||
<h1>Recent bundles</h1> | ||
{% include "./admin/template_responsive_table_bundles.html" %} | ||
<div class="row"> | ||
<div class="col"> | ||
{{ pagination.links }} | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col"> | ||
{{ pagination.info }} | ||
</div> | ||
</div> | ||
<br /> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{% import 'admin/template_responsive_table_users.html' as users_templates with context %} | ||
{% extends "main.html" %} | ||
{% block head %} | ||
{{ super() }} | ||
<script src="{{ url_for('static', filename='js/pretty-print-json.min.js') }}"></script> | ||
<link rel="stylesheet" href="{{ url_for('static', filename='css/pretty-print-json.css') }}" /> | ||
{% endblock %} | ||
{% block title %}Dasboard{% endblock %} | ||
{% block content %} | ||
<h1>Dashboard</h1> | ||
<div class="row"> | ||
<div class="col"> | ||
<h2 id="key-figures">Key figures</h2> | ||
<ul class="list-group"> | ||
<li class="list-group-item">Number of <a href="{{ url_for('admin_bp.list_users') }}">users</a>: {{ nb_users }}</li> | ||
<li class="list-group-item">Number of <a href="{{ url_for('admin_bp.list_comments') }}">comments</a>: {{ nb_comments }}</li> | ||
<li class="list-group-item">Number of <a href="{{ url_for('bundles_bp.list_bundles') }}">bundles</a>: {{ nb_bundles }}</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<br /> | ||
<div class="row"> | ||
<div class="col"> | ||
<h2 id="instance-status">Instance status</h2> | ||
<ul class="list-group"> | ||
<li class="list-group-item">Two-Factor Authentication: <em>{% if config["ENFORCE_2FA"] %}Enforced{% else %}Not enforced{% endif %}</em></li> | ||
<li class="list-group-item">Self-registration: <em>{% if config["SELF_REGISTRATION"] %}Open{% else %}Closed{% endif %}</em></li> | ||
<li class="list-group-item">Comments moderation: <em>{% if config["COMMENTS_MODERATION"] %}On{% else %}Off{% endif %}</em></li> | ||
<li class="list-group-item">Instance UUID: <em>{{ local_instance_uuid }}</em></li> | ||
<li class="list-group-item">Instance name: <em>{{ local_instance_name }}</em></li> | ||
</ul> | ||
</div> | ||
</div> | ||
<br /> | ||
<div class="row"> | ||
<div class="col"> | ||
<h2 id="storage">Storage</h2> | ||
<button class="btn btn-primary" type="button" data-bs-toggle="collapse" data-bs-target="#collapseStorage" aria-expanded="false" aria-controls="collapseStorage">Show JSON</button> | ||
<div class="collapse" id="collapseStorage"> | ||
<br /> | ||
<div class="card card-body"> | ||
<pre id="json-container">{{storage_info|tojson(indent=2)}}</pre> | ||
</div> | ||
<br /> | ||
</div> | ||
</div> | ||
</div> | ||
<br /> | ||
<div class="row"> | ||
<div class="col"> | ||
<h2 id="active-users">Active users</h2> | ||
{{ users_templates.table_users(users=users) }} | ||
</div> | ||
</div> | ||
<br /> | ||
<script> | ||
document.addEventListener("DOMContentLoaded", function() { | ||
var jsonContainer = document.getElementById("json-container"); | ||
jsonContainer.innerHTML = prettyPrintJson.toHtml(JSON.parse(jsonContainer.innerText)); | ||
}); | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
website/web/templates/admin/template_responsive_table_bundles.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<div class="table-responsive-md"> | ||
<table id="table-comments" class="table table-hover"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Author</th> | ||
<th>Created at</th> | ||
<th>Updated at</th> | ||
<th>Action</th> | ||
|
||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for bundle in bundles %} | ||
<tr> | ||
<td>{{ bundle.name }}</td> | ||
<td><a href="{{ url_for('admin_bp.form_user', user_id=bundle.author.id) }}">{{ bundle.author.login }}</a></td> | ||
<td class="date">{{ bundle.creation_timestamp | datetimeformat }}</td> | ||
<td class="date">{{ bundle.timestamp | datetimeformat }}</td> | ||
<td> | ||
<a class="icon-link" href="{{ url_for('admin_bp.form_bundle', bundle_uuid=bundle.uuid) }}">{{ render_icon('pen', title='Edit the bundle') }}</a> | ||
<a class="icon-link" href="{{ url_for('admin_bp.delete_bundle', bundle_uuid=bundle.uuid) }}" onclick="return confirm('You are going to delete this bundle.');">{{ render_icon('trash') }}</a> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.