Started implementing entry loading in client side.

- Bug fix in ts_entry:new/1. Msspelled ``atomic``.
- Bug fix in ts_json:record_to_ejson/1. For ``ts_entry`` records, the
  Username and TimelineId elements were not being converted from atoms to list.
- Added the entry template for loaded and created entry elements.
- Added ICanHaz.js (which wraps mustache.js) and underscore.js.
- Implemented a naive version of displayEntries() in ts.js.
- Added debug alerts for error cases in ts.js.
- Styling the new entry elements.
This commit is contained in:
Jonathan Bernard
2011-03-03 17:05:30 -06:00
parent dfab257a12
commit 122a3bd1e3
16 changed files with 1336 additions and 21 deletions

View File

@ -3,7 +3,7 @@
start() ->
ok = application:load(mnesia),
ok = application:set_env(mnesia, dir, "/home/jdbernard/projects/timestamper/web-app/db/test"),
ok = application:set_env(mnesia, dir, "C:/Documents and Settings/jbernard/My Documents/projects/personal/timestamper/web-app/db/test"),
ok = mnesia:start(),
ok.

View File

@ -10,7 +10,7 @@ create_table(TableOpts) ->
{type, ordered_set}, {index, [timestamp]}]).
new(ER = #ts_entry{}) ->
{atmoic, NewRow} = mnesia:transaction(fun() ->
{atomic, NewRow} = mnesia:transaction(fun() ->
{Username, TimelineId, _} = ER#ts_entry.ref,
NextId = id_counter:next_counter(ts_entry_id),
NewRow = ER#ts_entry{ref = {Username, TimelineId, NextId}},

View File

@ -32,8 +32,8 @@ record_to_ejson(Record=#ts_entry{}) ->
% create the EJSON struct
{struct, [
{username, Username},
{timeline_id, TimelineId},
{username, atom_to_list(Username)},
{timeline_id, atom_to_list(TimelineId)},
{entry_id, EntryId},
{timestamp, encode_datetime(DateTime)},
{mark, Record#ts_entry.mark},