small change to /admin/app

remotes/1693176582716663532/tmp_refs/heads/watchparty
Aevann1 2022-10-28 22:13:58 +02:00
parent 062e2523b5
commit f41b09cc07
4 changed files with 21 additions and 7 deletions

View File

@ -33,7 +33,7 @@ class OauthApp(Base):
@property
@lazy
def permalink(self):
return f"{SITE_FULL}/admin/app/{self.id}"
return f"{SITE_FULL}/admin/app/{self.id}/posts"
@lazy
def idlist(self, page=1):

View File

@ -226,9 +226,9 @@ def admin_app_reject(v, aid):
return {"message": f"'{app.app_name}' rejected!"}
@app.get("/admin/app/<aid>")
@app.get("/admin/app/<aid>/posts")
@admin_level_required(PERMS['APPS_MODERATION'])
def admin_app_id(v, aid):
def admin_app_id_posts(v, aid):
aid=aid
oauth = g.db.get(OauthApp, aid)
if not oauth: abort(404)

View File

@ -47,6 +47,19 @@
</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 %}

View File

@ -13,10 +13,11 @@
{% for app in apps %}
<div class="settings-section rounded">
<div class="d-lg-flex">
<div class="title w-lg-25">
<label for="over18"><a href="{{app.permalink}}" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>{{app.app_name}}</a></label>
</div>
<div class="body w-lg-100">
<div class="title w-lg-25">
<label for="over18"><a href="{{app.permalink}}" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>{{app.app_name}}</a></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>