Commit Graph

4123 Commits

Author SHA1 Message Date
Steve Howell 1b1f80f3d7 Show "Home" less often as a search suggestion.
We now only suggest "Home" if you have an empty search box (suggestion #1),
or if you are typing "Home".  Before we'd show it as a way to get back
from various narrows.  This is trac #1596.

(imported from commit 9228bf45e9aaf9912d83efdf70338abb4b7e054f)
2013-08-05 15:56:12 -04:00
Jessica McKellar ae691427ca Add a bulk_change_user_name management command.
(imported from commit 2d32d63e0214de262978444e8883b0276840ee98)
2013-08-05 10:56:06 -04:00
Jessica McKellar d1ec806d3e Move the backend restriction on CUSTOMER4 name changes to json_change_settings.
That way do_change_full_name can still be used on CUSTOMER4
students internally.

(imported from commit dd8ba92372b85511d39e7dfb368d5f8c559f0652)
2013-08-05 10:56:06 -04:00
Jessica McKellar c95a762e2f Don't let CUSTOMER4 users change their names through the JSON API.
(imported from commit ea1f26866e727eff995f78f1f0aeb6bb82b1b997)
2013-08-04 22:03:09 -04:00
Jessica McKellar 118a2075d9 Allow anyone to register for the CUSTOMER3 realm through a special URL.
(imported from commit 8857d0217893f51fdba6585aea2fa79270161beb)
2013-08-04 19:55:00 -04:00
Jessica McKellar 5b8e73e51c [schema] Add a realm field to zephyr_preregistrationuser.
(imported from commit 91735d99ffb00af2aa1895cb3c3aaba11efa8ff5)
2013-08-04 19:54:59 -04:00
Steve Howell b291037f5d (tests) Remove jQuery stubs in search_suggestion.js.
(imported from commit a9b9bb86ed6aee96443cbfef5171f93dc9a0fa51)
2013-08-02 17:28:03 -04:00
Steve Howell 3726b86a94 (tests) Rename search.js -> search_suggestion.js
This follows up on extracting code to js/search_suggestion.js, and all
the search tests apply to the new module.

(imported from commit dec6c8614c25b4f82da57edeaddc7cfef28260a5)
2013-08-02 17:28:03 -04:00
Steve Howell b33858dd70 Created search_suggestion.js.
Moved 400+ lines out of search.js into search_suggestion.js.  This
leaves search.js primarily responsible for lots of little DOM
interactions, whereas search_suggestion is more about data.

(imported from commit 53d08b29367c0172e483064f213538d45098279e)
2013-08-02 17:28:03 -04:00
Steve Howell c6aeeafe1d Added test coverage for search suggestion descriptions.
(imported from commit 1693ad7343106deab0c8f2838088d27b407e39eb)
2013-08-02 17:28:03 -04:00
Steve Howell 95102dc1bd Refactor search_suggestions.js.
1. Change code comment in search.get_suggestion.

2. Remove side effects from search.get_suggestions.

The function get_suggestions() was updating a module-scoped variable
called search_object, but now it returns a dictionary to its caller.

3. Greatly reduce the scope of the search_object var in search.js.

I also clarified the comment around it a bit. We could squeeze
the scope of search_object even further by using a function wrapper, but
this is a big enough win for now.

(imported from commit 4b633dd30ab45d24b85ea1d10df27df5aaa0c959)
2013-08-02 17:28:03 -04:00
Steve Howell 6b9b33f769 Use PATCH again for patching bots.
This reverts a prior commit, but the earlier commit is fine
functionally; the earlier commit was a temporary measure.

Revert "Use POST, not PATCH, for patching bots."

This reverts commit c3146b23d5d7d134c2b80507eb87033ca375a4db.

(imported from commit ebfcb2bae72c11767f9750412440d40b7a2a4995)
2013-08-02 11:46:11 -04:00
Steve Howell 2b28cf9a0a Support request.FILES in process_as_post.
(imported from commit 646019b5efe4ae3f6f66f99f76f2036d9fd9ec8e)
2013-08-02 11:46:11 -04:00
Steve Howell 2442edee9e Add the "static" directory to NODE_PATH for unit tests.
I added our "static" directory to NODE_PATH for our JS unit tests.
This eliminates most of the verbosity in our require statements, but
it still requires us to explicitly call out "js" or "third"
subdirectories, which should make it a bit easier for folks reading
the tests to distinguish modules from js, third, or node itself.

(imported from commit b77a5283135d388d46f4b7e511acc59986f1a8ba)
2013-08-01 17:58:25 -04:00
Steve Howell 44e59dfaea Quiet Tornado's polling instrumentation in dev.
In dev, only show the message "Tornado X% busy over the past Y seconds"
if we've been more than 20% busy.

(imported from commit 2775e6151ccf03ba0cb2a1f96e4f4839774a870f)
2013-08-01 17:18:07 -04:00
Tim Abbott b317f0899b Add a management command to render all old messages.
I'd like to minimize the probability that we'll actually run the code
in the "messages not rendered yet in database" codepath since it might
perform poorly, and it seems like the best way to do that is to just
run a loop that renders them all.

(imported from commit 247cb85fffa6cbc95958b9feda97462792a542c2)
2013-08-01 14:41:25 -04:00
Tim Abbott 70a7e90646 zephyr_mirror: Disable most markdown patterns for mirrored messages.
(imported from commit 09bfa2583ec037b78bcb12c44ca78d213ba5d102)
2013-08-01 14:10:28 -04:00
Tim Abbott 802b3dc3b2 Add API endpoint to render some message content without sending a message.
(imported from commit e1604b3bf4fc65e958db22f280eba1b5d2ba1e90)
2013-08-01 14:01:58 -04:00
Tim Abbott 365db42a6e Return a proper JSON error on HTTP authorization errors.
(imported from commit da0249b4e8585d8adbd9c769e3ba85dc4b9d28de)
2013-08-01 14:01:58 -04:00
Zev Benjamin 39a44cc661 Fix migration 36
It was not regenerated after being rebased.

(imported from commit b4555b05813201943f5991552dd4a0d53f7ae005)
2013-08-01 11:26:33 -04:00
Steve Howell f7ca0117e6 Allow users to upload new avatars for their bots.
(imported from commit 9d7895a658740815f454c8bba400d7cff821b7f9)
2013-08-01 11:05:40 -04:00
Steve Howell ab23c534b9 Use POST, not PATCH, for patching bots.
This is a temporary expedient measure to work around our
PATCH not supporting file uploads in our current Django setup.

(imported from commit c3146b23d5d7d134c2b80507eb87033ca375a4db)
2013-08-01 11:05:39 -04:00
Tim Abbott 7803cadd66 Prevent realm_filters from breaking apart Markdown links.
E.g. if the Zulip realm, if you ever put "#15" in a Markdown link, you
surely don't want it to be auto-replaced with a Trac link.

(imported from commit 2e117a7bbbd9c82f8c0ba4d390472770f4425589)
2013-08-01 10:48:11 -04:00
Zev Benjamin 905354f7a1 For mit.edu, include .d instances in narrowed views
(imported from commit 502b36d1a62f3f8f7b956c701fd10f580e1927d7)
2013-07-31 18:30:28 -04:00
Zev Benjamin a637fadd18 Fix regexes for MIT narrows that include un- and -.d streams
The previous regex didn't escape the period in '.d' and was doing a
case-sensitive match to find the base stream name.

(imported from commit 43ef13733987e50dcead06b7bd3e768cb4395998)
2013-07-31 18:30:28 -04:00
Waseem Daher a563776978 Don't Trac-linkify #1 - #9.
If you really want to link to those tickets, tough.

(imported from commit 54fccbe793662fade2b8f0f53d3f0e6cfa997398)
2013-07-31 16:32:08 -04:00
Tim Abbott d6acd8fce9 Add support for narrowing to a single message ID.
This is mostly useful for sending someone a link to a single Humbug
message.

(imported from commit b0994a2bf503c84690b13ce89bbcf5bab829bf0c)
2013-07-31 14:59:05 -04:00
Tim Abbott ed6f5ac470 Fix time travel by adding new near: operator.
(imported from commit 727a68016090164b586cbe59e692676a00e8cd3a)
2013-07-31 14:59:01 -04:00
Zev Benjamin 394deb4a72 Remove stray debugging 'print' statement
(imported from commit 261b3b6ee93ec596a1a971494761d92e7c27891d)
2013-07-30 18:29:33 -04:00
Zev Benjamin a3a1e8f351 [schema] Update our full text search vector and index asynchronously
We now write the fact that a message was created or updated to a log
table and actually update the tsvector asynchronously from a worker
process.

This also means that when running locally, one now needs to run the
process_fts_updates script in order to have new messages indexed for
full text search.

(imported from commit ebb11b08d30be2a45242dafe146e8e861a0f050a)
2013-07-30 18:13:05 -04:00
Tim Abbott d05ddce624 Remove unused client_id argument to get_updates/messages.
Note that it's still handed out by get_profile since the Android app
expects it.

(imported from commit dc7222449192bff363399d1a5f01652988b3f475)
2013-07-30 17:59:46 -04:00
Tim Abbott ba20221df8 Fix whitespace in request_event_queue.
(imported from commit ee9c63a25db765a4b879e6047a27027ae69ebacb)
2013-07-30 17:59:46 -04:00
Tim Abbott 53e06a0bb5 Use rest_dispatch for accessing Tornado URLs.
(imported from commit f129f5e3dc9e83f40fa9ea1b95d97a9b9f5a6831)
2013-07-30 17:59:46 -04:00
Tim Abbott eff18f46eb Refactor apply_markdown code to avoid nested @has_request_variables.
(imported from commit ad331bd62b8b576167f30aa49a7a85c90f057e65)
2013-07-30 17:59:46 -04:00
Scott Feeney ec58dcfa4e Add missing newline to unminified stacktrace output
(imported from commit 6abc3d1aced29de546a890b40fdbe486c6e80aed)
2013-07-30 17:59:10 -04:00
Scott Feeney c5045b64f2 Generate API keys in a more secure way
The documentation for the Python `random` module explains that it "is
completely unsuitable for cryptographic purposes." This new way of
generating API keys replaces use of the random module with
`os.urandom()`, which is intended to be suitable for such uses. As a
bonus, the code is simpler and clearer.

(imported from commit cc3697a5048f2da53f0fce6689167f9d1cbb6466)
2013-07-30 13:54:50 -04:00
Steve Howell d82ccb6243 rename tests
(imported from commit cd98a86a5e07765f753ac1904e45ccd1213d6d67)
2013-07-30 09:05:49 -04:00
Steve Howell 998a22eabb Created test_search.js. (unit tests for search.js)
(imported from commit 8127c04ccc68a9ac106e5684a7ea9a621cb1831f)
2013-07-30 08:55:44 -04:00
Leo Franchi 4b94b99c17 Send recipient id also for PMs
(imported from commit 704f604cc10cc3205420af6dca1e093ec15c3874)
2013-07-29 16:13:57 -04:00
Leo Franchi e0374cf761 Add sender_id to sent messages
(imported from commit 5ed87152143fbc2c5936ee3903b6dbef4f1c9e32)
2013-07-29 15:26:47 -04:00
Scott Feeney 85ce86c4fd "Already using Humbug" -> "Already using Zulip"
(imported from commit e05812ed3bae64f9daa7d60a7d5b2404edb306fc)
2013-07-29 14:53:16 -04:00
Scott Feeney 9e2e857a88 Fix narrow test calling .then() in a callback
As Kevin points out, un_narrow() itself calls casper.then() so should be
called outside of a callback, not inside one.

(imported from commit c5f02a14c750045697558aeafb070227e3a9d24c)
2013-07-29 14:51:40 -04:00
Scott Feeney c2ce181203 Fix race conditions in 02-narrow.js tests
(imported from commit 6a4b22992c35cdebc86194282d6a348ee9c4b810)
2013-07-29 14:51:40 -04:00
Steve Howell a004a15ff5 [important] Fix paths related to recent zephyr/static changes.
This fixes the previous commit to master.

(imported from commit 43637dcf0832a4e91de9fd98ebb777c77a3eee19)
2013-07-29 14:02:20 -04:00
Steve Howell 46c4a6a9b3 Add unit test coverage to unread.js.
This covers most of the module's functionality, with special
emphasis on lines that use underscore.js (_.each and _.filter).

(imported from commit 074181a0273286a258504be634bdd1cead2eecd5)
2013-07-29 13:47:57 -04:00
Steve Howell 09bd52fff4 [third] Add underscore.js
(imported from commit ee17cc1d1dff2a6f816a81bb33fa04ca5562a441)
2013-07-29 13:47:56 -04:00
Tim Abbott 3bba0cc927 Move zephyr/static to just static.
It's not really a part of the server (aka the rest of zephyr/).

(imported from commit 27f6b6b064938ad927075a68d873e4b68710d279)
2013-07-29 12:11:26 -04:00
Tim Abbott ffc2f05cbb Rename zephyr.css to zulip.css.
(imported from commit 094580c1563fa05ecff58d6fb86bf2338a32b1a6)
2013-07-29 12:10:54 -04:00
Steve Howell a9da6e28e7 Made minor changes to test_message_tour.js
I added a comment at the top, and I made it run the test
more automatically.

(imported from commit db6e382d766d0cc35eed28d589608645253f23e8)
2013-07-29 10:28:14 -04:00
Waseem Daher b6d2682abf Remove inelegant gear menu hack.
Rather than play elaborate games to strip off the 'active' class, we
just neutralize it by making it the exact same as the inactive class.

(imported from commit d26a02ca0edef6ee86affa2fa5daee0426eb5f8a)
2013-07-26 18:37:07 -04:00