Waseem Daher
a27edbce7d
Restyle subscriptions page.
...
(imported from commit 41339c5af38ae5ea4801fc1e23b7184c277145f3)
2012-09-21 16:04:44 -04:00
Tim Abbott
8be02ce8a3
Fix use of userprofile for user_profile variable in subs code.
...
All of our other views code uses "user_profile" as the local variable
referring to a user_profile object -- best to be consistent about
that. We should also consider renaming Subscription model element.
(imported from commit 770cfad8258f016aef8c78c428e4499f5b12f300)
2012-09-21 14:47:40 -04:00
Tim Abbott
ed46a453ba
Add (mostly unstyled) settings page.
...
(imported from commit 492c5f498c2fec452e6c724555bc4a5a2c4c151a)
2012-09-21 14:47:26 -04:00
Keegan McAllister
85abb3f274
forge_zephyr: Convert email to lowercase
...
This fixes failing User.object.get(email=...)
(imported from commit e0d5097520c6a149031e6881ae25f4c5bb967918)
2012-09-21 14:11:34 -04:00
Keegan McAllister
a68a3e7ab7
Get the just-created user from create_user
...
(imported from commit d709c99cc670aa1b0864c40b8c0d5e52b6c90340)
2012-09-21 14:01:43 -04:00
Keegan McAllister
0638c2aada
forge_zephyr: fetch the just-created user
...
(imported from commit a269f30736f1873e6e4ed7202fcaa16c436299a8)
2012-09-21 13:56:20 -04:00
Keegan McAllister
3cbc56a866
Rename MD5_SALT to HASH_SALT
...
(imported from commit 3112cd805614c3057a9eb8f1b251381f48ab3173)
2012-09-21 13:44:09 -04:00
Tim Abbott
2d6683f896
Deduplicate user creation code.
...
(imported from commit bda76a9a44bd5ed7f0726b527fdb93cec109cbed)
2012-09-21 10:45:00 -04:00
Tim Abbott
135c82717d
Authenticate by email.
...
Approach from http://www.micahcarrick.com/django-email-authentication.html .
(imported from commit 796b8e08d8e1f9769cd3cf8ee61d3724ac3847b7)
2012-09-21 10:34:48 -04:00
Tim Abbott
ee8f28a084
Use email addresses as unique identifiers rather than usernames.
...
Note that this code still assumes one's email address (stripped of
domain) is unique.
(imported from commit e98f96601ad109811978fc00b1165e97d8f7b185)
2012-09-21 09:43:22 -04:00
Luke Faraone
eb1740e1e7
Use emails in the gravatar seed, don't display a static gravatar for the current user.
...
(imported from commit 64d1fd4f1cd33796bc907fef9778e088d80b8c5a)
2012-09-19 13:39:34 -04:00
Keegan McAllister
db7a8277ff
Replace create_{user_profile,zephyr_class} with {UserProfile,ZephyrClass}.create
...
Looks nicer and cuts down on imports.
(imported from commit 4fdbbb45cf6d8ad016481c663cf52fd555b41d91)
2012-09-19 13:01:58 -04:00
Keegan McAllister
8aded489b8
Remove a duplicated query
...
(imported from commit 50ee95e0ec887d5a9d1629051aa816c706bd04d8)
2012-09-18 14:24:52 -04:00
Jessica McKellar
a8484cb967
Remove subscriptions with an AJAX request.
...
(imported from commit d34154b31a38ac66cc8f97785c312c98dd53286c)
2012-09-18 12:33:07 -04:00
Jessica McKellar
2126e38ae2
Get and display new subscriptions with an AJAX request.
...
(imported from commit c9efa7596898ac4b74ec9184ae773566eda65ec3)
2012-09-18 12:32:52 -04:00
Jessica McKellar
1996efa0c7
Give json_success/error the ability to add more data to the results json.
...
(imported from commit 8fafb983f30e193905616eafa3be2f8aec1143c3)
2012-09-18 12:26:29 -04:00
Keegan McAllister
c53470c908
Sanitize username, class name, etc
...
(imported from commit 95730f1f725036649ff60d698b461fdcf33594bb)
2012-09-17 15:24:41 -04:00
Keegan McAllister
7152fe2f73
Format messages with Markdown
...
(imported from commit 014a4dddd4d3db61d85c6f6bf1987aff6093fb52)
2012-09-17 15:24:41 -04:00
Luke Faraone
de5ff99c21
Don't generate both zephyr_json and zephyr_dict_json on the server.
...
Previously we were iterating through all zephyrs twice on the server, now
we are moving part of that to the client so the client has an index of
Zephyrs that it generates itself as part of add_message.
(imported from commit c07a6c36911fa2eae6f216c34331be34b2aa8178)
2012-09-17 13:12:22 -04:00
Jessica McKellar
a12f582d92
Don't let people try to send zephyrs to empty class names.
...
Also strip leading and trailing whitespace, so 'Bar' and 'Bar' aren't
separate classes.
(imported from commit a39c220d1a4c4d179f4adbf5e1391436eda32f4f)
2012-09-14 15:44:54 -04:00
Luke Faraone
4821175dd5
Provide both a sequential list of zephyrs and an associative array.
...
The purpose of this is to ensure that we can reference a zephyr by its ID
and get all the data about the zephyr; in the future we may not have all
such data stored in TRs as we do now.
(imported from commit 9128ddd01b46396fd276124ca1e6430538d3dd63)
2012-09-13 14:31:02 -04:00
Keegan McAllister
96abc04fe6
Set email on forged users
...
(imported from commit ee7c163bf2a674c8b76aa5a7ba86e79c84bcec20)
2012-09-12 22:56:43 -04:00
Keegan McAllister
f4b00d802a
forge_zephyr: Take fullname, shortname from POST
...
(imported from commit a983cfbf4fcb6395dcef64c81c984dd05169c1e9)
2012-09-12 21:10:20 -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
bfdf2bef57
[schema] Collect and display names and e-mail addresses.
...
(imported from commit aa6bceb05fcd5b456c03288cbfed65b14050fe88)
2012-09-11 16:34:53 -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
Tim Abbott
ca132789bb
[schema] Store Recipient types more efficiently.
...
(imported from commit e0625ce9d2382682a5c8d53a5ac31a0399075df8)
2012-09-10 10:03:50 -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
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
Tim Abbott
da491de948
Strip whitespace from requested class subscription names.
...
(imported from commit bb10ba64a2f76c089ff36574b30b76f725da62aa)
2012-09-07 12:50:18 -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
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
Jessica McKellar
aa8ea169c7
Return our standard JSON success data on /zephyr POST.
...
(imported from commit 045e209d1a001d27b755a45984f9e159470b80bc)
2012-09-06 15:46:48 -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
d466738116
Fix creating new classes by sending messages to them.
...
(imported from commit a85034081d23f5366e0cdc4b906fd42b4b646aba)
2012-09-06 15:35:12 -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
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
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
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
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
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
Tim Abbott
254b118bd6
Fix an error in huddle comments.
...
(imported from commit 85a06b53de1027815e1d2bbd4c6354801495fffe)
2012-09-05 11:32:05 -04:00
Tim Abbott
1f151214c0
Move the huddle recipient uniquification into get_huddle.
...
(imported from commit 09378b583becce6467d65d6caec71a543e27be2e)
2012-09-05 11:30:40 -04:00
Tim Abbott
fe43dc008f
Clarify comments about huddles.
...
(imported from commit b4b779c48289e0f78490c0e93ece19b55a6f2dee)
2012-09-05 11:19:31 -04:00
Tim Abbott
08b55de0af
Add support for replying to huddle messages.
...
(imported from commit 21c760838fa87bf524ff178eab6473dfa3c6921c)
2012-09-05 11:19:31 -04:00
Tim Abbott
6de871a698
Fix double-sending to huddle recipients.
...
(imported from commit 649c01c6d0f1c826d3db9444f48af16ee1eb8d06)
2012-09-05 11:19:31 -04:00
Tim Abbott
4d284d8a92
[schema] Add support for multi-user personals ("huddles").
...
This is controlled by listing multiple comma-separate usernames in the
personal message sending box.
(imported from commit 06c9dadb7977b98f88ad31e5df453b59f1afad96)
2012-09-04 19:15:07 -04:00
Tim Abbott
84ece4b3fe
Combine the zephyr() and personal_zephyr() functions.
...
(imported from commit a39b70f019901d0dd6994d4c440002111e4c29e1)
2012-09-04 19:14:46 -04:00
Tim Abbott
f0db139e43
Fix missing import socket in views.py.
...
(imported from commit e00c3a1a16435b8e65bd3bd445fb049c70aee4be)
2012-09-04 19:11:25 -04:00
Tim Abbott
af4ed3a9a1
Eliminate trailing whitespace in views.py.
...
(imported from commit e69b90a7354e4b8ce1221973788d1a0f80530d56)
2012-09-04 18:51:23 -04:00
Luke Faraone
5a37dd459a
Use a list comprehension instead of a set comp. for Py2.6 compatability.
...
(imported from commit d3764623d2b6df13b4912920a10183928c63ae83)
2012-09-04 18:48:46 -04:00
Tim Abbott
8f058937a0
Rename recipient.user_or_class to type.id.
...
(imported from commit 74639cd08d0f53ae39624fc793f6fe55325b6d45)
2012-09-04 16:34:39 -04:00
Luke Faraone
974b560659
Add autocomplete for personals, classes, and instances.
...
Here we pull in the jqueryui library and a style sheet to provide a widget
to do autocomplete for various fields. We populate a list of all ever-seen
classes, instances, and people (C/I/P) into JS arrays and then pass them to
jqueryui.
Each time a new C/I/P appears, we reinitialise the autocomplete functions
so they will notice the new data.
(imported from commit f1ab69c99d21f68ccf40c015bd43960f463c6ff2)
2012-09-04 16:14:48 -04:00
Keegan McAllister
ac2553cdff
Replace get_state with a variable embedded into index.html
...
(imported from commit 3ef4a0163107248618a25e242ab30fdff5da17e0)
2012-09-04 13:01:00 -04:00
Jessica McKellar
526ba5568f
Add a missing @login_required on update.
...
(imported from commit b41ac9adb8886c736fb59051b8d83d3a9c6c0894)
2012-09-04 11:39:12 -04:00
Jessica McKellar
e51ab0cdfa
Get pointer state from the server on page load, and scroll to that zephyr.
...
(imported from commit a1387d89378494a55f084f56ed9eb33c4f719dcb)
2012-09-04 11:36:36 -04:00
Jessica McKellar
546c61a979
Fix a bug (using the wrong id) when filtering subscriptions.
...
(imported from commit 030d208640e532045e9a06fceac7ad2d396b61b6)
2012-08-30 17:17:59 -04:00
Jessica McKellar
172c3f0c81
Use named parameters to condense some of the new ORM object creation code.
...
(imported from commit e172f24956f67fe1f68ff288244b67918eb91acf)
2012-08-30 17:17:59 -04:00
Jessica McKellar
99925f4aaf
Add the ability to add new subscriptions.
...
(imported from commit 0a7fdc17087240b13631627a053c580c2e4b5319)
2012-08-30 17:17:59 -04:00
Jessica McKellar
7e56e7a0f4
Add a navigation link for managing subscriptions (for starters, just unsubbing).
...
(imported from commit 23274a8790bf1f017e9c33db52bf746e291f23ba)
2012-08-30 17:17:47 -04:00
Keegan McAllister
ba13f8b06a
Don't redirect the Ajax message send to /
...
(imported from commit 24f95b53001d06ced77a9368f346760df1899756)
2012-08-30 16:41:09 -04:00
Keegan McAllister
d57d19e562
Move all zephyr HTML generation to the client
...
(imported from commit 3afec768a5cd220c14ce615e03c29ee22754fdf2)
2012-08-30 16:41:09 -04:00
Tim Abbott
9afd63692f
Implement long polling using Tornado.
...
(imported from commit 4385304b27d7fe55a57a23133cd214fe8fc33482)
2012-08-30 14:29:34 -04:00
Jessica McKellar
1f56ac9e60
Make the zephyr highlighting for new zephyrs consistent with those on page load.
...
(imported from commit 28dbdb564b4dff479af1f71551a393f8dd54d597)
2012-08-29 14:54:00 -04:00
Jessica McKellar
1394a685e2
Only display zephyrs from your subscriptions.
...
That means your personals, classes to which you are subscribed, and
personals you sent to other people.
(imported from commit 15fbea92b538ff345f9978438c1c5e66766d0a67)
2012-08-29 12:57:26 -04:00
Jessica McKellar
018c62829a
Give our models meaningful reprs.
...
>>> from zephyr.models import UserProfile, Recipient, Zephyr, ZephyrClass
>>> for klass in [UserProfile, Recipient, Zephyr, ZephyrClass]:
... print klass.objects.all()[:2]
...
[<UserProfile: othello>, <UserProfile: iago>]
[<Recipient: Verona (1, class)>, <Recipient: Denmark (2, class)>]
[<Zephyr: Scotland / Scotland3 / <UserProfile: prospero>>, <Zephyr: Venice / Venice3 / <UserProfile: iago>>]
[<ZephyrClass: Verona>, <ZephyrClass: Denmark>]
(imported from commit 9998ffe40800213a5425990d6e85f5c5a43a5355)
2012-08-29 10:45:20 -04:00
Jessica McKellar
a35c5d30d7
zephyr.views: Add missing timezone import.
...
(imported from commit b10066c7212850898fa7adede5d6d6be0fb6bea1)
2012-08-29 10:19:10 -04:00
Tim Abbott
9625c17473
Change the last message received variable name to 'last_received'.
...
(imported from commit 37c34b54ce4bcbf601f934854c8e77340ba69117)
2012-08-28 17:38:36 -04:00
Jessica McKellar
36cc0219d5
Make timestamps on zephyrs timezone-aware.
...
This will avoid Daylight Saving Time issues and resolves a Django
warning about using naive datetime objects ("RuntimeWarning:
DateTimeField received a naive datetime").
This adds a dependency on python-tz.
https://docs.djangoproject.com/en/dev/topics/i18n/timezones/
(imported from commit 10e432a67e2bcd014a0cedf4423a162609873825)
2012-08-28 17:08:38 -04:00
Jessica McKellar
4a6402f23c
Use the correct MIME type for the JSON we are sending and receiving.
...
http://www.ietf.org/rfc/rfc4627.txt
http://www.iana.org/assignments/media-types/application/index.html
(imported from commit d37e46a9db5077e2c7b1f39534875216df237e3c)
2012-08-28 16:46:02 -04:00
Jessica McKellar
f6819d09d5
Add basic personals functionality.
...
(imported from commit a4fecbe40672f34295b1e908526b6c45056bcb7f)
2012-08-28 16:35:04 -04:00
Jessica McKellar
2b9a3205be
Switch zephyrs to the notion of a "Recipient", which is either a class or user.
...
(imported from commit edc46267dab9cc972358b6020ca28b009e15d8c5)
2012-08-28 16:34:23 -04:00
Jessica McKellar
d90e8f6ec5
Initial Django commit: basic account, zephyr stream, narrowing, etc.
...
(imported from commit 3cd40521171a4020c19021eda0d20ee9f802af41)
2012-08-28 12:44:51 -04:00