Not needed for much yet, but should be used here anyway to prevent
"new_page" pages from being created inside folders (which isn't possible
yet anyway).
The base Spectre.css style for tables only has borders between rows, but
that can look pretty weird in larger tables. This is more of a normal
table styling.
Currently, there's no way for users to put pages inside folders, but
that can probably be added in the future. This will allow the
~tildes.official wiki to continue working even though some of the pages
have now been moved into folders to match up with the Docs site.
Adds a couple of new utility functions, and replaces all the previous
checks that were based on lightness() with checks against
perceived-brightness() instead.
In the end, the only actual changes this makes to the CSS is flipping
the foreground color of error chips (topic tags with invalid characters)
in the Black and Atom One Dark themes.
This will break an install if people copy this file and don't set or
remove this, so it should probably be commented out by default and let
people un-comment if they actually want to use it.
<small> is a better element for doing "side comments" instead of having
people hijack <sup> for that purpose. It will have to be typed in
manually since there's no markdown syntax for it, but I think it's good
to allow.
Previously, either double or single tildes would work for strikethrough.
However, this had some strange edge cases, such as attempting to
strikethrough some words that contain a group reference. Since Tildes
uses single tildes for other purposes, it should be much less ambiguous
overall to just force double tildes for strikethrough like this.
This will affect a small number of past posts, in both good and bad
ways (getting rid of some strikethrough, but fixing some accidental
ones).
If you search while inside a group, it will now search only inside that
group. A note at the top of the results page will explain this, and
includes a link to search across all groups instead.
There are occasionally some data conflicts between the Embedly scraper
and the dedicated YouTube one (which uses their API). The Embedly
scraper has also recently started supplying "content" for YouTube
videos, which ends up with Tildes displaying a word count for it. That
doesn't make much sense.
Just leaving the YouTube-scraping to the API client should be fine.
Previously I've been using the built-in SASS lightness function, but
that doesn't necessarily always line up with how light we perceive a
color to be. This function seems to do a better job of matching up with
the "expected" result for a color.
Someone has been spamming the donation form to test credit card info
lately, with a bunch of $1 charges that almost all get rejected by
Stripe.
They don't seem to change IP addresses most of the time, so this should
make a little harder for them to do, anyway.
If a user tries to post a link topic that's been posted before, this
will add a warning below the form with info about the previous posts and
ask them to confirm that they want to re-post. Currently, this doesn't
have any sort of time/group/etc. restrictions and will just find
previous topics from all time.
The method for doing this is a big ugly to be able to handle both the
no-JS and with-JS posting methods, but it's not too bad.
mypy 0.720 includes a new semantic analyzer that it uses by default. It
mostly still works fine with Tildes's code, except that it doesn't
understand that @hybrid_property is very similar to @property, and it
also fixes a bug I was taking advantage of before to get mypy to not
complain about a @property that returns a different type than you set it
to.
This uses the TYPE_CHECKING constant (which is only ever true when mypy
is currently analyzing the code) to effectively replace @hybrid_property
with @property so that mypy understands it.
Uses the new pluralize macro I added to simplify/shorten other cases
where I was using {% trans %} previously.
The only exception was for "vote"/"votes" in the topic voting button,
since those are in separate HTML elements so it wouldn't work very
cleanly through the macro.
Now that the login page is set up to send users back to wherever they
were before logging in, we'll send users there with an appropriate
from_url if they try to access a page that they need to be logged in
for.
Previously, logging in would always send you to the home page. Now the
user will be sent back to whichever page they clicked the "Log in" link
from. Note that the destination is not validated, other than ensuring
that it starts with a "/" to prevent redirects to different sites.
The previous method of doing this could cause redis to try to start up
(via restart) earlier than it should. By using require_in and watch_in,
it should now only start up in the first place once this service has
been started first, and it will also cause redis to restart if it ever
needs to run again in the future.
With the current repo setup, line-endings will automatically be
converted to and from CRLF when someone is working on Windows. This is
how we want it to work, but since the line-endings are CRLF while
they're working, these checks will always throw a ton of errors. We can
safely just disable them, since everything should be fine and handled
properly already.
Vagrant on Windows has issues with creating symlinks inside shared
folders - it requires a permission that isn't granted to a user by
default. This can be fixed by changing security policies, but for our
purposes we don't need the symlinks anyway, and can run the tools
manually like this, instead of using the .bin/ symlinks.
This may need some more specific file-type definitions added, but let's
try with the absolute minimal version first, which just relies on git to
detect which files are text or binary.
Without setting any defaults, it seems to give 1024MB of memory and 2
CPUs. That low of memory can (and does) result in the VM swapping itself
to death when doing some things. I'm going to set a reasonable amount in
the Vagrantfile, and update the docs to explain how to raise/lower it if
necessary (and recommend a minimum).