Commit Graph

364 Commits

Author SHA1 Message Date
Keegan McAllister f47b88ccc8 Don't take up space with the hidden username span
(imported from commit 9ae4953a583947c259a20ce5f7c25c0216b2cc51)
2012-09-12 16:24:42 -04:00
Keegan McAllister 714eec5594 Select zephyr rows by class
This fixes the bug where the reply box is hidden when narrowed.

(imported from commit 0673b9063818946b7da70f6109ca17403240737d)
2012-09-12 11:47:56 -04:00
Waseem Daher 3f42c8422f Experimentally add a search bar.
I'm not exactly sure that this is the interface we'll want for
this, but it's the start of an experiment.

(imported from commit ea18a9b05106546475bc151229955ddafd8e7b8e)
2012-09-12 11:19:33 -04:00
Waseem Daher 85398abba3 My take on a prettier pointer.
(imported from commit 7d0c37c85781bdd48efb4cf9cec49bb6df7f0954)
2012-09-11 17:38:05 -04:00
Jessica McKellar f5c4bb7ab2 tests: Add new registration fields to registration tests.
(imported from commit c666e0cf89aaed357bb5bea6f9fbaafc5efffa7c)
2012-09-11 17:26:13 -04:00
Keegan McAllister 5090a3fb91 zephyr_mirror: urlencode Unicode properly
(imported from commit 74d58039e4b763a2738bb485ab9ba6aa9c802d92)
2012-09-11 17:17:17 -04:00
Waseem Daher 9a7993a954 Cause class and instance names not to wrap.
This looks ugly, uglier than the alternative, but I want
to encourage us to figure out how to deal with this case
rather than allowing it to wrap.

(imported from commit 9ef9cedeca2e27a0db996083e2e528f3daec3f43)
2012-09-11 16:57:03 -04:00
Waseem Daher 5ca1ac55d6 Make classes and instances always take up 100px.
Setting both max-width and min-width really feels like
a hack -- surely I can just set "width" and be done
with it?

(imported from commit 7650419c5ae8bb7ce3a3d6bd7dabbfb42390586f)
2012-09-11 16:53:30 -04:00
Jessica McKellar a211314240 Add dummy name data for forged zephyr users.
(imported from commit cec8beefe97bc0acbd22a170d41233d4fc642cc6)
2012-09-11 16:39:37 -04:00
Jessica McKellar f5e8f025b7 Bring back preparing a personal when you click on a user.
(imported from commit b9081cb77dafa590605ee3a0892b359cc7ac6d06)
2012-09-11 16:35:01 -04:00
Jessica McKellar 49af4ec000 Don't hide the New Message button when you click on it.
It's not part of the original WaseemUI scheme, and it doesn't ever
reappear.

(imported from commit 3417fae31fc8d1b87d0d8b463548c24f5c2d260c)
2012-09-11 16:35:01 -04:00
Jessica McKellar f52ec24926 For now, compose zephyrs to usernames.
We'll eventually need to normalize emails, autocompleted names,
etc. to one entity we use when talking to the server about senders and
personals recipients, but for now since we've hardcoded usernames
everywhere, just use those.

(imported from commit 4a0e033b301b8dec55d97157eb4993982f6b2641)
2012-09-11 16:35:01 -04:00
Jessica McKellar e60959ab64 populate_db: give users full names.
(imported from commit db78a76d983dab077dfb105431e549b46e4c60d8)
2012-09-11 16:35:00 -04:00
Jessica McKellar bfdf2bef57 [schema] Collect and display names and e-mail addresses.
(imported from commit aa6bceb05fcd5b456c03288cbfed65b14050fe88)
2012-09-11 16:34:53 -04:00
Jessica McKellar 06711afa51 Add a block of whitespace at the bottom of the zephyr feed.
That way you can see new zephyrs as they come in.

(imported from commit 6b72a7f2116130edc0444f601423453801ddb6b5)
2012-09-11 16:27:12 -04:00
Waseem Daher cca0e8f521 Restyle narrowbar slightly.
I have some serious concerns with this implementation,
but I think it's still an incremental improvement.

(imported from commit 6ed8d2545c727e25bf85b98a1528dbf3d155bc92)
2012-09-11 16:20:16 -04:00
Keegan McAllister b4103798f5 Speed up narrowing
(imported from commit e1f06866ebc7d3dae3a5813565002853a6f6d8ba)
2012-09-11 15:37:09 -04:00
Luke Faraone 34a7ad5be0 Revert "Collapse duplicate instance names, add breaks."
This reverts commit 8c47682cd80fec0d221a519abc593f4d83dc90b5.

I accidentally broke.. a lot of things in my last commit. Lets fix those
issues before pushing to master again.

(imported from commit fbadd6e854722e41cccd2535748ee47f4efd657b)
2012-09-11 15:19:51 -04:00
Keegan McAllister a5d105dbae Move styles out of index.html
(imported from commit 8b3732ff67af71dac49886004370b6d4759b140f)
2012-09-11 14:38:33 -04:00
Keegan McAllister 75c34a7f1b Fix a bunch of code style problems
(imported from commit 473ae8fdd64783f7a0989b17cae39826de42d30d)
2012-09-11 14:38:33 -04:00
Luke Faraone c5238e4af5 Collapse duplicate instance names, add breaks.
(imported from commit 8c47682cd80fec0d221a519abc593f4d83dc90b5)
2012-09-11 14:37:24 -04:00
Keegan McAllister 00e3f9d948 Right-align zephyr table within its div
(imported from commit 59365d0ef466bf08fe1cf9ddcac5558579962c84)
2012-09-11 13:46:47 -04:00
Keegan McAllister 94325e63e6 zephyr_mirror: Keep going on exceptions
(imported from commit 606a864e106a2353c7e439ac9c23b14bddd6e94f)
2012-09-11 13:28:44 -04:00
Keegan McAllister a4cf0164ca zephyr_mirror: Unwrap lines using a regex
(imported from commit f882547b79ac2c92ff010d597f28437a4ead8fe5)
2012-09-11 13:25:37 -04:00
Keegan McAllister 8b1b5ddbdb Hide horizontal scrollbar
(imported from commit 5510657c7adfb189e1a332c8f6f2eab9840a8080)
2012-09-11 13:08:18 -04:00
Keegan McAllister bcdfafb37f Tweak class/instance display, esp. for long names
(imported from commit e8b73f2f772e18ea72fbbfb68107659d0b9adb8c)
2012-09-11 13:06:07 -04:00
Keegan McAllister 84cfca1ea0 Shrink messagebox further
(imported from commit 4184f19aec54b764bc205bef067426d90e67d843)
2012-09-11 12:48:57 -04:00
Luke Faraone 34b594b96b Reimplement the narrow bar.
(imported from commit 19e41c1238dff404813a21b9dc318458d5f29c64)
2012-09-11 12:12:02 -04:00
Keegan McAllister 65c6f2dfcb Set messagebox max-width as well
(imported from commit 0ada0fcabf23f38caf7b7cfa7173cc9822d2eefb)
2012-09-11 12:05:28 -04:00
Keegan McAllister e5ac53674a Use fixed table layout
(imported from commit 12eb4882b03e6cf4b633334481a82da70b868ce1)
2012-09-11 11:56:34 -04:00
Keegan McAllister 1c539ac828 Fit compose box to zephyr list
(imported from commit 7b17e637b14ec5b97a890d4c16422259adec8c4c)
2012-09-11 11:51:28 -04:00
Keegan McAllister 7da13a873e Fix size of messagebox
(imported from commit ea236a85cf8a5556242cce79d1911a3744fdf7b4)
2012-09-11 11:49:33 -04:00
Keegan McAllister 8db9a7c1d6 Adjust hover color to match Bootstrap
(imported from commit f43a9d07ce027932e4a22d2fb9efe7711883f318)
2012-09-11 11:49:13 -04:00
Keegan McAllister ad27472b05 Indicate clickable labels
(imported from commit aebd6171bbe45d8e8055ca22526ab919b6e348e1)
2012-09-11 11:32:04 -04:00
Keegan McAllister c32081a366 Make the whole messagebox clickable
(imported from commit 55b4970842e94b35cc138a4a5107ec32e08bac8c)
2012-09-11 11:24:38 -04:00
Keegan McAllister 8440fdd838 Use a fixed width Zephyr list
This is about the same size as Twitter.

(imported from commit b171b0202dfaaf14c535824a4bc2df06d18a1e51)
2012-09-11 11:16:32 -04:00
Luke Faraone 1da8c16367 Make "new message" open the compose window.
(imported from commit d63f4915f884dfa2bc11653d17782e5ee4c6191e)
2012-09-11 10:54:25 -04:00
Tim Abbott de0255d651 zephyr_mirror: Hack to try to eliminate fixed withs of zephyrs.
(imported from commit 58a26863e77d4bbfca3f7b488c008b7e6a4804f3)
2012-09-11 10:50:48 -04:00
Tim Abbott a983276b16 Add support for populate_db adding to the existing messages.
(imported from commit 765243923c67ff4820b4cd873764a5e8172cf177)
2012-09-11 10:50:48 -04:00
Luke Faraone 4503aaae89 Implement gravatars.
(imported from commit 1e07d295ee7c12a95091e0785a9a9c3c4e856ede)
2012-09-10 18:18:09 -04:00
Waseem Daher 0958e380d0 ...but add the padding only on the top.
(imported from commit 2459b639d40aaac44d71a8f754481f90348e72ac)
2012-09-10 15:16:17 -04:00
Waseem Daher f847931dbd ...but add padding so it lines up.
(imported from commit 5d174cd0c72233702dc1681e0118f2da4bb912f2)
2012-09-10 15:14:46 -04:00
Waseem Daher e1b7efe988 Vertically align the pointer.
(imported from commit 5ba1586eb1576439b4f0665cf85ba1f59a197c23)
2012-09-10 15:14:01 -04:00
Waseem Daher 7c10832118 Restyle zephyr window slightly.
Eliminate huge left margin, and don't let long class or instance
names totally break the layout.

(imported from commit 69237d29a60241bdadda0469c4e08aa1d987222a)
2012-09-10 15:06:08 -04:00
Keegan McAllister 7b8544a53f Get class/instance for narrowing more uniformly
(imported from commit 1e9622cb93cf5954cf94f38c77c191524a6e72bc)
2012-09-10 14:46:03 -04:00
Keegan McAllister f2fbb99368 Fix narrowing by click
(imported from commit 776457bb430ed73912325d40a58d67ecb07f5e04)
2012-09-10 14:45:19 -04:00
Luke Faraone 37c226e6b6 Remove spurios padding on instances.
(imported from commit fbcbbe3f0973bbac74574f59d076b010f38951b5)
2012-09-10 14:37:36 -04:00
Luke Faraone cfc42b1d82 Implement portions of Waseem's new UI.
This is mostly working; things that need to be implemented:
 - Ask users for their Real Name
 - Personal replies need skinning
 - Miscl UI changes to match mockups

(imported from commit 3638cf5ec2ba2306004ba6db6fa4c25c47f76517)
2012-09-10 14:32:42 -04:00
Tim Abbott 37b1c1db11 Stop using foo.pk when we mean foo.id.
(imported from commit b86359254415f65b32eeefdfbcb38d7bb862c1ac)
2012-09-10 13:43:17 -04:00
Keegan McAllister afee8630aa Implement hotkey state as a state machine
(imported from commit d4f52cbc6bc9e66643e89c5b49a2201e4c938265)
2012-09-10 11:36:17 -04:00
Keegan McAllister 2798f83dbe Use switch-case for hotkeys
(imported from commit c269119d6e1034508303b1c67f5e7a59376674da)
2012-09-10 11:36:17 -04:00
Keegan McAllister e3307aff39 Factor out hotkey processing
(imported from commit bb7a7269b39481cbe831a9a5872b4e32f0f04234)
2012-09-10 11:36:17 -04:00
Jessica McKellar e23dcd7646 Add tests for get_update_longpoll.
(imported from commit 3dc1957647dd1ca5cb03f3d86cdf60bf318b7317)
2012-09-10 10:17:43 -04:00
Tim Abbott ca132789bb [schema] Store Recipient types more efficiently.
(imported from commit e0625ce9d2382682a5c8d53a5ac31a0399075df8)
2012-09-10 10:03:50 -04:00
Keegan McAllister 11b5a8e193 Add JSLint options
(imported from commit ff01274558cf1145a6ab057218bc16bac5628b2e)
2012-09-07 15:15:16 -04:00
Keegan McAllister b4c2aba14d Reparenthesize an expression
This was supposed to be (x && (y || z)) but was written as
(x && y || z) i.e. ((x && y) || z).

(imported from commit c2d6d385f71e6bc4b8933f6426d88aeee0123f66)
2012-09-07 15:07:50 -04:00
Keegan McAllister 52b6ed0ba4 Move scroll_to_selected definition before first use
(imported from commit 22f3274f8f636950784f241b9b61dc3785b370b0)
2012-09-07 15:07:50 -04:00
Keegan McAllister 8c9d29842d Fix formatting of nested functions
(imported from commit 7777d6bcc3d249d6c5dd51305c88220e5ec6e469)
2012-09-07 15:07:50 -04:00
Keegan McAllister c31e7903e9 Missing semicolons
(imported from commit 76bfb622f5e6a90b4c14dc4db78ab16e7a935df0)
2012-09-07 15:07:50 -04:00
Keegan McAllister b7d7d3da26 Declare all variables at the top of each function
Javascript has function scope only, not block scope, so the block use of 'var'
is misleading.

(imported from commit 6763fa241408e5893392f622fd92b2664a993ed0)
2012-09-07 15:07:43 -04:00
Keegan McAllister fd7a7aaff4 Javascript: Use !== and === instead of != and ==
!= and == will perform type coercions, which can hide bugs.

(imported from commit 42d3d990a659b62e196f3755c176f83f80c9e319)
2012-09-07 15:07:43 -04:00
Keegan McAllister 1211995d2e Fix indentation
(imported from commit 8f4880ceaa2e84fa842ba195ebe40800fc168eab)
2012-09-07 15:07:38 -04:00
Keegan McAllister 7d51dfc0a7 Remove dead function in runtornado.py
The code is buggy; the variable 'escape' is undefined.  Right now we aren't
using this code because we bypass Tornado for login.

(imported from commit 91cf6e8fc9477039c8847c7e9501d645993278b8)
2012-09-07 13:57:32 -04:00
Keegan McAllister f837ec66e8 Remove more dead code/variables in runtornado.py
(imported from commit 0d754ca1f9ce8bc53db878d6165354149016bea5)
2012-09-07 13:57:32 -04:00
Keegan McAllister ffb69ad1c8 Fix (?) logging in runtornado.py
(imported from commit d5158005abebe496959989acaa69db269126e502)
2012-09-07 13:57:32 -04:00
Keegan McAllister 0d857d6855 Remove unused exception variables
(imported from commit 74adf1cecbb2704cdfe8a6d8a73812d9997a8384)
2012-09-07 13:57:32 -04:00
Keegan McAllister 5a38fd2c48 Import something needed by @require_post decorator
(imported from commit a2537ad75ae6e8eeb3e543c425b14214c03775b0)
2012-09-07 13:57:32 -04:00
Keegan McAllister 80c6d09197 Remove unused imports
(imported from commit 9f5c226708e44935e8d32c18ea7dd1ad2615d8d5)
2012-09-07 13:57:32 -04:00
Tim Abbott b6203e7240 Comment on how filter_by_subscriptions is dead.
(imported from commit c13b2ed003d78408b7c4f51ef5080658c2b4bcc7)
2012-09-07 13:54:42 -04:00
Tim Abbott f39c203d2c Cleanup style of filter_by_subscriptions.
(imported from commit 4bc62dcc97eeb98147dd73163c75a142eaf5d3c9)
2012-09-07 13:53:24 -04:00
Tim Abbott 7f6d085ab6 Improve add_callback performance.
(imported from commit 4cea356ee6b0777bddfc996d7b8ee1b5fee391c6)
2012-09-07 13:51:54 -04:00
Tim Abbott a53d4e8177 Fix narrowing by huddles.
(imported from commit 77eb727512e4d90f71943c192fd7a2e16c7041c3)
2012-09-07 13:43:30 -04:00
Tim Abbott 4fd1230265 require login for get_updates_longpoll.
(imported from commit 64dec53e102e47c42109e064efc46e9812943640)
2012-09-07 13:32:20 -04:00
Tim Abbott c7be5cfadc Clean up user_profile getting.
(imported from commit 86be3c8061ac46510d240703c8e88eedb0883a8c)
2012-09-07 13:31:01 -04:00
Tim Abbott d8ade6de5b Add create_zephyr_class helper.
(imported from commit 993fbb799b706e402ae212330e4abbe28bf84ee9)
2012-09-07 13:28:56 -04:00
Tim Abbott 4848ae3c48 Clean up recipient creation for new ZephyrClass objects.
(imported from commit 2aa67fbcc6c01ca1c07f41e0edb6c9efcd336006)
2012-09-07 13:28:56 -04:00
Tim Abbott f170517e0f Add more arguments checking in views.
(imported from commit 389d0b724b88b0097cef2addd27704657b35cabe)
2012-09-07 13:28:56 -04:00
Tim Abbott ce2ad38cc2 Remove dead code in home view.
(imported from commit 5bc0d2d38de23828f19915c047e605e97b733b26)
2012-09-07 13:28:56 -04:00
Tim Abbott 14ab1a7044 get_updates_longpoll: Add error handling for malformed input.
(imported from commit c44758acd2b3b07bed6536f70fa50e23fb4231b6)
2012-09-07 13:28:56 -04:00
Tim Abbott 2486a68621 Use @require_post in a few more places.
(imported from commit d1a643780d6448f66505475c8f7c1f4646981022)
2012-09-07 13:28:56 -04:00
Keegan McAllister 1c64ce8bfc zephyr_mirror: Only resend old messages when invoked with --resend-log
(imported from commit e5a7c8d5b920d796ebbf68efc2beca6b14036695)
2012-09-07 13:18:35 -04:00
Keegan McAllister 028bb9aa8d zephyr_mirror: Log zephyrs and send them on startup
(imported from commit 5ceda51c643ddaf0042e8bb8f89e1353585b49c5)
2012-09-07 13:18:35 -04:00
Tim Abbott 6ed513f4da Update populate_db to add our user accounts.
(imported from commit 24d209c995bf9353652b376fff5d58ae5de07b5a)
2012-09-07 12:50:22 -04:00
Tim Abbott da491de948 Strip whitespace from requested class subscription names.
(imported from commit bb10ba64a2f76c089ff36574b30b76f725da62aa)
2012-09-07 12:50:18 -04:00
Tim Abbott 1e42dc5728 Clear UserMessage table in populate_db as well.
(imported from commit 6d1c9b7a9974373857724ddd7b8d7805ed99c784)
2012-09-07 11:54:04 -04:00
Keegan McAllister 83cb955413 zephyr_mirror: Rename for importing
(imported from commit 251e3d2ac47dc9a6de8205869a757ae673866d1e)
2012-09-07 11:45:42 -04:00
Keegan McAllister 4d12c03260 zephyr-mirror: Make it importable
(imported from commit a029350ed3b7eae401df848b8c52fd0e8c461fbd)
2012-09-07 11:45:15 -04:00
Keegan McAllister 1d35c51b9e zephyr-mirror: Extract CSRF token with BeautifulSoup
(imported from commit 46ba6256fde77dea9188262abd45be852645b85f)
2012-09-07 11:39:36 -04:00
Keegan McAllister a102377bff zephyr-mirror: Style changes
And remove some debugging noise.

(imported from commit 03268673fd9d624ddbde69b9fa2c59268e9c4fe8)
2012-09-07 11:39:36 -04:00
Tim Abbott cc3b90b5a2 Fix some testing problems with new UserMessage class.
(imported from commit abcadca84e6ad21c523f339952ad0dec0868dc50)
2012-09-07 11:30:28 -04:00
Tim Abbott 111cda9f21 Clean up inefficient queries in the home view.
(imported from commit fd958aef79a92eb4418e832b0d2b62a978f5776f)
2012-09-07 11:28:36 -04:00
Tim Abbott 7a0b5ce198 More efficiently populated the personals autocomplete list.
(imported from commit 8e37b8c707ca1c13238a4c1d3b136cb74aec0af7)
2012-09-07 11:28:36 -04:00
Tim Abbott 6c330b2654 [schema] Store zephyr receipts in new UserMessage table.
(imported from commit d909adf7528aba9a489280ebc3572791539cdd44)
2012-09-07 11:27:41 -04:00
Tim Abbott 9696e12c45 zephyr-mirror: Fix bug in zsig splitting.
(imported from commit 26f9784d0771d148dcb92dc4b1fca9d501d3d8f4)
2012-09-06 18:39:51 -04:00
Keegan McAllister 7659937586 Inline a global constant which is now only used in one place
(imported from commit 2c288202f5c46ff62f6044cd23f092e4175d498a)
2012-09-06 17:01:19 -04:00
Keegan McAllister f98c561a69 zephyr-mirror.py: HTML escape messages
(imported from commit 2f5f5b049fe17754d2a99a249fdc38f8770dfabd)
2012-09-06 16:24:49 -04:00
Tim Abbott bd0d6bfbcc Improve zephyr-mirror.py.
(imported from commit 555c145af844485289a85c664717dc609b9a5234)
2012-09-06 16:21:31 -04:00
Jessica McKellar e5d3c192c9 Update test_zephyr_to_nonexistent_class: classes are now created on the fly.
(imported from commit 8d04d3aae650a72f01a18e8e0b7e80e093081be1)
2012-09-06 16:06:26 -04:00
Jessica McKellar 13e5b45815 Return a JSON error on an invalid zephyr type.
(imported from commit 2207464c368666715caf550f32136de45ea37142)
2012-09-06 16:06:26 -04:00
Tim Abbott b235b8bc31 Fix user of UserProfile instead of User.
(imported from commit 08875b4fc7dec48a8fce6d6eab716642493a0708)
2012-09-06 16:04:42 -04:00
Tim Abbott 10873529fd Fix forge_zephyr bug.
(imported from commit 30f69247d9094d17a1af014ce3d6b60d85ae5c41)
2012-09-06 16:01:50 -04:00
Tim Abbott 1775ffe80a Improve forge_zephyr code.
(imported from commit c95c4392b09c932d8de11d30b730ab5d7bcb9e83)
2012-09-06 16:00:39 -04:00
Tim Abbott d9f348a348 Add zephyr_backend RPC call.
(imported from commit e815580e201772e81e94b820174e2410e3069960)
2012-09-06 15:52:48 -04:00
Keegan McAllister 115334c82a Don't bracket $.get with $.ajaxSetup
Instead, use the more general $.ajax which can take these options directly.

(imported from commit bb915e7d25cb6ac675d098903f7e7b57bde5006e)
2012-09-06 15:48:15 -04:00
Keegan McAllister 474f08198b Send zephyr template inline with index.html using django-jstemplate
(imported from commit 58cc8a50d463548aa283658dbe0aae366ecab39f)
2012-09-06 15:48:15 -04:00
Keegan McAllister fce5643d15 Handle Zephyr body clicks like the other clickable elements
(imported from commit 97da4b22aea4e23dd0227b0179481cb3b5f7a65e)
2012-09-06 15:48:15 -04:00
Keegan McAllister 6f269051d1 Partially consolidate the code which knows that zephyrs are <tr>s
(imported from commit ca2a208af9f1d3cc8a3f3980f55a5c008d28147a)
2012-09-06 15:48:15 -04:00
Keegan McAllister 689ab1efd6 Misc stylistic consistency
(imported from commit 624a07f50544d96f9e3c3b417b00369641bd3ae1)
2012-09-06 15:48:15 -04:00
Keegan McAllister 59ab88f886 Rename current_view -> apply_view
And related cleanups.

(imported from commit 4b1a7e7ef19b17c0887e2864f7cc2121eeda361e)
2012-09-06 15:48:15 -04:00
Keegan McAllister 1fa40e515c Style fixes
(imported from commit 311600ad8627d7060f235f59852d77f73a951e81)
2012-09-06 15:48:15 -04:00
Keegan McAllister 5e5b5986af Don't pass the global selected_zephyr_id through the narrow functions
(imported from commit a19232052913f45a6f8d3c08dd8761a6a2b5ec99)
2012-09-06 15:48:15 -04:00
Keegan McAllister a9f45e6e0e Have select_zephyr ensure that we point at a visible zephyr
(imported from commit 91e485742a040cf6c3454d1f55993a6c77a8ca09)
2012-09-06 15:48:15 -04:00
Keegan McAllister 74c97e7d59 Remove duplication between do_narrow and select_zephyr
(imported from commit 84c3e5a0d5682fd8790bd6e277e05e54a47d9aac)
2012-09-06 15:48:15 -04:00
Keegan McAllister d78e1f1bcb Remember the selected zephyr in a Javascript variable rather than querying the DOM
And related cleanups.

(imported from commit aa64980b4e66a64e92735c736159a8e2f717ea09)
2012-09-06 15:48:15 -04:00
Keegan McAllister 03d2a087a7 Organize global variables a bit
(imported from commit d3ad323bad4cda98e55a54ed3c9aec81ccd4008b)
2012-09-06 15:48:15 -04:00
Keegan McAllister 84e618a902 Use 'var' at top level consistently.
This has no effect but is stylistically consistent.

(imported from commit 71d7f615ea140195cc5081fb331677bc5d856fed)
2012-09-06 15:48:15 -04:00
Keegan McAllister 8f1cee0b88 Move third-party components into static/third/
(imported from commit 709c78a6e41afcd4202a8264c9103ac7827158ec)
2012-09-06 15:48:15 -04:00
Jessica McKellar fb8cab21ff tests: Add some basic /zephyr class and personal POST tests.
(imported from commit 7e30ce1d24926f9ab46d9269603f1aae3da2b752)
2012-09-06 15:46:48 -04:00
Jessica McKellar aa8ea169c7 Return our standard JSON success data on /zephyr POST.
(imported from commit 045e209d1a001d27b755a45984f9e159470b80bc)
2012-09-06 15:46:48 -04:00
Jessica McKellar da730ab0b0 tests: Factor out POST result success and error checks.
(imported from commit b818faf145ffeda6deb7d36fcce1313eade8f457)
2012-09-06 15:46:47 -04:00
Tim Abbott ef7786d777 Create a Recipient for classes created by sending a zephyr.
(imported from commit 8556392f84b0a7fc21b6405c87ceac1c49b37a52)
2012-09-06 15:43:35 -04:00
Tim Abbott 47323bf279 Mechanize code to login to our application and forward zephyrs.
(imported from commit bb7aa22a67fe2ca9346d1f192c8d1e1aa102ef43)
2012-09-06 15:39:38 -04:00
Tim Abbott d466738116 Fix creating new classes by sending messages to them.
(imported from commit a85034081d23f5366e0cdc4b906fd42b4b646aba)
2012-09-06 15:35:12 -04:00
Luke Faraone 3d1e956069 Don't check for class existence if we're not sending to a class.
(imported from commit 832de3f899d90ee727cebeede061de6a409b7845)
2012-09-06 15:19:56 -04:00
Jessica McKellar ebfb696ff7 Add tests for POSTs to /update.
(imported from commit e936d0f2abe21da70ef653ce27c290c31dd091c6)
2012-09-06 15:02:27 -04:00
Jessica McKellar 4f04172288 Add error handling on bad POSTs to /update.
(imported from commit 7893e9d339559a6f6e945d0f8d3d9efbdce01f55)
2012-09-06 15:02:27 -04:00
Jessica McKellar df14dc0cf7 tests: Factor out retrieving user profiles from usernames.
(imported from commit 004eabb8684952199b8a132eb29be3ce5daae724)
2012-09-06 15:01:57 -04:00
Luke Faraone f6b481546f Offer to subscribe / create classes if user zwrites to a non-subbed class
Here we check if a class exists. If not, we prompt the user to create, sub,
and send his message to the class. If the class exists but we're not subbed
we prompt the user to sub.

This commit also added a decorator to views.py and refactored out some
redundant code.

(imported from commit 7234ef6c080f2a6de6ff0922635dddd90032f7fe)
2012-09-06 14:33:55 -04:00
Tim Abbott 31ece4d3aa Fix narrowing by instance.
(imported from commit 824f0c113b9b6970bd451f4b0c3285dd3b88d9c4)
2012-09-06 11:17:39 -04:00
Tim Abbott e66e2f3be6 Fix new instance of recipient_id.
(imported from commit 4b3442a3a45138e18c2b33867d6c5af4b4427691)
2012-09-06 11:06:25 -04:00
Tim Abbott ef25dffb92 [schema] Add the realm to the ZepyhrClass objects.
(imported from commit 8189ef27f2feef0c92f9c06a9243c085e36a66f5)
2012-09-06 11:02:34 -04:00
Tim Abbott b761bf030b [schema] Fix names of fields in Subscription.
(imported from commit 5f5c643286d348d16caac03419ba3011a8b81eff)
2012-09-06 11:02:34 -04:00
Tim Abbott 38b30e5997 [schema] Add realms to the schema.
Note that realms aren't actually used for anything, aren't prompted
for, etc, so this is mostly just a schema change and the refactoring
needed to allow setting the realm in the future.

(imported from commit b8b483dcc9601b288702284879e9c99707a50a5c)
2012-09-06 11:02:34 -04:00
Keegan McAllister 4dd1567426 Keep third-party jQuery style in the jquery dir
(imported from commit 9e34277b90c13b3ce71521fe0657014f186fc1c3)
2012-09-06 11:00:34 -04:00
Jessica McKellar aea9682288 Handle zephyring to a huddle with an invalid username.
(imported from commit 953b242aff98782faab8eb2c7a9528ad4bfbcd54)
2012-09-05 18:01:07 -04:00
Jessica McKellar f539b5ec59 Handle trying to send a zephyr to a non-existent class.
(imported from commit 38c6df92ae8dc9dee358aa9af0ef592943b82429)
2012-09-05 18:01:07 -04:00
Jessica McKellar 22c2a868c1 Factor out json success and error handling.
(imported from commit 1891e077a18615d47710faf56b04c4bd160454fa)
2012-09-05 18:01:07 -04:00
Jessica McKellar cede8e59fb Return a 400 and error message instead of 500ing on a personal to an invalid user.
(imported from commit b8cdf342f2919aa0dbd2e30764c7662b6756aa57)
2012-09-05 18:01:06 -04:00
Keegan McAllister 0788f2efe6 get_updates_longpoll: Retry indefinitely, with exponential backoff
The client still won't recognize when it's reconnected, if there is no traffic.
Probably we should have the server send periodic heartbeat messages to the
clients, and make the clients look for them.

(imported from commit 4dab3ddf20bf3c48a65b9395c1e24b635b70aa81)
2012-09-05 16:37:20 -04:00
Keegan McAllister c3aaf54468 get_updates_longpoll: Timeout and retry
We're currently proxying through Apache, which will eventually drop an idle
connection to the app server.  Before that happens, drop it on the client and
retry.  This may also help with flaky Internet connections.  This timeout isn't
really an error condition and is naturally rate-limited, so we retry
indefinitely.

(imported from commit 45fbf812af63ed331fe046d85c64c97c1ec57611)
2012-09-05 16:37:10 -04:00
Luke Faraone 3366346144 Return subs in JSON based on a query of your subs list rather than sorting through recieved zephyrs.
(imported from commit 451435aee2c2cf6ee542468b1c91c4a15edf2032)
2012-09-05 16:15:38 -04:00
Tim Abbott e9b6ce6124 Fix subscriptions page showing huddles.
(imported from commit bed5fd30c509dcd5f169081396f72107dc08c750)
2012-09-05 15:32:06 -04:00
Keegan McAllister 53690d757f Avoid infinite tail recursion in get_updates_longpoll
Javascript doesn't guarantee tail-call optimization.  Also we should yield
control back to the browser in case it needs to catch up on rendering.

(imported from commit 1c35c0c2c39f13311b98bfb6221a1bac1fb22de8)
2012-09-05 14:06:19 -04:00
Keegan McAllister 1f522eddac Move zephyr rendering inside longpoll success callback
(imported from commit f7c2bbb0a31b339892a033e4192e44cb53b0d62c)
2012-09-05 14:06:08 -04:00
Keegan McAllister 162cb075b7 DEBUG: report longpoll events in JS console
(imported from commit f82edf2fcec66ec119319a691281726a16a46b31)
2012-09-05 14:00:56 -04:00
Keegan McAllister 2332fa2c72 Log server events with timestamps
(imported from commit b74274ccafcca716871058b8f9bde8dfe9e081ee)
2012-09-05 13:47:25 -04:00
Tim Abbott 3218f917ae populate_db: Repeat recipients a moderate fraction of the time.
(imported from commit 1a42ec5b585a7a64e24576350c61399601177877)
2012-09-05 13:42:05 -04:00
Tim Abbott 527058a202 Add personals and huddles to populate_db.
(imported from commit 98a8decc18bad4700260f125873ccc4367f73ebe)
2012-09-05 12:38:35 -04:00
Tim Abbott 8eb778dc32 Fix display of which people we're showing personals with.
(imported from commit 4e2f2554c9af4b176dcbbe6300b72c2ce69bc8bd)
2012-09-05 11:48:35 -04:00
Keegan McAllister 04b1c21333 Remove some unnecessary intermediate lists
Use generator comprehensions for efficiency and cleaner code.

(imported from commit 6b4b709515b5c904ef38b8ea33a9d4a4af0f5468)
2012-09-05 11:41:53 -04:00