Started adding implementation of client-side functionality.

- Changed ts_api:dispatch_user/3 to return information for the user currently,
  authenticated if a valid session id is presented and no username is presented.
- Moved the generic styling of form > * elements to be specific to .bar > form.
- Added jQuery U 1.8.0.
- Created login dialog that will automatically load upon page load if the user
  is not logged in.
- Added styling for jQuery UI login dialog.
- Implemented login functionality on the client page.
- Implemented functionality to load user and timeline records on the client
  side.
This commit is contained in:
Jonathan Bernard
2011-03-01 08:23:51 -06:00
parent 4492f87a39
commit 439a080f14
21 changed files with 1522 additions and 26 deletions

View File

@ -74,8 +74,8 @@ dispatch_app(YArg, Session, Params) ->
% -------- Dispatch for /user -------- %
dispatch_user(YArg, _Session, []) ->
make_json_404(YArg, [{see_docs, "/ts_api_doc/"}]);
dispatch_user(YArg, Session, []) ->
dispatch_user(YArg, Session, [atom_to_list(Session#ts_api_session.username)]);
dispatch_user(YArg, Session, [H]) ->
Username = path_element_to_atom(H),
@ -183,7 +183,7 @@ do_login(YArg) ->
case {lists:keyfind(username, 1, Fields),
lists:keyfind(password, 1, Fields)} of
% username an password found
% username and password found
{{username, UnameField}, {password, Password}} ->
Username = list_to_atom(UnameField),
@ -210,7 +210,8 @@ do_login(YArg) ->
do_logout(YArg) ->
Cookie = (YArg#arg.headers)#headers.cookie,
CookieVal = yaws_api:find_cookie_val("ts_api_session", Cookie),
ts_api_session:logout(CookieVal).
ts_api_session:logout(CookieVal),
{status, 200}.
get_user_summary(YArg, Username) ->
case ts_user:lookup(Username) of