Commit Graph

1146 Commits (4454648ea21db498492f0fe14de5dd986d0cfc71)

Author SHA1 Message Date
Aevann1 1a0b2b6813 fix 500 errors 2022-07-02 08:51:19 +02:00
Aevann1 d0d15c319a Poll rework (#312)
* poll rework

* forgot to do joinedload on comments

* Fix logic errors with voting, SQL syntax.

Kitchen sink commit from review of poll-rework changes:
  1. Fix seed-db.sql syntax error.
  2. Fix SQL patch file duplication of *submissions* tables rather
     than one set of submissions and one for comments.
  3. Start makeshift SQL patch folder, since this is a large change
     that contributors may wish to apply to their local instances.
  4. Fix checkbox (non-`exclusive`) polls being unable to be
     unchecked. For consistency with `exclusive` polls, they should.
  5. Fix changing the option of an `exclusive` poll when both
     exclusive and non-exclusive options are present in one comment/
     post causing the non-exclusive options to become unchecked.
     (which, by my reading of SQLAlchemy `Query.one_or_none()`
     really could break quite badly in some cases).

* link relationships with their counterparts

* small modification to poll unchecking

Co-authored-by: TLSM <duolsm@outlook.com>
2022-07-02 08:48:04 +02:00
Aevann1 f56be06eb8 add hole pinning 2022-07-02 01:11:48 +02:00
Aevann1 070945d98a cut down on the number of queries 2022-06-29 09:22:18 +02:00
Aevann1 5661cdb271 Revert "try to cut down on number of db queries"
This reverts commit c674c6a056.
2022-06-29 08:43:20 +02:00
Aevann1 c674c6a056 try to cut down on number of db queries 2022-06-29 08:14:25 +02:00
Aevann1 c341be2866 show posts by users who block you 2022-06-29 05:07:00 +02:00
Aevann1 4fae28a2a2 fix child comment highlighting 2022-06-28 02:41:25 +02:00
Aevann1 ab5078f313 show vote time 2022-06-27 06:10:10 +02:00
Aevann1 52a8a219ae make poorcel-mode device-specific 2022-06-27 05:46:32 +02:00
Aevann1 b1ef8e4c62 add poorcel mode 2022-06-27 04:14:53 +02:00
Aevann1 8b8f99695b make ppl with 200 coins able to bet 2022-06-26 23:40:02 +02:00
Aevann1 e7ce39bd80 fix poll-voting 2022-06-26 22:53:12 +02:00
Aevann1 b450d5bb8c fix sorting by bottom for comments 2022-06-26 08:16:05 +02:00
Aevann1 81243b48dd fix sorting by top/bottom for posts 2022-06-26 08:15:06 +02:00
Aevann1 5e745e38d3 revert the saving and subscription shit 2022-06-26 08:11:38 +02:00
Aevann1 5aad7e09a6 dont query polls on frontpage 2022-06-26 08:10:02 +02:00
Aevann1 4d7e7b629b fix 0ef33b396a 2022-06-26 07:51:02 +02:00
Aevann1 0ef33b396a make checking if a post is subscribed to less retarded 2022-06-26 07:45:49 +02:00
Aevann1 2a8b7bf281 undefer css (1 less query) 2022-06-26 07:39:46 +02:00
Aevann1 e36adb5bf4 reduce query volume, badge edition 2022-06-26 07:11:25 +02:00
Aevann1 ecc22cfc06 fix 2b1e7f6570 2022-06-26 06:57:31 +02:00
Aevann1 2b1e7f6570 make checking if a post/comment is saved less retarded 2022-06-26 06:54:41 +02:00
Aevann1 e34cbeca31 fix 3b8188fd67 2022-06-26 03:25:17 +02:00
Aevann1 3b8188fd67 fixed version of d83d47e280 2022-06-26 03:22:05 +02:00
Aevann1 a1b137447e Revert "reduce query volume #1"
This reverts commit d83d47e280.
2022-06-26 03:12:31 +02:00
Aevann1 cff34fb3a4 reducing query volume, #2 2022-06-26 03:11:02 +02:00
Aevann1 cd4b3b7d3b Merge branch 'frost' of https://github.com/Aevann1/Drama into frost 2022-06-26 02:50:49 +02:00
Aevann1 d83d47e280 reduce query volume #1 2022-06-26 02:50:47 +02:00
Snakes 7b38be0101 Reduce query volume in user.user_awards.
The User model class method user_awards previously made one query
per type of award. This has been replaced with a new query that
retrieves all owned award quantities at once using GROUP BY.
2022-06-25 20:22:56 -04:00
Aevann1 bc7185b5af order awards by the time they were awarded 2022-06-25 22:33:51 +02:00
Aevann1 ffd0d9ed31 show duration on ban icon tooltip 2022-06-25 02:11:00 +02:00
Snakes 47159f338d Fix exception when serializing comments JSON.
The JSON API endpoints that return comments, most notably `/comments`
returned 500s and created a stack trace with:

  TypeError: Object of type method is not JSON serializable

Further debugging revealed this was because json.encoder was being
given a <bound method lazy.<locals>.wrapper of <Comment(id=123)>> to
serialize.

The introduction of the bug was traced to 8ecb4582d0 where it was
discovered that the (seemingly inadvertent) removal of the @property
decorator on classes/comment.py:parent_fullname was the root cause.

In light of the fact that parent_fullname was unrelated to the changes
intended in 8ecb4582d0 and that no other refactoring around
parent_fullname was done, it was restored to being a @property rather
than its callers modified to invoke it as a method.
2022-06-24 15:26:18 -04:00
Aevann1 de8981b5e5 fixing 500 errors 2022-06-24 17:35:55 +02:00
Aevann1 9593dc58dd move regex from helpers.const into its own helper file 2022-06-24 16:30:59 +02:00
Aevann1 4723640b89 fix this https://chapotraphouse.club/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/2175391?context=8#context 2022-06-23 22:02:40 +02:00
Aevann1 ceb72a470c add more @lazy to functions 2022-06-23 18:36:39 +02:00
Aevann1 39cf7fc48b refactor normalizing urls at runtime (I put the function in comment.py cuz there were weird import errors that i didnt wanna fix) 2022-06-23 17:47:57 +02:00
Aevann1 a50544d86a fixing "more comments" button appearing when there's no more comments 2022-06-23 00:25:10 +02:00
Aevann1 0f0a07204c fix 500 errors 2022-06-22 22:42:19 +02:00
Aevann1 152d39ce6c fix controversial sorting, give priority to new posts 2022-06-22 22:30:45 +02:00
Aevann1 f149198c9f fix comments refactor 2022-06-22 22:06:25 +02:00
Aevann1 062542c5af fix posts refactor (again 2022-06-22 22:03:57 +02:00
Aevann1 3023a45d75 fix posts refactor 2022-06-22 22:03:10 +02:00
Aevann1 10a47ca837 refactor sorting posts 2022-06-22 21:57:57 +02:00
Aevann1 8ecb4582d0 refactor sorting comments 2022-06-22 21:50:20 +02:00
Aevann1 4ba26b7872 fix bug with profile views (again) (again) 2022-06-22 18:45:34 +02:00
Aevann1 fef2e9b024 fix bug with profile views older than a month (again) 2022-06-22 18:42:45 +02:00
Aevann1 171df8a2c1 fix bug with profile views older than a month 2022-06-22 18:42:07 +02:00
Aevann1 9ecca715fd don't collapse the comment the user is viewing 2022-06-22 18:25:11 +02:00
Aevann1 d704592bdd cache-bust all previously broken images 2022-06-22 17:59:47 +02:00
Aevann1 20585ca543 add a shortened endpoint for static images and rename loading.webp to l.webp (to save bytes) 2022-06-22 17:51:19 +02:00
Snakes e2cd25db67 WPD: limit hole creation to JL2+. 2022-06-21 01:20:21 -04:00
Snakes f6b6997f61 Persist activity timestamp to users. 2022-06-20 16:25:03 -04:00
Snakes dee8eb5154 Replace loading.webp with new marseyloading. 2022-06-19 22:15:33 -04:00
Aevann1 f1f30635b2 hide deleted posts and comments from userpages (frequently requested) 2022-06-19 01:55:45 +02:00
Aevann1 f60db1598d replace "g.db.query" on pkeys with the much more efficient "g.db.get" 2022-06-18 02:57:23 +02:00
Snakes 564f5b38f1 Clarify notif color logic, extend to modaction.
Previously, notification bell linking & color logic was interspersed
between templates and the user model. It doesn't _really_ belong in
the user model, but it's been moved out of the templates to there to
at least centralize it. This was also used as an opportunity to make
the modactions inbox color the bell appropriately.
2022-06-15 01:43:34 -04:00
Aevann1 0f49c8e32f replace spaces with tabs 2022-06-13 20:33:25 +02:00
Aevann1 cf827bdf38 unhide some mod actions from non-jannies 2022-06-13 15:37:46 +02:00
Snakes acde2c856b Enable JL2 viewing shadowbanned comments. 2022-06-12 05:48:27 -04:00
Aevann1 a082105ab8 remove weird trailing tabs 2022-06-11 11:56:16 +02:00
Aevann1 358ce08544 don't collapse gambling comments when viewing a comment 2022-06-11 11:30:46 +02:00
Aevann1 545f276940 add created_utc column to badges for ordering them on userpages 2022-06-10 23:40:43 +02:00
Aevann1 995e6e9edb add thumbnail for posts linking to same site 2022-06-10 21:21:25 +02:00
Aevann1 2db414f12d Merge branch 'frost' of https://github.com/Aevann1/Drama into frost 2022-06-10 14:48:14 +02:00
Aevann1 2b82f95a98 Make hole cost constant instead of variable 2022-06-10 14:48:11 +02:00
Snakes 4db48a6ec9 Separate modaction notifs from inbox. 2022-06-10 08:28:46 -04:00
Snakes 8709ca816d Add Y'all Seein' Eye award v2 for offsitementions.
Reusing the assets and design for the ill-fated YSE in a0f441a67d.
This time, the award provides access to our offsite mentions (reddit
notifs).
2022-06-10 07:12:19 -04:00
Snakes b0554ce303 Add follower count to /holes table. 2022-06-10 06:06:56 -04:00
Snakes dc7f13304e Add following holes for notifications. 2022-06-09 16:24:24 -04:00
Snakes b94e71450f Add un-holing to hole report command. 2022-06-09 02:42:52 -04:00
Snakes fd1429a82f PCM content: swap banner. 2022-06-01 16:08:33 -04:00
Snakes 04a878a8c4 Make betting polls respect can_gamble. 2022-05-30 08:13:11 -04:00
Snakes e32a4bda48 Add set/unset nsfw on comment to modlog. 2022-05-30 08:00:16 -04:00
Snakes 81e19b1aed Add can_gamble user setting.
Users now have a toggleable can_gamble setting which disables their
ability to use all chance-based gains on the site: viz. slots,
blackjack, the lottery, and treasure chests.

This only applies on invocation of commands that start gambling
games, so it should cause no bugs when toggled with e.g. active
blackjack games.

This was added for the benefit of users with actual problems with
gambling, be they past addiction or religious conviction. All future
gambling features are humbly requested to respect it.
2022-05-30 05:32:45 -04:00
Snakes 5b6ba1ac82 Merge remote-tracking branch 'mccoxmaul/add-lottershe' into frost 2022-05-29 23:52:04 -04:00
Aevann1 aff30db1fe make sure the post/comment for which someone was banned is linked everywhere (for convenience) 2022-05-30 04:55:51 +02:00
Snakes 0a73083e8a Add settings toggle for UI animations. 2022-05-29 03:08:28 -04:00
Outrun Colors, LLC d1f0f7a164 Add foreignkey 2022-05-29 01:18:16 -05:00
Outrun Colors, LLC 469c39dca6 Configure admin section and purchasing a ticket full flow 2022-05-28 22:33:44 -05:00
Aevann1 851eff0f18 sdf 2022-05-28 19:50:48 +02:00
Aevann1 f823396239 sdf 2022-05-27 02:08:28 +02:00
Aevann1 2a9df987b3 fsd 2022-05-27 02:03:04 +02:00
Aevann1 66b3efab36 award refactor 2022-05-27 01:08:23 +02:00
Aevann1 de40b074ac yes 2022-05-26 03:30:25 +02:00
Aevann1 163267c88c Revert "Add Y'all Seein' Eye award."
This reverts commit a0f441a67d.
2022-05-26 02:51:42 +02:00
Aevann1 65388d3e57 sfd 2022-05-26 01:50:13 +02:00
Snakes a0f441a67d Add Y'all Seein' Eye award.
Adds award to enable viewing profile visitors for non-mops and
non-patrons. This commit should encompass all frontend, backend, and
database changes necessary. Perhaps usable as a model for other
user upgrade flag awards.
2022-05-25 19:44:34 -04:00
Aevann1 50b995d3a0 fds 2022-05-25 22:16:26 +02:00
Aevann1 3706d3d22c sdf 2022-05-25 20:36:09 +02:00
Aevann1 386db76c10 crgd is a king 2022-05-25 20:29:22 +02:00
Aevann1 6febbc4858 scratch that 2022-05-25 19:09:26 +02:00
Aevann1 5b1477acfc certified good commit 2022-05-25 19:01:29 +02:00
Aevann1 b08d374b4b fds 2022-05-25 17:47:15 +02:00
Snakes 53a80af241 Restore old agendaposter pfps system, add more.
Restores agendaposter pfps from 1576fcd57d and adds 52-57.
Also restores code in classes/user.py which implements them.
2022-05-25 00:41:23 -04:00
Aevann1 061c4936ce fds 2022-05-25 04:58:26 +02:00
Aevann1 02e98b46b0 is_audio 2022-05-24 18:28:12 +02:00
Snakes cc75375c82 Un-deploy Birthgay event.
Removes temporary changes for the Birthgay 2022 event, ending
approximately at 2022-05-23 0600Z. Changes:
 - Double XP disabled.
 - Lootboxes disabled.
 - Three event awards given real descriptions and colors.
 - Partyhats: restored to cakeday-only condition and tooltip.
 - Header UI: balloons removed, text visibility outline removed,
   journoid banner reverted, marseyjam as header icon.
 - Birthgay banners: removed from template, moved to new storage dir.

Confetti, though remaining as a permanent award, has been temporarily
removed pending a less performance-intensive implementation and one
that doesn't require maintaining a third-party package in the codebase.
2022-05-23 01:48:25 -04:00
Aevann1 649f8d5323 vdffsd 2022-05-23 00:45:04 +02:00
Aevann1 969d1898b5 vid refactor 2022-05-22 18:13:19 +02:00
Aevann1 20cc20d806 fsd 2022-05-21 14:36:22 +02:00
Aevann1 aed84df4ad fsd 2022-05-20 20:45:12 +02:00
Snakes c789f6923e Merge remote-tracking branch 'upstream/frost' into birthgay-staging 2022-05-19 17:59:35 -04:00
Snakes 69dec16f55 Shop badge discount: fix Spender, add Roller disc.
The shop discount from Big Spender badges was incorrectly implemented:
intended behavior was for 2pp per badge. However, the values in
const.py were set as if a user could only have one Spender badge at
once, while user.py @ discount was implemented as if they were
additive. Since users factually do have multiple big spender badges,
the values in const were adjusted to reflect this fact.

Also, lootbox Roller badges now each offer a 1pp discount.
users.py @ discount was improved to check against the `discounts`
keys for appropriate badges, rather than a hardcoded list.
2022-05-19 13:41:04 -04:00
Aevann1 44cd7f4a92 fds 2022-05-19 09:49:15 +02:00
Aevann1 e0c1e6b4cd sfd 2022-05-16 22:57:47 +02:00
Snakes b6339ca95f Add exact timestamps to mod log.
Modlog only had ModAction.age_string visible. However, we sometimes
need to know the exact time an action was taken.
Adds `created_string` to ModAction, and exposes that to log.html.
2022-05-16 11:33:26 -04:00
Aevann1 45da8f0f35 sdf 2022-05-09 14:15:23 +02:00
Aevann1 b71ae6cc74 sf 2022-05-09 13:21:49 +02:00
Aevann1 f2039d7713 sfd 2022-05-07 06:13:19 +02:00
Aevann1 c5f5342373 sdf 2022-05-06 00:55:34 +02:00
Aevann1 2008bc76c1 cakedays 2022-05-05 01:31:11 +02:00
Aevann1 6b10d097a2 mn 2022-05-05 01:09:46 +02:00
Aevann1 37bd922126 sfd 2022-05-04 05:33:00 +02:00
Aevann1 5e2da5673c fsd 2022-05-03 06:28:42 +02:00
Aevann1 df9585017c dsa 2022-05-02 23:30:03 +02:00
Aevann1 9eeb214a24 fsd 2022-05-02 03:45:22 +02:00
Aevann1 ccfbbba09a fsd 2022-05-02 03:42:59 +02:00
Aevann1 f59286b202 fsd 2022-05-02 03:41:08 +02:00
Aevann1 bc2a20cd4b sfd 2022-05-01 23:44:38 +02:00
outruncolors 0ff7bdc28a Added doubledown and insurance functionality (#235)
* Added doubledown functionality

* Add insurance
2022-05-01 20:24:01 +02:00
Aevann1 a6b26ece67 fsd 2022-04-29 17:19:50 +02:00
Aevann1 e73fcbd56a sfd 2022-04-29 17:17:14 +02:00
Aevann1 d961ffc913 fds 2022-04-28 02:04:01 +02:00
Aevann1 43751ccde2 vdx 2022-04-26 16:18:57 +02:00
Aevann1 5afa0c0d2a fsd 2022-04-26 16:15:06 +02:00
Aevann1 957c97f2c7 sfd 2022-04-26 15:33:39 +02:00
Aevann1 f9ea51611f fds 2022-04-26 02:36:03 +02:00
Aevann1 43366f4a28 fds 2022-04-26 02:26:27 +02:00
Aevann1 13166f5ca3 vcx 2022-04-26 00:43:59 +02:00
Aevann1 2d1d946919 vxc 2022-04-26 00:41:34 +02:00
Aevann1 0f05bf3f94 fsd 2022-04-26 00:28:20 +02:00
Aevann1 5c21180705 Revert "vxc"
This reverts commit 4d0c7ba456.
2022-04-25 23:59:12 +02:00
Aevann1 ad47e9524a dfs 2022-04-25 21:52:30 +02:00
Aevann1 4d0c7ba456 vxc 2022-04-25 18:38:06 +02:00
Aevann1 017dde4e51 fds 2022-04-20 21:39:56 +02:00
Aevann1 aa498d89c7 gfd 2022-04-19 21:13:36 +02:00
Aevann1 e49889e944 fds 2022-04-19 19:46:51 +02:00
Aevann1 f3743d717d fds 2022-04-18 23:11:30 +02:00
Aevann1 d7fa942d85 fds 2022-04-18 18:01:03 +02:00
Aevann1 69d285b0f3 fds 2022-04-18 01:00:17 +02:00
Aevann1 c7d3401b62 fds 2022-04-18 00:47:30 +02:00
Aevann1 8214e2c6f9 fds 2022-04-18 00:13:37 +02:00
Aevann1 9c0441aef9 fsd 2022-04-17 23:46:29 +02:00
Aevann1 78ea56837f fds 2022-04-17 22:20:40 +02:00
Aevann1 6156c78df6 fds 2022-04-16 18:44:32 +02:00
Aevann1 3ff98226fa fds 2022-04-16 18:42:28 +02:00
Aevann1 a20aba178a fsd 2022-04-16 18:42:18 +02:00
Aevann1 690e1ba280 fds 2022-04-16 18:41:38 +02:00