Revert "remove User.newtab and see if anyone complains"

This reverts commit 787c89961f.
pull/2/head
Aevann1 2022-11-21 18:55:09 +02:00
parent 79b2b5cff8
commit 2f31fdfdd7
11 changed files with 20 additions and 15 deletions

View File

@ -86,6 +86,7 @@ class User(Base):
slurreplacer = Column(Integer, default=1)
profanityreplacer = Column(Integer, default=1)
flairchanged = Column(Integer)
newtab = Column(Boolean, default=False)
newtabexternal = Column(Boolean, default=True)
reddit = Column(String, default='old.reddit.com')
nitter = Column(Boolean)

View File

@ -120,6 +120,7 @@ def settings_personal_post(v):
updated = updated or update_flag("hidevotedon", "hidevotedon")
updated = updated or update_flag("cardview", "cardview")
updated = updated or update_flag("highlightcomments", "highlightcomments")
updated = updated or update_flag("newtab", "newtab")
updated = updated or update_flag("newtabexternal", "newtabexternal")
updated = updated or update_flag("nitter", "nitter")
updated = updated or update_flag("imginn", "imginn")

View File

@ -8,7 +8,7 @@
<div class="settings-section rounded">
<div class="d-lg-flex">
<div class="title w-lg-25">
<label for="over18"><a href="{{app.permalink}}">{{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

@ -88,7 +88,7 @@
{% endif %}
{% if c.post.sub %}
<span class="ml-1"> in <a href="/h/{{c.post.sub}}">/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">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">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

@ -38,7 +38,7 @@
<strong class="pop-coins text-black"></strong>
<span class="text-black">coins</span>
</span>
<a href="/" 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

@ -96,6 +96,7 @@
<section id="site-settings-tab-behavior-section" class="settings-section-section">
<h5>Tab Behavior</h5>
<div class="settings-section rounded">
{{common.toggle_section("Open Internal Links In New Tabs", "newtab", "newtab", v.newtab, "Enable if you would like to automatically open links to other pages on the site in new tabs.", false)}}
{{common.toggle_section("Open External Links In New Tabs", "newtabexternal", "newtabexternal", v.newtabexternal, "Enable if you would like to automatically open links to other sites in new tabs.", false)}}
</div>
</section>

View File

@ -206,7 +206,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">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 %}
@ -225,7 +225,7 @@
<div class="post-actions mt-2">
<ul class="list-inline text-right d-flex">
<a class="list-inline-item" 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>
@ -386,7 +386,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">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 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" 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" 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 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 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

@ -64,7 +64,7 @@
<input autocomplete="off" id="file-upload-submit" multiple="multiple" accept="image/*, video/*, audio/*" type="file" name="file" {% if g.is_tor %}disabled{% endif %} onchange="changename('filename-show-submit','file-upload-submit');checkForRequired()" hidden>
</label>
<div id="preview" class="preview my-3"></div>
<div class="form-text text-small my-1"><a href="/formatting">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>
<input type="hidden" name="notify" value="off">

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">{{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 %}

View File

@ -951,6 +951,7 @@ CREATE TABLE public.users (
profileurl character varying(65),
bannerurl character varying(65),
hidevotedon boolean DEFAULT false NOT NULL,
newtab boolean DEFAULT false NOT NULL,
flairchanged integer,
defaultsortingcomments character varying(15) NOT NULL,
theme character varying(15) NOT NULL,
@ -2684,3 +2685,4 @@ ALTER TABLE ONLY public.comment_option_votes
--
-- PostgreSQL database dump complete
--