diff --git a/files/routes/admin.py b/files/routes/admin.py index 63c56c64e..e1602661f 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -305,39 +305,6 @@ def monthly(v): return {"message": "Monthly coins granted"} -# @app.get('/admin/sidebar') -# @admin_level_required(3) -# def get_sidebar(v): - -# try: -# with open(f'files/templates/sidebar_{SITE_NAME}.html', 'r', encoding="utf-8") as f: sidebar = f.read() -# except: -# sidebar = None - -# return render_template('admin/sidebar.html', v=v, sidebar=sidebar) - - -# @app.post('/admin/sidebar') -# @limiter.limit("1/second;30/minute;200/hour;1000/day") -# @admin_level_required(3) -# def post_sidebar(v): - -# text = request.values.get('sidebar', '').strip() - -# with open(f'files/templates/sidebar_{SITE_NAME}.html', 'w+', encoding="utf-8") as f: f.write(text) - -# with open(f'files/templates/sidebar_{SITE_NAME}.html', 'r', encoding="utf-8") as f: sidebar = f.read() - -# ma = ModAction( -# kind="change_sidebar", -# user_id=v.id, -# ) -# g.db.add(ma) - -# g.db.commit() - -# return render_template('admin/sidebar.html', v=v, sidebar=sidebar, msg='Sidebar edited successfully!') - @app.get("/admin/shadowbanned") @auth_required def shadowbanned(v): diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index 2d0545775..345e0ef1f 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -52,11 +52,6 @@
  • Stat Chart
  • -

    Configuration

    - - {% if v.admin_level > 2 %}
    diff --git a/files/templates/admin/sidebar.html b/files/templates/admin/sidebar.html deleted file mode 100644 index ab5d6e1c4..000000000 --- a/files/templates/admin/sidebar.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends "default.html" %} - -{% block pagetitle %}Edit {{SITE_NAME}} sidebar{% endblock %} - -{% block content %} - -{% if msg %} - -{% endif %} - -
    -
    -
    -
    -

    Edit Sidebar

    -
    -
    -
    -
    -
    - - - -
    - -
    -
    -
    -
    -
    -
    -
    - -{% endblock %} \ No newline at end of file diff --git a/files/templates/api.html b/files/templates/api.html index cdcee8f4c..36a9201d3 100644 --- a/files/templates/api.html +++ b/files/templates/api.html @@ -14,17 +14,17 @@
    
     

    This page explains how to obtain and use an access token.

    Step 1: Create your Application

    -

    In the apps tab of Drama settings, fill in and submit the form to request an access token. You will need:

    +

    In the apps tab of {{SITE_NAME}} settings, fill in and submit the form to request an access token. You will need:

    Don't worry too much about accuracy; you will be able to change all of these later.

    -

    Drama administrators will review and approve or deny your request for an access token. You'll know when your request has been approved when you get a private message with an access token tied to your account.

    +

    {{SITE_NAME}} administrators will review and approve or deny your request for an access token. You'll know when your request has been approved when you get a private message with an access token tied to your account.

    DO NOT reveal your Client ID or Access Token. Anyone with these information will be able to pretend to be you. You are responsible for keeping them a secret!

    Step 2: Using the Access Token

    -

    To use the access token, include the following header in subsequent API requests to Drama: Authorization: access_token_goes_here

    +

    To use the access token, include the following header in subsequent API requests to {{SITE_NAME}}: Authorization: access_token_goes_here

    Python example:

    	import requests
     
    @@ -48,25 +48,25 @@
     

    API Guide for Applications

    
    -

    The OAuth2 authorization flow is used to enable users to authorize third-party applications to access their Drama account without having to provide their login information to the application.

    +

    The OAuth2 authorization flow is used to enable users to authorize third-party applications to access their {{SITE_NAME}} account without having to provide their login information to the application.

    This page explains how to obtain API application keys, how to prompt a user for authorization, and how to obtain and use access tokens.

    Step 1: Create your Application

    -

    In the apps tab of Drama settings, fill in and submit the form to request new API keys. You will need:

    +

    In the apps tab of {{SITE_NAME}} settings, fill in and submit the form to request new API keys. You will need:

    Don't worry too much about accuracy; you will be able to change all of these later.

    -

    Drama administrators will review and approve or deny your request for API keys. You'll know when your request has been approved when you get a private message with an access token tied to your account.

    +

    {{SITE_NAME}} administrators will review and approve or deny your request for API keys. You'll know when your request has been approved when you get a private message with an access token tied to your account.

    DO NOT reveal your Client ID or Access Token. Anyone with these information will be able to pretend to be you. You are responsible for keeping them a secret!

    Step 2: Prompt Your User for Authorization

    Send your user to {{SITE_FULL}}/authorize/?client_id=YOUR_CLIENT_ID

    -

    If done correctly, the user will see that your application wants to access their Drama account, and be prompted to approve or deny the request.

    +

    If done correctly, the user will see that your application wants to access their {{SITE_NAME}} account, and be prompted to approve or deny the request.

    Step 3: Catch the redirect

    -

    The user clicks "Authorize". Drama will redirect the user's browser to GET the designated redirect URI. The access token URL parameter will be included in the redirect, which your server should process.

    +

    The user clicks "Authorize". {{SITE_NAME}} will redirect the user's browser to GET the designated redirect URI. The access token URL parameter will be included in the redirect, which your server should process.

    Step 4: Using the Access Token

    -

    To use the access token, include the following header in subsequent API requests to Drama: Authorization: access_token_goes_here

    +

    To use the access token, include the following header in subsequent API requests to {{SITE_NAME}}: Authorization: access_token_goes_here

    Python example:

    	import requests
     
    diff --git a/files/templates/sidebar.html b/files/templates/sidebar.html
    index 175ce2351..6f7778686 100644
    --- a/files/templates/sidebar.html
    +++ b/files/templates/sidebar.html
    @@ -11,7 +11,7 @@
     
     
    -

    Sidebar{% if v and v.admin_level > 2 %} Edit sidebar{% endif %}

    +

    Sidebar