diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 436e533b7..f0576b5a2 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -5979,7 +5979,7 @@ g { .fa-volume:before{content:"\f6a8"} .fa-volume-mute:before{content:"\f6a9"} .fa-times:before{content:"\f00d"} -.fa-android:before{content:"\f17b"} +.fa-mobile:before{content:"\f3ce"} .fa-discord:before{content:"\f392"} .fa-github:before{content:"\f09b"} .fa-twitter:before{content:"\f099"} diff --git a/files/assets/images/app1.webp b/files/assets/images/app1.webp new file mode 100644 index 000000000..2f7750e76 Binary files /dev/null and b/files/assets/images/app1.webp differ diff --git a/files/assets/images/app2.webp b/files/assets/images/app2.webp new file mode 100644 index 000000000..6297dbc65 Binary files /dev/null and b/files/assets/images/app2.webp differ diff --git a/files/classes/user.py b/files/classes/user.py index acb2c42ce..7c7aa5d04 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -977,8 +977,6 @@ class User(Base): if user and user.id == other.author_id: return True if isinstance(other, Submission): if other.sub and not cls.can_see(user, other.subr): return False - if other.title.startswith('[android app]') and other.author_id == AEVANN_ID and not g.webview: - return False else: if not other.parent_submission: if not user: return False diff --git a/files/helpers/const.py b/files/helpers/const.py index 8bf9e3be4..c38d0e980 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -1560,7 +1560,6 @@ tiers={ has_sidebar = path.exists(f'files/templates/sidebar_{SITE_NAME}.html') has_logo = path.exists(f'files/assets/images/{SITE_NAME}/logo.webp') -has_app = path.exists(f'files/assets/app_{SITE_NAME}_v2.8.apk') ONLINE_STR = f'{SITE}_online' diff --git a/files/routes/allroutes.py b/files/routes/allroutes.py index fece39fc0..772fcd7ae 100644 --- a/files/routes/allroutes.py +++ b/files/routes/allroutes.py @@ -25,7 +25,6 @@ def before_request(): if not get_setting('Bots') and request.headers.get("Authorization"): abort(403) g.db = db_session() - g.webview = '; wv) ' in ua g.inferior_browser = 'iphone' in ua or 'ipad' in ua or 'ipod' in ua or 'mac os' in ua or ' firefox/' in ua g.is_tor = request.headers.get("cf-ipcountry") == "T1" diff --git a/files/routes/jinja2.py b/files/routes/jinja2.py index 16ee713bf..42a780ed1 100644 --- a/files/routes/jinja2.py +++ b/files/routes/jinja2.py @@ -50,7 +50,7 @@ def inject_constants(): "COLORS":COLORS, "time":time, "PERMS":PERMS, "FEATURES":FEATURES, "HOLE_NAME":HOLE_NAME, "HOLE_STYLE_FLAIR":HOLE_STYLE_FLAIR, "HOLE_REQUIRED":HOLE_REQUIRED, "GUMROAD_LINK":GUMROAD_LINK, "DEFAULT_THEME":DEFAULT_THEME, "DESCRIPTION":DESCRIPTION, - "has_sidebar":has_sidebar, "has_logo":has_logo, "has_app":has_app, + "has_sidebar":has_sidebar, "has_logo":has_logo, "FP":FP, "cache":cache, "ONLINE_STR":ONLINE_STR, "patron":patron, "DUES":DUES, "SIDEBAR_THREAD":SIDEBAR_THREAD, "BANNER_THREAD":BANNER_THREAD, "BADGE_THREAD":BADGE_THREAD, "SNAPPY_THREAD":SNAPPY_THREAD, diff --git a/files/routes/static.py b/files/routes/static.py index 65f34bd77..c3a5eb730 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -283,6 +283,8 @@ def image(path): @app.get('/static/assets/') @limiter.exempt def static_service(path): + if path.startswith(f'app_{SITE_NAME}_v'): + return redirect('/app') is_webp = path.endswith('.webp') return static_file('assets', path, is_webp or path.endswith('.gif') or path.endswith('.ttf') or path.endswith('.woff2'), is_webp) @@ -363,6 +365,11 @@ def banned(v): def formatting(v): return render_template("formatting.html", v=v) +@app.get("/app") +@auth_desired +def mobile_app(v): + return render_template("app.html", v=v) + @app.get("/service-worker.js") def serviceworker(): with open("files/assets/js/service-worker.js", "r", encoding="utf-8") as f: diff --git a/files/templates/admin/apps.html b/files/templates/admin/apps.html index 5e6d3bbed..51edd4322 100644 --- a/files/templates/admin/apps.html +++ b/files/templates/admin/apps.html @@ -14,7 +14,7 @@
diff --git a/files/templates/app.html b/files/templates/app.html new file mode 100644 index 000000000..885a65368 --- /dev/null +++ b/files/templates/app.html @@ -0,0 +1,18 @@ +{% extends "default.html" %} +{% block title %} +{{SITE_NAME}} - Mobile App + +{% endblock %} + +{% block content %} +
+ How to download rDrama mobile app + +
First step:
+ First step + +
Second step:
+ Second step +
+ +{% endblock %} diff --git a/files/templates/comments.html b/files/templates/comments.html index b8e1e4fb1..0a967f8f2 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -88,7 +88,7 @@ {% endif %} {% if c.post.sub %} - in /h/{{c.post.sub}} + in /h/{{c.post.sub}} {% endif %} {% elif c.author_id==AUTOJANNY_ID %} Notification @@ -291,7 +291,7 @@
- +
{% endif %}
@@ -540,7 +540,7 @@
- +
diff --git a/files/templates/header.html b/files/templates/header.html index 6007592c1..30a7cca49 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -68,9 +68,7 @@ {% if not HOLE_STYLE_FLAIR %}/h/{% endif %}{{sub}} {% elif has_logo %}