Commit Graph

19150 Commits

Author SHA1 Message Date
Vaida Plankyte 1b12a9122f frontend: Redesign 4xx page. 2017-07-07 17:45:10 -07:00
Tim Abbott 780b77d84d devtools: Document portico.css issues with static/html/ files. 2017-07-07 17:30:45 -07:00
Vaida Plankyte 14865770a0 frontend: Redesign 5xx error page to be pretty. 2017-07-07 17:27:21 -07:00
Greg Price 207bf2e1fb i18n: Recognize a little more Handlebars syntax in makemessages.
Usually we write translation expressions as `{{t ... }}`, but `{{ t ... }}`
is equally valid as far as Handlebars is concerned, and it matches how we
usually write simple variable substitutions, as `{{ ... }}`.  So occasionally
someone writes `{{ t ... }}`; currently there are two examples of this
in the codebase, in `settings/bot-{settings,list-admin}.handlebars`.

Probably it'd be good to pick a style and enforce it uniformly, but
until we do, the other style shouldn't break translation.
2017-07-07 17:02:39 -07:00
Tim Abbott f2379d66a2 i18n: Fix capitalization of Zulip Botserver download code. 2017-07-07 17:02:39 -07:00
Greg Price 4b765ae304 i18n: Fix a smattering of strings that weren't getting translated.
These are some strings I spotted in English when playing around a bit
with the UI set to German, where our translations are near complete.

It'd be great to have a more systematic way of spotting this kind of
omission.  Probably a fairly simple linter could catch a lot of cases.
2017-07-07 16:59:23 -07:00
Greg Price 038a2c7692 unread_ui: Wait for i18n setup before rendering.
Without this, the "Since you were last here" text got rendered in
English for me every time when I tested in German, both in dev
and on chat.zulip.org.

This brings us to 9 places we invoke `ensure_i18n`.  That seems
like a sign that there may well be more places we're still
missing, and that we should probably find a more systematic way
to make sure all our frontend UI rendering waits for translation
to be ready.  Anyway, for now, fix this one.
2017-07-07 16:59:23 -07:00
Tim Abbott 5ee9599acd help: Link to zulipchat.com/apps to have the latest apps page.
Ideally, we'd be using {{ apps_page_url }}, but the /help/ markdown
system doesn't support custom Jinja2 content in its code.
2017-07-07 16:58:04 -07:00
Tim Abbott 3467a39cbd RateLimitFilter: Fix issues with unicode exceptions.
If you call str() on an exception with unicode characters in it, that
will itself throw an exception.
2017-07-07 16:51:04 -07:00
Umair Khan ee6e07d13f message_sender: Use response_data variable.
response_data already contains the result of ujson.loads.
2017-07-07 16:33:36 -07:00
Umair Khan 0e8231d0f1 process_queue: Recover gracefully after PostgreSQL restart.
- For threaded workers:
Django's autoreloader catches SIGQUIT(3) to reload the program. If
a process being watched by autoreloader exits with status code 3,
reloader will restart the process. To reload, we send SIGUSR1(10)
signal from consumers to a handler in process_queue which then
exits with status code 3.

- For single worker per process:
Catch the SIGUSR1 and quit; supervisorctl will restart the worker
automatically.

Fixes #5512
2017-07-07 16:33:15 -07:00
Brock Whittaker 28861c225b settings: Move streams list table filter closer to table.
The filter input was at the top of the page above a creation modal when
it should be directly above the table.
2017-07-07 16:07:58 -07:00
Brock Whittaker 7b098d77e4 settings: Change notification settings top text to tip. 2017-07-07 16:06:47 -07:00
Brock Whittaker 375b25c91f settings: Indent UI settings checkboxes. 2017-07-07 16:05:07 -07:00
Brock Whittaker 968c4e7586 settings: Change UI settings top text to tip. 2017-07-07 16:05:04 -07:00
Brock Whittaker bd664b0dd5 portico: Fix background color; remove need for bg-image classes. 2017-07-07 15:30:47 -07:00
Jack Zhang c5cdede891 portico-css: Reposition header, portico-page content, and footer. 2017-07-07 15:29:43 -07:00
Vishnu Ks 8954c0c726 management: Use Realm.objects.get instead of get_realm.
The Realm.DoesNotExist exception will never be raised if we pass a
string_id as in that case zerver.models.get_realm function would be
used for fetching. realm.zerver.models.get_realm uses filter query
so the exception will not be raised even if there are no realm which
matches the query.

Tests added by tabbott.
2017-07-07 15:02:12 -07:00
Vaida d5517bae36 Delete the old zulip.com "referrals" system.
This system hasn't been in active use for several years, and had some 
problems with it's design.  So it makes sense to just remove it to declutter
the codebase.

Fixes #5655.
2017-07-07 14:59:18 -07:00
Vishnu Ks fcd944447e common.js: Don't set default password quality/length in frontend.
The min quality/length values are always available via data
attributes. So there is no point of specefying a default value
in common.js.
2017-07-07 14:48:06 -07:00
Vishnu Ks f2e6e16fe4 account-settings: Include password length and quality data attributes. 2017-07-07 14:48:06 -07:00
Vishnu Ks 92e7255217 page_params: Include password min length and quality.
The change password form http://localhost:9991/#settings/your-account
don't have data-min-length and data-min-quality attributes. The
account_settings.handlebar which has the change password form is
rendered client side. So we have to pass the value of min length
and quality in page params to set the data-min-length and
data-min-quality attributes.
2017-07-07 14:48:06 -07:00
Vishnu Ks 81f9d5810e portico: Remove check mark from password field. 2017-07-07 14:48:06 -07:00
Vishnu Ks f273e83a85 portico: Explain why password is weak to user. 2017-07-07 14:48:06 -07:00
Vishnu Ks caf9b55cd2 register.html: Include translations bundle. 2017-07-07 14:48:06 -07:00
Tim Abbott 61f0778296 events: Use property_types framework to deduplicate code.
This cuts another block of code that we needed to add for every new user
setting.
2017-07-07 14:26:44 -07:00
Tim Abbott dbabe3fd37 add_users_to_streams: Fix check for all_users option. 2017-07-07 13:57:57 -07:00
Tim Abbott 982667acf5 management: Add new library for specifying realms.
This new library is intended to make it easy for management commands
to access a realm or a user in a realm without having to duplicate any
of the annoying parsing/extraction code.
2017-07-07 13:57:57 -07:00
Tim Abbott a9d52052f0 manage.py: Print CommandError exceptions cleanly.
Django, by default, prints these exceptions as a giant traceback,
which is really ugly and scary to sysadmins.  We really just want to
print the error message to stdout for convenient viewing by the user.
2017-07-07 13:44:14 -07:00
Tim Abbott cd4f35abdf test-backend: Don't run tests in parallel with given test files.
It's usually slower to run in parallel with a single file.
2017-07-07 13:36:03 -07:00
Tim Abbott 05c190a97c Fix new-login emails for iOS not identifying OS correctly.
Previously, we were only checking for common strings in iOS browsers,
not for the explicit string that we use with the Zulip app.
2017-07-07 13:34:25 -07:00
Tim Abbott 6eca9a1fbf docs: Update recommendations of disk requirements.
Addresses part of #5724.
2017-07-07 12:58:42 -07:00
Tim Abbott 728b852b28 logrotate: Dramatically decrease maximum size of logs.
It's rare that there's value in having the log files get this big, and
these changes mean these log files should never consume more than a
few gigabytes.

And in particular, the server.log is far more important than the other
log files, and grows much faster, so we might as well spend most of
the space we are spending on that.

I estimate that the total size of log files from this is going to be
under 1-2GB, since 75MB (compressed size) * 10 (compressed logs) +
500MB (uncompressed size) = 1.25GB from server.log, and the rest is
negligible.

Fixes part of #5724.
2017-07-07 12:58:33 -07:00
Tim Abbott 6355f26b91 supervisor: Dramatically decrease default log file max sizes.
Most of these log files are useless except a few minutes after an
event happens, and the aggregate effect of the originals size limits
meant that Zulip's logs could consume many gigabytes of disk.

The new logging strategy should limit our usage from supervisor logs
to at most 3 Gigabytes:
* 20 * 3 = 60MB per queue worker => <1GB.
* 100 * 10 = 1GB for Django and Tornado logs.

Fixes part of #5724.
2017-07-07 12:30:24 -07:00
Vaida Plankyte 6e3308a5ac frontend: Make table headers fixed.
Tweaked by tabbott to update the users list as well.

Fixes #4746.
2017-07-07 12:18:58 -07:00
Cory Lynch 75617d07de search_suggestions: Prioritize recent huddles.
Fixes #5612. What this specifically does is that if you are
typing a group PM, this logic iterates through the possible
search suggestions for the next autocomplete. If that suggestion
contains a group PM that already exists, then prioritize it with
the most recent one on top.
2017-07-07 12:12:30 -07:00
Cory Lynch 7efba29b0c search_suggestions: Hide own name in huddle suggestions. 2017-07-07 12:12:30 -07:00
Tim Abbott 761379bf9b events: Clean up unnecessary realm_mandatory_topics code. 2017-07-07 11:11:44 -07:00
neiljp (Neil Pilgrim) f1a8148242 mypy: Set remote_username parameter to Optional[Text] based on a test. 2017-07-07 10:56:33 -07:00
neiljp (Neil Pilgrim) a84d7b8581 mypy: Specify type of 'user_profile = None' as Optional[UserProfile]. 2017-07-07 10:56:33 -07:00
neiljp (Neil Pilgrim) 0958298d88 mypy: Add missing type parameter in test_upload.py:create_user. 2017-07-07 10:56:33 -07:00
neiljp (Neil Pilgrim) 6cb3a2ab1a mypy: Move type annotation in jira/view.py before general comments. 2017-07-07 10:56:33 -07:00
neiljp (Neil Pilgrim) db0b985e82 mypy: Use specific kwargs types. 2017-07-07 10:56:33 -07:00
Tim Abbott d6e0960ca2 push_notifications: Fix mypy annotation logic around push tokens.
I'm not 100% confident this is long-term correct, but at least it's
consistent.
2017-07-07 10:54:37 -07:00
Tim Abbott 919c610abf capitalization: Add APNS to list of valid acronyms. 2017-07-07 10:43:02 -07:00
Vishnu Ks c5f75a8f3d test_classes: Remove client_put_multipart function.
We are no longer using this method anywhere. Removing this
is essential for making the backend coverage tests to pass.
2017-07-07 10:31:43 -07:00
Vishnu Ks 9067890120 urls: Use POST for zerver.views.user_settings.set_avatar_backend.
The set_avatar_backend is changed from PUT to POST becuase this
is not idempotent.
2017-07-07 10:31:43 -07:00
Vishnu Ks df5df76961 urls: Use POST for zerver.views.realm_emoji.upload_emoji.
The upload_emoji endpoint is changed from PUT to POST because
this endpoint is not idempotent.
2017-07-07 10:31:43 -07:00
Vishnu Ks cf2dec539f urls: Use POST for zerver.views.realm_icon.upload_icon.
This upload_icon endpoint is changed from PUT to POST becuase
this endpoint is not idempotent.
2017-07-07 10:31:43 -07:00
Tim Abbott 0606ba88df push_notifications: Verify that token types are valid.
We only have two types of push notification tokens, so we should
validate that in the bouncer code path.
2017-07-07 10:28:36 -07:00