restore "notify followers" checkbox

remotes/1693045480750635534/spooky-22
Aevann1 2022-09-10 09:00:45 +02:00
parent 34aaed8045
commit c1aae95d16
7 changed files with 12 additions and 1 deletions

View File

@ -57,6 +57,7 @@ class Submission(Base):
ban_reason = Column(String)
embed_url = Column(String)
new = Column(Boolean)
notify = Column(Boolean)
author = relationship("User", primaryjoin="Submission.author_id==User.id")
oauth_app = relationship("OauthApp")

View File

@ -586,6 +586,7 @@ class User(Base):
Submission.deleted_utc == 0,
Submission.is_banned == False,
Submission.private == False,
Submission.notify == True,
Submission.author_id != self.id,
Submission.ghost == False,
Submission.author_id.notin_(self.userblocks)

View File

@ -137,6 +137,7 @@ def notifications_posts(v):
Submission.deleted_utc == 0,
Submission.is_banned == False,
Submission.private == False,
Submission.notify == True,
Submission.author_id != v.id,
Submission.ghost == False,
Submission.author_id.notin_(v.userblocks)

View File

@ -919,6 +919,7 @@ def submit_post(v, sub=None):
post = Submission(
private=bool(request.values.get("private","")),
notify=bool(request.values.get("notify","")),
club=club,
author_id=v.id,
over_18=bool(request.values.get("over_18","")),

View File

@ -164,6 +164,11 @@
<div class="form-text text-small"><a href="/formatting" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>Formatting help</a></div>
<pre></pre>
<div class="custom-control custom-checkbox">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="post-notify" name="notify" onchange="savetext()" checked>
<label class="custom-control-label" for="post-notify">Notify followers</label>
</div>
<div class="custom-control custom-checkbox">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="post-new" name="new" onchange="savetext()">
<label class="custom-control-label" for="post-new">Make the default comment sorting "new"</label>
@ -187,7 +192,7 @@
<div class="custom-control custom-checkbox">
<input onchange='draft(this);' autocomplete="off" type="checkbox" class="custom-control-input" id="post-ghost" name="ghost" {% if v.coins < 100 %}disabled{% endif %}>
<label class="custom-control-label" for="post-ghost">Ghost Thread (cost: 100 coins)</label>
<label class="custom-control-label" for="post-ghost">Ghost thread (cost: 100 coins)</label>
</div>
<pre>

View File

@ -0,0 +1,2 @@
alter table submissions add column notify bool not null default true;
alter table submissions alter column notify drop default;