diff --git a/db/test/DECISION_TAB.LOG b/db/test/DECISION_TAB.LOG index 318ffdb..39665a1 100644 Binary files a/db/test/DECISION_TAB.LOG and b/db/test/DECISION_TAB.LOG differ diff --git a/db/test/LATEST.LOG b/db/test/LATEST.LOG index 450f6f5..14e9dc3 100644 Binary files a/db/test/LATEST.LOG and b/db/test/LATEST.LOG differ diff --git a/src/ts_api.erl b/src/ts_api.erl index 391574d..668187c 100644 --- a/src/ts_api.erl +++ b/src/ts_api.erl @@ -62,20 +62,20 @@ dispatch_user(YArg, Session, [H]) -> {'GET', Username} -> get_user(YArg, Username); {_BadMethod, Username} -> - make_json_405(YArg, [{see_docs, "/ts_api_doc/users"}]); + make_json_405(YArg, [{see_docs, "/ts_api_doc/users.html"}]); - _Other -> make_json_401(YArg, [{see_docs, "/ts_api_doc/users"}]) + _Other -> make_json_401(YArg, [{see_docs, "/ts_api_doc/users.html"}]) end. dispatch_timeline(YArg, _Session, []) -> - make_json_404(YArg, [{see_docs, "/ts_api_doc/timelines"}]); + make_json_404(YArg, [{see_docs, "/ts_api_doc/timelines.html"}]); dispatch_timeline(YArg, Session, [UrlUsername|_T] = PathElements) -> Username = path_element_to_atom(UrlUsername), case Session#ts_api_session.username of Username -> dispatch_timeline(YArg, PathElements); - _Other -> make_json_404(YArg, [{see_docs, "/ts_api_doc/users"}]) + _Other -> make_json_404(YArg, [{see_docs, "/ts_api_doc/users.html"}]) end. % just username, list timelines @@ -85,7 +85,7 @@ dispatch_timeline(YArg, [UrlUsername]) -> case HTTPMethod of 'GET' -> list_timelines(YArg, Username); - _Other -> make_json_405(YArg, [{see_docs, "/ts_api_doc/timelines"}]) + _Other -> make_json_405(YArg, [{see_docs, "/ts_api_doc/timelines.html"}]) end; dispatch_timeline(YArg, [UrlUsername, UrlTimelineId]) -> @@ -98,21 +98,21 @@ dispatch_timeline(YArg, [UrlUsername, UrlTimelineId]) -> 'POST' -> post_timeline(YArg, Username, TimelineId); 'PUT' -> put_timeline(YArg, Username, TimelineId); 'DELETE' -> delete_timeline(YArg, Username, TimelineId); - _Other -> make_json_405(YArg, [{see_docs, "/ts_api_doc/timelines"}]) + _Other -> make_json_405(YArg, [{see_docs, "/ts_api_doc/timelines.html"}]) end; dispatch_timeline(YArg, _Other) -> - make_json_404(YArg, [{see_docs, "/ts_api_doc/timelines"}]). + make_json_404(YArg, [{see_docs, "/ts_api_doc/timelines.html"}]). dispatch_entry(YArg, _Session, []) -> - make_json_404(YArg, [{see_docs, "/ts_aip_doc/entries"}]); + make_json_404(YArg, [{see_docs, "/ts_aip_doc/entries.html"}]); dispatch_entry(YArg, Session, [UrlUsername|_T] = PathElements) -> Username = path_element_to_atom(UrlUsername), case Session#ts_api_session.username of Username -> dispatch_entry(YArg, PathElements); - _Other -> make_json_404(YArg, [{see_docs, "/ts_api_doc/entries"}]) + _Other -> make_json_404(YArg, [{see_docs, "/ts_api_doc/entries.html"}]) end. dispatch_entry(YArg, [UrlUsername, UrlTimelineId]) -> @@ -123,7 +123,7 @@ dispatch_entry(YArg, [UrlUsername, UrlTimelineId]) -> case HTTPMethod of 'GET' -> list_entries(YArg, Username, TimelineId); 'PUT' -> put_entry(YArg, Username, TimelineId); - _Other -> make_json_405(YArg, [{see_docs, "/ts_api_doc/entries"}]) + _Other -> make_json_405(YArg, [{see_docs, "/ts_api_doc/entries.html"}]) end; dispatch_entry(YArg, [UrlUsername, UrlTimelineId, UrlEntryId]) -> @@ -136,11 +136,11 @@ dispatch_entry(YArg, [UrlUsername, UrlTimelineId, UrlEntryId]) -> 'GET' -> get_entry(YArg, Username, TimelineId, EntryId); 'POST' -> post_entry(YArg, Username, TimelineId, EntryId); 'DELETE' -> delete_entry(YArg, Username, TimelineId, EntryId); - _Other -> make_json_405(YArg, [{see_docs, "/ts_api_doc/entries"}]) + _Other -> make_json_405(YArg, [{see_docs, "/ts_api_doc/entries.html"}]) end; dispatch_entry(YArg, _Other) -> - make_json_404(YArg, [{see_docs, "/ts_api_doc/entries"}]). + make_json_404(YArg, [{see_docs, "/ts_api_doc/entries.html"}]). % ============================== % % ======== IMPLEMENTATION ====== % @@ -175,7 +175,7 @@ do_login(YArg) -> "bad username/password combination"}]) end; - _Other -> make_json_400(YArg, [{see_docs, "/ts_api_doc/login"}]) + _Other -> make_json_400(YArg, [{see_docs, "/ts_api_doc/login.html"}]) end. do_logout(YArg) -> @@ -252,7 +252,7 @@ put_timeline(YArg, Username, TimelineId) -> JSONResponse = json:encode({struct, [ {status, "ignored"}, {timeline, EJSONRec}, - {see_docs, "/ts_api_doc/timelines#PUT"} + {see_docs, "/ts_api_doc/timelines.html#PUT"} ]}), {content, "application/json", JSONResponse}; @@ -282,7 +282,7 @@ post_timeline(YArg, Username, TimelineId) -> no_record -> make_json_404(YArg, [{status, "no such timeline"}, - {see_docs, "/ts_api_doc/timelines#POST"}]); + {see_docs, "/ts_api_doc/timelines.html#POST"}]); _Error -> make_json_500(YArg) end. @@ -299,7 +299,7 @@ list_entries(YArg, Username, TimelineId) -> {no_record, _ByDateField} -> make_json_404( [{status, "no such timeline"}, - {see_docs, "/ts_api_doc/entries#LIST"}]); + {see_docs, "/ts_api_doc/entries.html#LIST"}]); % listing by date range {Timeline, {byDate, "true"}} -> @@ -402,7 +402,7 @@ put_entry(YArg, Username, TimelineId) -> JSONResponse = json:encode({struct, [ {status, "ignored"}, {entry, EJSONRec}, - {see_docs, "/ts_api_doc/entries#PUT"} + {see_docs, "/ts_api_doc/entries.html#PUT"} ]}), {content, "application/json", JSONResponse}; @@ -425,7 +425,7 @@ post_entry(YArg, Username, TimelineId, EntryId) -> ok -> make_json_200(YArg, NewRecord); no_record -> make_json_404(YArg, - [{status, "no such entry"}, {see_docs, "/ts_api_doc/entries#POST"}]); + [{status, "no such entry"}, {see_docs, "/ts_api_doc/entries.html#POST"}]); _Error -> make_json_500(YArg) end. diff --git a/www/css/ts.scss b/www/css/ts.scss new file mode 100644 index 0000000..e69de29 diff --git a/www/index.yaws b/www/index.yaws new file mode 100644 index 0000000..a0c7d5d --- /dev/null +++ b/www/index.yaws @@ -0,0 +1,24 @@ + + + + + TimeStamper - Simple time tracking + + + +