Commit Graph

1233 Commits

Author SHA1 Message Date
rr-
22342a29ad client/file-dropper: fix URL validation 2016-08-27 23:45:07 +02:00
rr-
9dc438c391 client/expanders: fix setting empty expander title 2016-08-27 22:19:01 +02:00
rr-
63ec28ddb3 client/posts: don't show notes on videos 2016-08-27 22:19:01 +02:00
rr-
02d631a65d client/css: improve appearance on small screens 2016-08-27 22:19:01 +02:00
rr-
f63d024777 client/css: improve comment edit form background
If text area was bigger than the post, switching to preview mode
showed gray space under the text. Now the preview pane's background
should fill the whole edit box size.
2016-08-27 22:19:01 +02:00
rr-
514c4349e0 client/css: split into files 2016-08-27 22:19:01 +02:00
rr-
702ec3e6fe client/settings: increase default post count to 42
Since on big resolutions the posts use 7 columns, it makes sense to use
a multiple of that.
2016-08-27 22:19:01 +02:00
rr-
473f2a4ddc client/posts: make rating icons consistent 2016-08-27 22:19:01 +02:00
rr-
3c5878cb16 server/tags: improve tag list performance 2016-08-27 22:19:01 +02:00
rr-
c21309aa35 client/models: don't modify API responses
API responses are cached internally - if they're modified, they're
modified in cache too. This can lead to certain anomalies, that can be
easily solved by making object copies.
2016-08-27 15:39:47 +02:00
rr-
63e8683fb8 client/tags: change 'edit time' to 'created on' 2016-08-27 15:29:40 +02:00
rr-
ef0f74297f server/tag-categories: fix default categories
- Don't cache default category in its entirety - cache only its name
- Purge cache on category name changes and default category changes
- Lock records for updates where applicable
2016-08-27 12:39:59 +02:00
rr-
06ab98fa70 server/search: fix sort:random breaking tags
Using sqlalchemy's subqueryload to fetch tags works like this:

1. Get basic info about posts with query X
2. Copy query X
3. SELECT all tags WHERE post_id IN (SELECT post_ids FROM query X)
4. Associate the resulting tags with the posts

When original query contains .order_by(func.random()), it looks like
this:

1. SELECT post.* FROM post ORDER BY random() LIMIT 10
2. Copy "ORDER BY random() LIMIT 10"
3. SELECT tag.* FROM tag WHERE tag.post_id IN (
       SELECT id FROM post ORDER BY random() LIMIT 10)
4. Disaster! Each post now has completely arbitrary tags!

To circumvent this, we replace eager loading with lazy loading. This
generates one extra query for each result row, but it has no chance of
producing such anomalies. This behavior is activated only for
queries containing "sort:random" and derivatives so it shouldn't hit
performance too much.
2016-08-27 01:21:59 +02:00
rr-
f8e91a10e8 server/search: refactor query factories 2016-08-27 01:19:29 +02:00
rr-
8f230f5701 client/css: fix wrapping tags in read-only sidebar 2016-08-26 23:52:03 +02:00
rr-
6d26b5c37a server/search: fix sort:random 2016-08-26 23:27:33 +02:00
rr-
fa60b42f65 server/search: improve post list performance 2016-08-26 17:57:20 +02:00
rr-
422b99ac8d server/search: add content-checksum 2016-08-26 16:26:06 +02:00
rr-
ffb87f1650 server/posts: defer flush; save content lazily
Rather than flushing the post right away only to find out that there
were validation errors, try to postpone flushing for as long as
possible.

The previous behavior has led to too eager spending of post IDs - each
flush calls nextval(post_id_seq), and postgres sequences are not
affected by transaction rollbacks, so each erroneous post creation
discarded a post ID, which has led to gaps in post IDs.
2016-08-26 15:09:08 +02:00
rr-
bb369efa99 server/general: disable autoflush 2016-08-26 14:41:05 +02:00
rr-
7451d16baf client/css: fix tag list style 2016-08-25 00:04:34 +02:00
rr-
9283851862 client/css: don't wrap long file names 2016-08-24 13:32:44 +02:00
rr-
0a488afbd8 client/posts: add webm thumbs to upload form 2016-08-24 13:29:29 +02:00
rr-
3da4c54030 client/posts: add controls for reordering uploads 2016-08-24 13:00:17 +02:00
rr-
280a55046a server/db: make query counter thread-local 2016-08-24 12:31:55 +02:00
rr-
c64453a15c client/tag-input: scroll suggestions up on refresh 2016-08-24 10:58:58 +02:00
rr-
263d4f3626 client/paging: fix unbinding endless pager 2016-08-24 10:55:31 +02:00
rr-
2ef63fcc7a client/tag-input: move removal links to left 2016-08-24 00:47:15 +02:00
rr-
f035140c9f client/css: simplify tag list outline workarounds
Rather than messing with negative margins, just make the outline inset
by replacing it with inset box-shadow.
2016-08-24 00:24:20 +02:00
rr-
7f4a2c1ceb client/posts: show tag/note counters in expanders 2016-08-23 23:19:40 +02:00
rr-
cc78766585 client/posts: use object URLs in upload form 2016-08-23 23:14:21 +02:00
rr-
f9754edcce client/general: fix autocomplete control
Regression from d5e197e.
2016-08-23 23:14:21 +02:00
rr-
ad8ed89e3c client/general: show empty thumbnails as grid 2016-08-23 23:14:05 +02:00
rr-
495f98a65f client/auth: fix edit sidebar for management only 2016-08-23 23:14:05 +02:00
rr-
d753bdfab1 client/auth: fix edit tag tab visibility 2016-08-23 23:14:05 +02:00
rr-
9124639564 client/auth: fix user forms reachable via URL 2016-08-23 23:14:05 +02:00
rr-
3c03c001e2 client/auth: fix tag forms reachable via URL 2016-08-23 23:14:05 +02:00
rr-
3ff48667a0 client/auth: fix swapped tag deleting and merging 2016-08-23 23:14:05 +02:00
rr-
34022d8fc8 client/auth: fix not hiding anonymity checkbox 2016-08-23 23:14:05 +02:00
rr-
e90b8972c7 client/auth: fix being able to rate/fav things 2016-08-23 23:12:29 +02:00
rr-
4ca7c49239 client/auth: fix masstag privilege bypass
Visiting mass-tag URL directly ignored masstag privileges and showed
tag/untag controls (although didn't show the controls in the header).
After this change, bypassing mass tag privileges got a little bit
harder. (It's still possible for the user to talk directly to the API
after all.)
2016-08-23 23:12:29 +02:00
rr-
1e9ee0838a client/auth: hide signup link in top nav if needed 2016-08-23 23:12:29 +02:00
rr-
08c6c2c145 client/auth: show errors early in controllers
In other words, verify the privileges client-side before issuing an
request to the server. This commit focuses on routing (e.g. clicking a
link while not logged in), rather than DOM element visibility that
should be already taken care of.
2016-08-23 23:12:29 +02:00
rr-
803a1350fa client/css: colorize 1st note point during drawing 2016-08-23 21:02:18 +02:00
rr-
fd2b4706a6 client/css: adjust thumbnail margins 2016-08-23 20:55:51 +02:00
rr-
124e871022 client/users: stop native completion
Disabled for user registration and editing where it causes more mess
than good.
2016-08-22 21:46:30 +02:00
rr-
fec31d7946 client/users: add exit confirmation for edit form 2016-08-22 21:38:34 +02:00
rr-
ea947ed91e client/tags: add exit confirmation for edit form 2016-08-22 21:38:31 +02:00
rr-
d8d4654849 client/events: adjust event names
1. "change" should be used to passive changes.
2. "submit" should be used to form submits.

These are not interchangeable.
2016-08-22 21:36:45 +02:00
rr-
73a8542220 server/posts: make anon snapshots for anon uploads 2016-08-22 20:07:39 +02:00