MarseyWorld/files/templates/admin/app.html

86 lines
3.4 KiB
HTML

{% extends "default.html" %}
{% block title %}
<title>API App Administration</title>
{% endblock %}
{% block content %}
<div class="row">
<div class="col col-lg-8">
<div class="settings">
<div class="settings-section rounded">
<div class="d-lg-flex">
<div class="title w-lg-25">
<label for="over18">{{app.app_name}}</label>
</div>
<div class="body w-lg-100">
<label for="edit-{{app.id}}-author" class="mb-0 w-lg-25">User</label>
<input autocomplete="off" id="edit-{{app.id}}-author" class="form-control" type="text" name="name" value="{{app.author.username}}" readonly=readonly>
<input type="hidden" name="formkey" value="{{v.formkey}}">
<label for="edit-{{app.id}}-name" class="mb-0 w-lg-25">App Name</label>
<input autocomplete="off" id="edit-{{app.id}}-name" class="form-control" type="text" name="name" value="{{app.app_name}}" readonly=readonly>
<label for="edit-{{app.id}}-redirect" class="mb-0 w-lg-25">Redirect URI</label>
<input autocomplete="off" id="edit-{{app.id}}-redirect" class="form-control" type="text" name="redirect_uri" value="{{app.redirect_uri}}" readonly="readonly">
<label for="edit-{{app.id}}-desc" class="mb-0 w-lg-25">Description</label>
<textarea rows="10" autocomplete="off" form="edit-app-{{app.id}}" class="form-control" name="description" id="edit-{{app.id}}-desc" maxlength="256" readonly="readonly">{{app.description}}</textarea>
</div>
</div>
<div class="footer">
<div class="d-flex">
{% if not app.client_id%}
<button type="button" class="btn btn-primary ml-auto mr-2" onclick="postToast(this,'/admin/app/approve/{{app.id}}',true)">Approve</button>
<button type="button" class="btn btn-secondary mr-0" onclick="postToast(this,'/admin/app/reject/{{app.id}}',true)">Reject</button>
{% else %}
<button type="button" class="btn btn-primary ml-auto" onclick="postToast(this,'/admin/app/revoke/{{app.id}}'),true">Revoke</button>
{% endif %}
</div>
</div>
</div>
</div>
<ul class="nav post-nav py-2">
<li class="nav-item">
<a class="nav-link {% if request.path.endswith('/posts') %} active{% endif %}" href="{{request.path.replace('/posts','/comments')}}">
<div>Posts</div>
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.path.endswith('/comments') %} active{% endif %}" href="{{request.path.replace('/posts','/comments')}}">
<div>Comments</div>
</a>
</li>
</ul>
{% if listing %}
{% include "submission_listing.html" %}
{% elif comments %}
{% include "comments.html" %}
{% endif %}
</div>
</div>
<div class="toast" id="toast-post-success" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px; z-index: 1000" role="alert" aria-live="assertive" aria-atomic="true" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body bg-success text-center text-white">
<i class="fas fa-comment-alt-smile mr-2"></i><span id="toast-post-success-text">Action successful!</span>
</div>
</div>
<div class="toast" id="toast-post-error" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px; z-index: 1000" role="alert" aria-live="assertive" aria-atomic="true" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body bg-danger text-center text-white">
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please try again later.</span>
</div>
</div>
{% endblock %}