remove android app and replace with instructions on how to install PWA

pull/2/head
Aevann1 2022-11-20 00:04:08 +02:00
parent 44aa666a4d
commit 5288d7a7dc
18 changed files with 52 additions and 42 deletions

View File

@ -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"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View File

@ -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

View File

@ -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'

View File

@ -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"

View File

@ -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,

View File

@ -283,6 +283,8 @@ def image(path):
@app.get('/static/assets/<path:path>')
@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:

View File

@ -14,7 +14,7 @@
<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>
<label for="over18"><a href="{{app.permalink}}" {% if v and v.newtab %}target="_blank"{% endif %}>{{app.app_name}}</a></label>
</div>
<div class="body w-lg-100">

View File

@ -0,0 +1,18 @@
{% extends "default.html" %}
{% block title %}
<title>{{SITE_NAME}} - Mobile App</title>
{% endblock %}
{% block content %}
<div class="ml-3 mt-4">
<b>How to download rDrama mobile app</b>
<div class="font-weight-bold mt-4 mb-2">First step:</div>
<img onclick="expandDesktopImage()" alt="First step" style="height:30vh" src="/i/app1.webp">
<div class="font-weight-bold mt-4 mb-2">Second step:</div>
<img onclick="expandDesktopImage()" alt="Second step" style="height:30vh" src="/i/app2.webp">
</div>
{% endblock %}

View File

@ -88,7 +88,7 @@
{% endif %}
{% if c.post.sub %}
<span class="ml-1"> in <a href="/h/{{c.post.sub}}" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>/h/{{c.post.sub}}</a></span>
<span class="ml-1"> in <a href="/h/{{c.post.sub}}" {% if v and v.newtab %}target="_blank"{% endif %}>/h/{{c.post.sub}}</a></span>
{% endif %}
{% elif c.author_id==AUTOJANNY_ID %}
<span class="font-weight-bold">Notification</span>
@ -291,7 +291,7 @@
<button type="button" id="cancel-edit-{{c.id}}" onclick="toggleEdit('{{c.id}}');remove_dialog()" class="btn btn-link text-muted ml-auto cancel-form fl-r commentmob">Cancel</button>
</form>
<div id="preview-edit-{{c.id}}" class="preview mb-3 mt-5"></div>
<div class="form-text text-small p-0 m-0"><a href="/formatting" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>Formatting help</a></div>
<div class="form-text text-small p-0 m-0"><a href="/formatting" {% if v and v.newtab %}target="_blank"{% endif %}>Formatting help</a></div>
</div>
{% endif %}
<div id="comment-{{c.id}}-actions" class="comment-actions{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
@ -540,7 +540,7 @@
<button type="button" onclick="document.getElementById('reply-to-{{c.id}}').classList.add('d-none');remove_dialog()" class="btn btn-link text-muted ml-auto cancel-form fl-r commentmob">Cancel</button>
</form>
<div id="form-preview-{{c.fullname}}" class="preview mb-3 mt-5"></div>
<div class="form-text text-small p-0 m-0"><a href="/formatting" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>Formatting help</a></div>
<div class="form-text text-small p-0 m-0"><a href="/formatting" {% if v and v.newtab %}target="_blank"{% endif %}>Formatting help</a></div>
</div>
</div>

View File

@ -68,9 +68,7 @@
<a id="sub-name" href="/h/{{sub}}" class="font-weight-bold ml-2 flex-grow-1 mt-1" style="font-size:max(14px,1.2vw)">{% if not HOLE_STYLE_FLAIR %}/h/{% endif %}{{sub}}</a>
{% elif has_logo %}
<style>
{% if g.webview %}
@media (min-width: 480px) {
{% elif SITE_NAME == 'WPD' %}
{% if SITE_NAME == 'WPD' %}
@media (min-width: 1000px) {
{% else %}
@media (min-width: 380px) {
@ -100,10 +98,6 @@
</form>
</div>
{% endif %}
{% if g.webview %}
<button type="button" class="mobile-nav-icon d-md-none" onclick="location.reload()"><i class="fas fa-arrow-rotate-right align-middle text-gray-500 black"></i></button>
{% endif %}
{% if SITE_NAME == 'PCM' %}
<a class="mobile-nav-icon d-md-none" href="/live" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Live"><i class="fas fa-circle align-middle black live-circle"></i></a>
@ -238,16 +232,15 @@
<div class="px-2">
<a class="dropdown-item" href="{{v.url}}"><i class="fas fa-user-circle fa-fw mr-3"></i>My profile</a>
<a class="dropdown-item" href="/settings"><i class="fas fa-cog fa-fw mr-3"></i>Settings</a>
<a class="dropdown-item" href="/app"><i class="fal fa-mobile fa-fw mr-3"></i>App</a>
{% if FEATURES['PROCOINS'] %}
<a class="dropdown-item" rel="nofollow noopener" href="/donate"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
{% endif %}
<button type="button" class="dropdown-item copy-link" data-clipboard-text="{{SITE_FULL}}/signup?ref={{v.username}}"><i class="fas fa-user-friends fa-fw mr-3"></i>Invite friends</button>
{% if has_app -%}
<a class="dropdown-item" href="/assets/app_{{SITE_NAME}}_v2.8.apk"><i class="fab fa-android fa-fw mr-3"></i>Android app</a>
{%- endif %}
<a class="dropdown-item" href="https://rdrama.net/h/changelog"><i class="fas fa-clipboard fa-fw mr-3"></i>Changelog</a>
<a class="dropdown-item" rel="nofollow noopener" href="https://github.com/Aevann1/rDrama"><i class="fab fa-github fa-fw mr-3"></i>Source code</a>
@ -301,20 +294,16 @@
<a class="nav-link" href="/settings"><i class="fas fa-cog fa-fw mr-3"></i>Settings</a>
</li>
<a class="nav-item nav-link" href="/app"><i class="fal fa-mobile fa-fw mr-3"></i>App</a>
{% if FEATURES['PROCOINS'] %}
<a class="nav-item nav-link" rel="nofollow noopener" href="/donate"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
{% endif %}
{% if not g.webview %}
<li class="nav-item">
<button type="button" class="nav-link copy-link" data-clipboard-text="{{SITE_FULL}}/signup?ref={{v.username}}"><i class="fas fa-user-friends fa-fw mr-3"></i>Invite friends</button>
</li>
{% endif %}
<li class="nav-item">
<button type="button" class="nav-link copy-link" data-clipboard-text="{{SITE_FULL}}/signup?ref={{v.username}}"><i class="fas fa-user-friends fa-fw mr-3"></i>Invite friends</button>
</li>
{% if has_app -%}
<a class="nav-item nav-link" href="/assets/app_{{SITE_NAME}}_v2.8.apk"><i class="fab fa-android fa-fw mr-3"></i>Android app</a>
{%- endif %}
<a class="nav-item nav-link" href="https://rdrama.net/h/changelog"><i class="fas fa-clipboard fa-fw mr-3"></i>Changelog</a>
<a class="nav-item nav-link" rel="nofollow noopener" href="https://github.com/Aevann1/rDrama"><i class="fab fa-github fa-fw mr-3"></i>Source code</a>

View File

@ -185,7 +185,7 @@
</script>
{% endif %}
{% if request.path == '/' and time.time() > session.get('tooltip_last_dismissed',0)+60*60*24*30 and not g.webview %}
{% if request.path == '/' and time.time() > session.get('tooltip_last_dismissed',0)+60*60*24*30 %}
<style>
.beg-icon {
color: #919191;

View File

@ -38,7 +38,7 @@
<strong class="pop-coins text-black"></strong>
<span class="text-black">coins</span>
</span>
<a href="/" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} class="pop-viewmore ml-auto text-decoration-none">
<a href="/" {% if v and v.newtab %}target="_blank"{% endif %} class="pop-viewmore ml-auto text-decoration-none">
<span class="ml-3">View</span>
<i class="fas fa-arrow-right fa-sm px-1"></i>
</a>

View File

@ -203,7 +203,7 @@
<button type="button" onclick="togglePostEdit('{{p.id}}');remove_dialog()" class="btn btn-link text-muted ml-auto cancel-form fl-r">Cancel</button>
</form>
<div id="post-edit-{{p.id}}" class="preview mb-3 mt-5"></div>
<div class="form-text text-small p-0 m-0"><a href="/formatting" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>Formatting help</a></div>
<div class="form-text text-small p-0 m-0"><a href="/formatting" {% if v and v.newtab %}target="_blank"{% endif %}>Formatting help</a></div>
</div>
{% endif %}
@ -222,7 +222,7 @@
<div class="post-actions mt-2">
<ul class="list-inline text-right d-flex">
<a class="list-inline-item" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}">
<a class="list-inline-item" {% if v and v.newtab %}target="_blank"{% endif %} href="{{p.permalink}}">
<i class="fas fa-comment-dots mr-2"></i>{{p.comment_count}}
<span class="text-info d-none {{p.id}}-new-comments"></span>
</a>
@ -383,7 +383,7 @@
<button type="button" id="save-reply-to-{{p.fullname}}" form="reply-to-{{p.fullname}}" class="btn btn-primary text-whitebtn ml-auto fl-r" onclick="post_comment('{{p.fullname}}');remove_dialog()">Comment</button>
</form>
<div id="form-preview-{{p.fullname}}" class="preview mb-3 mt-5"></div>
<div class="form-text text-small p-0 m-0"><a href="/formatting" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>Formatting help</a></div>
<div class="form-text text-small p-0 m-0"><a href="/formatting" {% if v and v.newtab %}target="_blank"{% endif %}>Formatting help</a></div>
</div>
{% else %}
<div class="comment-write mb-3">

View File

@ -82,7 +82,7 @@
{% if p.club and not (v and (v.paid_dues or v.id == p.author_id)) %}
<img alt="post thumnail" loading="lazy" src="/e/marseyglow.webp" class="post-img">
{% elif not p.url %}
<a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}">
<a {% if v and v.newtab %}target="_blank"{% endif %} href="{{p.permalink}}">
<img alt="post thumnail" loading="lazy" src="{{p.thumb_url}}" class="post-img">
</a>
{% elif p.is_image %}
@ -117,7 +117,7 @@
</div>
</div>
<h5 class="card-title post-title text-left w-lg-95 pb-0 pb-md-1">
<a id="{{p.id}}-title" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}" class="{% if p.sub %}sub{% endif %} stretched-link {% if p.author.agendaposter and p.sub != 'chudrama' %}agendaposter{% endif %}">
<a id="{{p.id}}-title" {% if v and v.newtab %}target="_blank"{% endif %} href="{{p.permalink}}" class="{% if p.sub %}sub{% endif %} stretched-link {% if p.author.agendaposter and p.sub != 'chudrama' %}agendaposter{% endif %}">
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
{{p.realtitle(v) | safe}}
@ -131,7 +131,7 @@
{% if p.realbody(v, listing=True) %}
<button type="button" class="list-inline-item ml-2" onclick="expandText('{{p.id}}')"><i class="fas fa-expand-alt mx-0 text-expand-icon-{{p.id}}"></i></button>
{% endif %}
<a class="list-inline-item" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}">
<a class="list-inline-item" {% if v and v.newtab %}target="_blank"{% endif %} href="{{p.permalink}}">
<i class="fas fa-comment-dots mr-2"></i>{{p.comment_count}}
<span class="text-info d-none {{p.id}}-new-comments"></span>
</a>
@ -143,7 +143,7 @@
<div class="post-actions">
<ul class="list-inline text-right d-flex">
<li class="list-inline-item mr-auto">
<a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}">
<a {% if v and v.newtab %}target="_blank"{% endif %} href="{{p.permalink}}">
<i class="fas fa-comment-dots ml-0 mr-2"></i>{{p.comment_count}}
<span class="text-info d-none {{p.id}}-new-comments"></span>
</a>
@ -246,7 +246,7 @@
{% if p.is_image and not p.over_18 and ((v and v.cardview) or (not v and CARD_VIEW)) %}
<div style="text-align: center" class="mt-3 mb-4">
<a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} rel="nofollow noopener" href="{{p.realurl(v)}}">
<a {% if v and v.newtab %}target="_blank"{% endif %} rel="nofollow noopener" href="{{p.realurl(v)}}">
<img loading="lazy" data-src="{{p.realurl(v)}}" src="/i/l.webp" class="img-fluid" style="max-height:20rem" alt="Unable to load image">
</a>
</div>

View File

@ -87,7 +87,7 @@
<div id="preview" class="preview my-3"></div>
<div class="form-text text-small my-1"><a href="/formatting" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>Formatting help</a></div>
<div class="form-text text-small my-1"><a href="/formatting" {% if v and v.newtab %}target="_blank"{% endif %}>Formatting help</a></div>
<div class="custom-control custom-checkbox">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="post-notify" name="notify" onchange="savetext()" checked>

View File

@ -103,7 +103,7 @@
{% endif %}
<span data-bs-toggle="tooltip" data-bs-placement="bottom" onmouseover="timestamp('timestamp-{{p.id}}','{{p.created_utc}}')" id="timestamp-{{p.id}}">&nbsp;{{p.age_string}}</span>
&nbsp;
({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.is_audio %}audio post{% elif p.domain %}<a href="/search/posts/?q=domain%3A{{p.domain}}&sort=new&t=all" class="post-meta-domain" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>{{p.domain|truncate(50, True)}}</a>{% else %}text post{% endif %})
({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.is_audio %}audio post{% elif p.domain %}<a href="/search/posts/?q=domain%3A{{p.domain}}&sort=new&t=all" class="post-meta-domain" {% if v and v.newtab %}target="_blank"{% endif %}>{{p.domain|truncate(50, True)}}</a>{% else %}text post{% endif %})
{% if p.edited_utc %}
<span class="ml-2">Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" id="edited_timestamp-{{p.id}}" onmouseover="timestamp('edited_timestamp-{{p.id}}','{{p.edited_utc}}')">{{p.edited_string}}</span></span>
{% endif %}