This moves some of the commonly-used fixtures (creating a topic, etc.)
into a separate module, which gets included into conftest.py (so the
fixtures are available everywhere) by treating it as a "plugin".
There was some special handling of apostrophes in two string-related
functions: the one for generating url slugs, as well as the one for
doing a word count. Both of these weren't handling "curly" apostrophes
(unicode char 0x2019) properly before, so they've both been updated now.
A couple of different locations in the code were causing crashes if the
user specified ridiculously long time periods (via topic listings).
This should prevent it, or at least give a better error when it happens.
The functions that target a comment's .comment-itself div (editing,
voting, deleting) were nesting an additional .comment-itself inside it,
instead of replacing the existing one.
This detects mentions of users in comments using the same pattern as the
markdown parsing uses to generate user links. Mentioned users are sent a
notification, and mentions are added/deleted if needed on comment edits.
As part of this, setup was done to generate rabbitmq messages for
comment creation and edits, and the mentions are handled by an async
consumer of these messages.
The bottom margin on <ol> was causing some weird spacing when it's the
last element inside a block. This is most noticeable on a blockquote
where the background color extends further down than it should.
This needs some more work still to clean up a few things, but it should
be good enough for now. This allows users to see (only on their own user
page), separate "tabs" for Topics and Comments, and those separate
listings are paginated.
Previously, _sort_column wasn't set by default and needed to be set by
the query, but some of the other methods would fail if it hadn't been
set. This just defaults it to use the created_time column as the default
sort, which should always be present on models being queried by this
class (for now, at least).
This adds two new properties to PaginatedResults - .next_page_after_id
and .prev_page_before_id. These can be used when creating the links to
the before/after pages, instead of needing to access the right
element/property "manually".
This will be most useful in listings that contain items of multiple
types (such as comments and topics), since we won't necessarily know
which type the first/last elements are.
When you're posting a new topic and you fill out both the link and text
fields, it posts as a link topic with the text posted as the first
comment. Because this is done in the same database transaction, the link
and comment get exactly the same `created_time` value. Previously, the
comment was being sorted "before" the topic, which was a bit confusing
when viewing a user's profile - it would show the comment as being
posted before the topic it was posted on.
This just reverses the order that the two lists are joined in to fix
this slight oddity.
Adds a new sub-option to the "Open links in new tabs" setting which uses
javascript to find external links in the text of topics, comments, and
messages and sets them to open in new tabs.
The previous setup was a bit unusual and confusing - various functions
that restricted the query somehow were accepting None as an argument and
simply doing nothing if it was passed. This made calling them a little
simpler, but overall didn't make a lot of sense - if you don't want to
apply the restriction, you shouldn't call the function in the first
place.
Currently, the default sort+period combination is "by activity, last 3
days". This works fairly well on the home page, but isn't working well
inside individual groups because there usually aren't many posts made
yet in a specific group in the last 3 days. Because of this, going into
an individual group looks quite empty by default.
This commit changes the default *only* when inside a group to be "by
activity, all time". This will still be overridden if the user has set
up custom defaults.
This module is only being used by the breached-passwords Redis server,
which is separate. It's not relevant to any of the tests, so there's no
reason to load it.
The cleanup of old deleted comments and topics was repeatedly hitting
the same items even though they had already been cleaned up on previous
runs. This just explicitly excludes all the ones that have already had
their user_id info removed, so it will only hit ones that actually need
it.
Previously, the user menu sidebar was only available on the "base" user
page, but disappeared if you went into any of the individual pages. This
adds it to all of the pages, including highlighting the current page in
the menu.
Behavior of the "invite count" was changed slightly to save needing to
do an extra query on every page - it now only includes the number of
"un-generated" invite codes, not the number that have already been
generated but are sitting unused.
Adds two separate user settings. One only affects "external" links (the
actual links for link topics), while the other will also affect links to
comments pages (including text topics).
When on mobile, it wasn't previously possible to tell whether you had
any notifications/messages or not without opening the sidebar to check.
This adds a small "badge" to the sidebar button when the user has
notifications, showing them how many unread items they have.
Previously, an entry would be added to the topic log even if someone
didn't actually change the topic's tags at all. This commit fixes that,
as well as moving the the template fragment that renders the list into a
separate file in includes/ that can be used both for the initial render
as well as by intercooler when it updates that section of the page.
This was a bit confusing with the topic icons using a dashed blue border
for "missing icon". Now that the "already used" buttons are far more
distinct, this isn't necessary any more anyway.