Commit Graph

23172 Commits

Author SHA1 Message Date
Brock Whittaker 625c163ba0 dark-mode: Convert medium grey to translucent base color.
This changes the message time from a medium grey to something that is
translucent base color instead.
2017-11-30 14:40:27 -08:00
Brock Whittaker b2194e860b message-feed: Reduce animation time for date.
This reduces the animation time for the message date to about half.
2017-11-30 14:40:27 -08:00
Brock Whittaker 80b68c3e2b message-edit-history: Increase font weight of author.
This increases the font weight of the author to be a normal font weight
rather than a thin one since it’s already too faint to see on many
monitors.
2017-11-30 14:40:27 -08:00
Brock Whittaker 7883897165 muted-topics: Enable dark mode for mute notifications.
This enables dark mode by changing the background to a dark color
in the stream/topic mute notifications.
2017-11-30 14:40:27 -08:00
Brock Whittaker afce6b18bf muting: Change muting overlay to use standard buttons.
This changes the overlay “Unmute” button to use the default `.button`
style.
2017-11-30 14:40:27 -08:00
Brock Whittaker bc11b0f1e8 Revert "dark-mode: Remove unnecessary CSS and fix dark mode bugs."
This reverts commit 64381b6e38.

It turns out we actually needed this for inline code blocks to work.
2017-11-30 14:40:19 -08:00
Brock Whittaker 30475ba4c4 Sidebars: Add border radius to hovered <li>.
This adds a border radius the the <li> to make the selections and
hover areas look a bit more polished and clean.
2017-11-30 14:34:31 -08:00
Tim Abbott e50f036a99 travis: Remove all travis sources.list files early.
This fixes most of the current Travis CI failures, and should help
prevent future ones from cropping up, since we're just deleting Travis
CI's giant library of apt sources up front.

The production build is still failing, since apparently some of the
packages we were doing `apt-mark hold` on no longer exist.
2017-11-30 14:19:47 -08:00
Rohitt Vashishtha 10618157a2 typeahead: Refactor typeahead tests to include cursor position. 2017-11-30 13:23:46 -08:00
synicalsyntax 6e353a0550 hotkeys: Clear compose box warnings with escape key.
Fixes #7531.
2017-11-30 11:55:50 -08:00
cPhost 6e5dab6a1e node tests: Cover set_compose_defaults. 2017-11-30 06:25:36 -08:00
Brock Whittaker e0236646bf night-mode: Add custom CSS through JS.
This adds custom CSS through JavaScript for things that do not
scope well and will override other inherited styles.

This should ONLY be used for problematic CSS that has no obvious
or easy CSS-only solution.

(Specifically, we need this for the "default link" styling, which is
hard to override because we don't want to start winning ties due to
specificity that we would not have won in the light theme).
2017-11-29 23:06:11 -08:00
Tim Abbott 6d887dc6ee test-backend: Require 100% test coverage on confirmation code. 2017-11-29 22:20:06 -08:00
Rishi Gupta 7d1c88f0fb invitations: Limit realms to 100 invites per day.
To guard against using zulip invites as a vector for spam. Stopgap measure
until we figure out something better.
2017-11-29 22:18:05 -08:00
Rishi Gupta 8dc0adbed8 confirmation: Add Confirmation.realm. 2017-11-29 22:18:05 -08:00
Rishi Gupta 93abac7952 confirmation: Fix mypy annotation in create_confirmation_link. 2017-11-29 22:18:05 -08:00
Rishi Gupta 7c9694077e confirmation: Move check_prereg_key_and_redirect to registration.py. 2017-11-29 22:18:05 -08:00
Tim Abbott 6e8f4ffc77 test_signup: Expand tests for invalid confirmation links.
We'll need the expanded test coverage when we move
check_prereg_key_and_redirect to zerver/views/registration.py to avoid
test failures, and these are also tests we should really have anyway.
2017-11-29 22:18:05 -08:00
Rishi Gupta 3675d97870 confirmation: Refactor views.confirm to be clearer.
Also gives more appropriate error messages for expired user_registration and
invitation links.
2017-11-29 22:03:09 -08:00
Rishi Gupta 331a9bee6b confirmation: Add Confirmation.REALM_CREATION.
Does not change any behavior. Groundwork for adding a realm field to
Confirmation.
2017-11-29 22:03:09 -08:00
Rishi Gupta 0f5c0ea92b confirmation: Add comment explaining RealmCreationKey. 2017-11-29 22:03:09 -08:00
Rishi Gupta dc244bd27e confirmation: Fix time enforcement in check_key_is_valid.
The previous code gave the user an extra day past
REALM_CREATION_LINK_VALIDITY_DAYS. Also rewrote it to match the parallel
logic in get_object_from_key.
2017-11-29 22:03:09 -08:00
Greg Price 4926228071 rabbitmq: Do a better job of retrying failed connections.
Empirically, the retry in `_on_connection_closed` didn't actually work
-- if a reconnect failed, that was it, and the exception handler
didn't get run.  A traceback would get logged, but all its frames were
in Tornado or Pika, not our own code; presumably something magic and
async was happening to the exception.

Moreover, though we would make one attempt to reconnect if we had a
connection that got closed, we didn't have any form of retry if the
original attempt at connecting failed in the first place.

Happily, upstream offers a perfectly reasonable bit of API that avoids
both of these problems: the on-open-error callback.  So use that.
2017-11-29 16:56:29 -08:00
Greg Price 7ac2b58584 rabbitmq: Reorder a bit to group our reconnect logic together. 2017-11-29 16:56:29 -08:00
Greg Price c32b16715d tornado: Use spiffy new `call_later` rather than `add_timeout`.
This method was new in Tornado 4.0.  It saves us from having to get
the time ourselves and do the arithmetic -- which not only makes the
code a bit shorter, but also easier to get right.  Tornado docs (see
http://www.tornadoweb.org/en/stable/ioloop.html) say we should have
been getting the time from `ioloop.time()` rather than hardcoding
`time.time()`, because the loop could e.g. be running on the
`time.monotonic()` clock.
2017-11-29 16:56:29 -08:00
Greg Price 73886f57d2 zerver/lib/queue: Clean up import order. 2017-11-29 16:56:29 -08:00
Greg Price 3c4e4c14c9 rabbitmq: Add on-close callback atomically in creating the connection.
Adding it afterward is inherently racy, and upstream's API is quite
reasonable for avoiding that -- just like we can pass an on-open
callback up front, we can do the same with the on-close callback.

This is a more thorough version of 4adf2d5c2 from back in 2013-04.
2017-11-29 16:56:29 -08:00
Greg Price e88c2a7ee4 rabbitmq: Cut redundant `stop_ioloop_on_close` parameter.
The default value of this parameter is already False upstream.
(It was already False in pika version 0.9.6, which we were
supposedly using when we introduced this in 4baeaaa52; not sure
what the story was there.)
2017-11-29 16:56:29 -08:00
Brock Whittaker e7ec21b4cf dark-mode: Add pigments support for dark mode.
This adds support for dark mode pygments that are good syntax
highlighting colors to be seen on a dark background.
2017-11-29 16:44:43 -08:00
Brock Whittaker a7c2258e12 dark-mode: Change drafts container to be dark.
This changes the drafts container to be dark.
2017-11-29 16:44:43 -08:00
Brock Whittaker 387bdd34c7 dark-mode: Change top-of-messages colors for dark mode.
Make it a white background with the “Z” in the same dark grey/blue
color as the background.
2017-11-29 16:44:43 -08:00
Brock Whittaker d883f3308c dark-mode: Refactor top-of-messages logo to have CSS styles.
This changes the fill and stroke styles to be in CSS rather than
inlined in the SVG, making it easier to change and override elsewhere.
2017-11-29 16:44:43 -08:00
Brock Whittaker a2729c52d0 dark-mode: Fix incorrect hover colors on `.stream_label`.
The headers on some dark stream labels would turn dark and and on some
light turn light. This makes sure that does not happen.
2017-11-29 16:44:43 -08:00
Brock Whittaker 6d8d5f7e95 invite-users: Change buttons to new style.
Some of the buttons in the footer are still the `.btn` class, so these
have been converted to the `.button` class.
2017-11-29 16:44:43 -08:00
Brock Whittaker 618455c7aa dark-mode: Fix invite overlay to have a dark background and borders.
This changes the modal background to be dark and changes the header
border to be darker instead of lighter like the subs and settings ones
are.
2017-11-29 16:44:43 -08:00
Brock Whittaker 836bfd8f45 dark-mode: Refactor gear-menu icon to be translucent.
This makes the gear-menu icon translucent rather than medium grey and
black (which isn't even our base text color) to be half opaque (approx)
and base text color.
2017-11-29 16:44:43 -08:00
Brock Whittaker e37838c926 dark-mode: Refactor compose icons to be translucent.
This makes the compose icons translucent rather than medium grey
and black (which isn't even our base text color) to be half opaque
(approx) and base text color.
2017-11-29 16:44:43 -08:00
Brock Whittaker edffa56c51 dark-mode: Style alerts to be darker red.
This styles the alerts to be a darker red that blends more with the
blue dark mode theme.
2017-11-29 16:44:43 -08:00
Brock Whittaker 89b38ff87d dark-mode: Change all links to be brighter blue on hover.
This changes the links to become more emphasized by being brighter
rather than darker since they’re on a dark background.
2017-11-29 16:44:43 -08:00
Brock Whittaker 76f6051a1e dark-mode: Change popover arrows to all be dark.
This changes the position-based arrows on popovers to all be dark
rather than light grey.
2017-11-29 16:44:43 -08:00
Brock Whittaker ad9c71b4b1 dark-mode: Change emoji reaction overlay to be dark mode compatible.
This changes it to be compatible with the dark-mode which involves one
change to light mode of changing a grey to a translucent white in
reactions.css.
2017-11-29 16:44:42 -08:00
Brock Whittaker 1716d69c35 dark-mode: Fix @-mention colors.
This fixes mention colors for dark mode.
2017-11-29 16:44:42 -08:00
Tim Abbott 377cad7dc2 css: Deduplicate user-group-mention CSS.
These CSS rules were identical before, anyway.
2017-11-29 16:43:46 -08:00
Brock Whittaker e62ba13887 dark-mode: Change `background-image` and `background-color` to background.
There isn’t any reason for either of these mention code paths to be
using specified background types, so convert them all to background so
inheritance is more simple.
2017-11-29 16:42:07 -08:00
Brock Whittaker 1e03c15758 settings_display: Change dev check to correct attribute.
For setting the night mode, it checks to see if you’re in development
by checking `page_params.development`, but the actual attribute is
`page_params.development_environment`.
2017-11-29 16:40:18 -08:00
Brock Whittaker 64381b6e38 dark-mode: Remove unnecessary CSS and fix dark mode bugs. 2017-11-29 16:40:18 -08:00
Tim Abbott be832387c5 user_groups: Fix reporting of empty user groups.
Previously, we weren't doing a proper left join in
user_groups_in_realm_serialized, resulting in empty user groups being
excluded from the query.  We want to leave decisions about excluding
empty user groups to the UI layer, so we include these here.
2017-11-29 16:13:55 -08:00
Rohitt Vashishtha 621d5dc9df typeahead: Show typeahead only if cursor is before space or punctiation.
This solves the issue with typeahead appearing in the middle of an
already-completed typeahead word.

Example: Earlier, '@ran|dom' would also trigger the typeahead and show
'random', but selecting it would turn it into '@**random** dom'.

We still have a problem to solve of preventing typeahead from
appearing on a space in the middle of an already-completed typeahead
word, but that is its own independent bug.
2017-11-29 14:53:14 -08:00
Greg Price fe979af822 purge_queue: Allow purging Tornado-consumed queues.
These are the exceptions to the rule that our queues correspond to
queue-processor workers.

Purging `notify_tornado` in particular is a useful workaround right
now for some error spew in the dev environment.
2017-11-29 14:44:53 -08:00
Tim Abbott b2cb443d24 subs: Fix clearing unread counts when leaving private streams.
Because we use access_stream_by_id here, and that checks for an active
subscription to interact with a private stream, this didn't work.

The correct fix to add an option to active_stream_by_id to accept an
argument indicating whether we need an active subscription; for this
use case, we definitely do not.
2017-11-29 14:40:08 -08:00