We're always using lowercase for all ltree usages (group paths, topic
tags), so it's best to just have the Ltree field do this conversion.
This fixes some minor issues like tag-filtering not working if the
casing of the tag was wrong.
A few other changes needed to be made as part of this, in places where I
was inadvertently passing an Ltree value into the Ltree field, instead
of a string.
Deleted comments weren't collapsing properly, since this wasn't
attaching the classes even if the comments were collapsed by one of the
CommentTree processes.
Uncollapsing the new comments' parents wasn't working correctly if there
were several new replies in a chain. Because it's working from the
"leaf" comments back up towards the root, doing a continue when a
comment's state had already been set would cause uncollapsing parents to
fail - the deepest comment would uncollapse its parent, then its parent
would get skipped. If the parent was also new, this would mean that
*its* parent didn't get uncollapsed, even though it should have been.
The ago library doesn't handle datetimes correctly if they have any
timezone except the system's localtime. This can be worked around by
calculating a timedelta and passing that instead of a datetime. This
commit updates the descriptive_timedelta() function to do that.
I've also registered an issue on the library, but I don't know if it's
maintained any more:
https://bitbucket.org/russellballestrini/ago/issues/3
Previously, TopicListingSchema was being used for things that weren't
listings of topics. So this creates a more generic
PaginatedListingSchema and makes TopicListingSchema a subclass of it
that adds the additional fields it needs.
This has said that pagination is "coming soon" for quite a while. This
is a bit messy in a few ways, but should do the job for now.
PaginatedQuery/PaginatedResults might be good to refactor a little in
the future to make this kind of thing simpler.
Automatically runs the generate-site-icons script every 5 minutes. The
script was also updated to use checksum-based rsync instead of cp, so
that the file won't be replaced (and need to be redownloaded by users)
unless it actually changes.
This adds a trigger to the scraper_results table which will add rabbitmq
messages whenever a scrape finishes, as well as a consumer that picks up
these messages, and uses Embedly data to download (and resize if
necessary) the favicons from any sites that are scraped. These are
downloaded into the input folder for the site-icons-spriter, so it
should be able to use these to generate spritesheets.
* Enables wrapping when the buttons will go offscreen
* Turns on minimum touch size
* Adds a "..." on the labels that require a reason
* Moves the info about the cooldown on Exemplary into the prompt
Both the initialize_db script and Alembic need to import all
DatabaseModel subclasses so that DatabaseModel.metadata has all the
models attached. Previously this wasn't being done properly, and the
intialize_db script wasn't creating the scraper_result table since it
hadn't been imported.
This commit creates a dedicated module to import all of those classes,
so that both those locations can simply import * from it instead of
needing to import all the models individually. This still isn't great
overall, but it should be less prone to mistakes at least.
Solarized's green color is pretty awful, not really attractive for
Exemplary comments. This switches Exemplary to blue, Joke to green, and
Offtopic to cyan. It also rearranges the order a bit so that the colors
in the labeling menu go in a progression that looks right.
Since the production version is using a default label weight of 0.5,
previously two users would have had to label the same comment Exemplary
for it to actually activate. This will probably be fairly uncommon so we
most likely don't want it to work that way. This reduces it to 0.5 so
that one label will trigger it, but it would probably be better to
specifically set it to the default label weight if that's feasible
somehow.
This is a bit of a hacky way of doing it in a few aspects and definitely
still needs some work, but it's a reasonable start. Specifically, a
major miss is that there's no way to remove an Exemplary label unless
you currently have one available. This should definitely be fixed, but
I'm not sure what might be the best approach yet.
This adds an "exemplary" comment tag which has a few special behaviors:
* Requires a reason, which is visible (anonymously) to the tagged
comment's author.
* Highlights the comment's left side in green
* Acts as a multiplier to the comment's voting
I think we'll still want to add a cooldown or something similar on using
this tag, but this covers the basic functionality for it.
Using orange had a bit of a "this is a bad thing" implication to it (and
was hard to tell apart from the red of Malice). It also makes a bit more
sense to have the more-negative tags (Noise and Malice) to the right.
No functionality impact yet, but changes these two tags into a single
one. The alembic migration is a bit tricky to deal with the potential
constraint violation if a user had tagged a comment with both "flame"
and "troll".
Previously, topic lists filtered down to a tag were using "descendant
of", so for example a listing based around the "ask" tag would show
topics that have the exact tag "ask" as well as any sub-tags, such as
"ask.survey". However, it wouldn't show a hypothetical "example.ask"
tag, where the "ask" was at the end.
This commit updates the method used to utilize lqueries to search for
tags that either start or end with the specified one (which includes
exact full matches as well).
Some (mostly minor) adjustments to the syntax highlighting:
* Take advantage of SCSS nesting
* Switch to using a <code> tag instead of a <div> (requires creating a
custom Pygments formatter class)
* Change "syntax_" prefix to "syntax-" for consistency
* Refactor Bleach attribute-checking function a bit and drop unnecessary
one (the "language-" class gets dropped before sanitization)
Adds a new comment sort named "relevance" (may change the name) and
makes it the default. This sort takes into account the tags that have
been applied to comments and sorts them differently based on them. This
will certainly require a lot more work and adjustments, but for now it
will help push down noise, offtopic, and joke comments.
In the future, this can probably also be used to apply some more
interesting sorting effects, like potentially placing new comments
temporarily near the top of the comment section to help them get a bit
of initial exposure in large threads.
This gives each comment tag a "weight" value, which is a float. This
weight can be set for each user to affect their future comment tags, and
if a user doesn't have a weight set it uses a global default value
that's set in the INI file. This global default is set to 1.0 for
development purposes, since that should make it so that a single tag
will have an effect. It should probably be set lower initially in
production so that single users can't cause tag effects.
Instead of lightening the text of collapsed comments and displaying them
in italics, this shrinks the font size a little but still keeps them at
the normal level of contrast. That should make them more easily readable
while still de-emphasizing them somewhat.
Now that a bit more info (link publication dates) is being shown inside
the topic content metadata sometimes, white-space: nowrap probably isn't
a very good idea and has a chance of causing issues on mobile. Just
letting it wrap should be fine most of the time, though it could look a
little strange when it wraps in the middle of a word count or date.