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:
@ -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.
|
||||
|
||||
|
@ -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}},
|
||||
|
@ -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},
|
||||
|
Reference in New Issue
Block a user