timestamper/www/ts/index.yaws
Jonathan Bernard 1b1e31059b Implemented entry creation, pagination. Some restyling and bugfixes.
- Bug fix in ts_api:list_entries/3. Case statement matching on atoms but
  input is a list (string).
- Bug fix in ts_api:put_entry/3. Was expecting the wrong result from
  ts_entry:new/1.
- Bug fix in ts_entry:list/4. Code crashed when the starting offset was
  greater than the total number of elements. Now returns [].
- Fixed ts_json:encode_datetime/1 and ts_json:decode_datetime/1 to handle
  millisecond values in the datetime string (per ISO standard).
- Broke out ``control-links`` style to a top-level class.
- Added showdown.js, a JS Markdown processor. Not hooked up to anything
  yet but intend to display entry notes with Markdown.
- Added code for entry pagination. Loads the most recent 20 entries and
  loads more upon demand in batches of 20.
- Fixed bug in login routine that kept the user edit fields from being
  pre-populated.
- Rewrote the loadEntries function to double for new entries and loading
  more existing entries.
- Commented displayEntries. Also refactored into displayNewerEntries,
  which pushed new entries on to the top of the stack, and
  displayOlderEntries, which tags them onto the bottom.
- Implemented hidden notes field for new entry input.
- Implemented new entry creation.
- Created a helper function to ISO format a Date object.
- Expanded entry template to show control links (edit, show notes, del).
- Activated the 'load more entries' button.
2011-03-07 16:43:40 -06:00

158 lines
7.1 KiB
Plaintext

<!DOCTYPE html>
<html>
<head>
<title>TimeStamper - Simple Time Tracking</title>
<link rel="stylesheet" media="screen" href="/css/dot-luv/jquery-ui-1.8.10.custom.css" type="text/css"/>
<link rel="stylesheet" media="screen" href="/css/ts-screen.css" type="text/css"/>
<!-- Needed for IE, but I'm not going to support IE with this tool. -->
<!--<script type="text/javascript" src="/js/json2.js"></script>-->
<script type="text/javascript" src="/js/jquery-1.5.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.10.custom.min.js"></script>
<script type="text/javascript" src="/js/underscore-min.js"></script>
<script type="text/javascript" src="/js/ICanHaz.js"></script>
<script type="text/javascript" src="/js/ts.js"></script>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script id="entry" type="text/html">
<div class="entry-bar" id="entry-{{entry_id}}">
<span class="id">{{entry_id}}</span>
<div class="details">
<div class="entry-mark">{{mark}}</div>
<div class="entry-notes">{{notes}}</div>
</div>
<div class="control-links">
<a onclick="toggleEntryNotes(event, 'entry-{{entry_id}}')"
href="#">show notes</a>
<a onclick="editEntry(event, 'entry-{{entry_id}}')"
href="#">edit</a>
<a onclick="deleteEntry(event, 'entry-{{entry_id}}')"
href="#">del</a>
</div>
</div>
</script>
</head>
<body>
<div id="user" class="bar">
<span id="fullname">Not Logged In</span>
<span id="username">- no_user</span>
<div class="control-links">
<a href="/ts/edit-user.yaws"
onclick="toggleUserInfo(event)">user info</a>
<a href="/ts/logout.yaws" onclick="logout(event)">logout</a>
</div>
<div id="user-info">
<form action="/ts/update-user.yaws" onsubmit="updateUser(event)">
<div class="form-col">
<label for="fullname-input"><span>name:</span>
<input id="fullname-input" name="fullname"
class="text-input" type="text"/>
</label>
<label for="email-input"><span>email:</span>
<input id="email-input" name="email"
class="text-input" type="text"/>
</label>
</div>
<div class="form-col">
<div id="change-pwd">
<label for="old-pwd-input"><span>password:</span>
<input id="old-pwd-input" name="old-pwd"
class="text-input" type="password"/>
</label>
<label for="new-pwd-input"><span>new pwd:</span>
<input id="new-pwd-input" name="new-pwd"
class="text-input" type="password"/>
</label>
<label for="new-pwd-conf-input"><span>confirm:</span>
<input id="new-pwd-conf-input" name="new-pwd-conf"
class="text-input" type="password"/>
</label>
</div>
<label for="enable-pwd-change-input">
<input name="enable-pwd-change" type="checkbox"
id="enable-pwd-change-input"
onclick="showChangePwd(event)"/>
change password
</label>
</div>
<div class="form-submit">
<div>
<input name="submit-user" type="submit"
value="save changes"/>
</div>
</div>
</form>
</div>
</div>
<div id="timeline" class="bar">
<span id="timeline-name">timeline |</span>
<span id="timeline-desc">timeline description</span>
<div class="control-links">
<a href="/ts/edit-timeline.yaws"
onclick="toggleTimelineInfo(event)">timeline info</a>
<a href="/ts/select-timeline.yaws"
onclick="showTimelineMenu(event)">change timelines</a>
</div>
<div id="timeline-info">
<form action="/ts/update-timeline.yaws"
onsubmit="updateTimeline(event); false">
<label for="timeline-desc-input"><span>description:</span>
<input id="timeline-desc-input" class="text-input"
name="timeline-desc" type="text"/>
</label>
<div class="form-submit">
<div><input name="submit-timeline" type="submit"
value="save changes"/></div>
</div>
</form>
</div>
</div>
<div id="new-entry" class="bar">
<form action="/ts/new-entry.yaws" onsubmit="newEntry(event)">
begin a new activity:
<input name="new-entry" id="new-entry-input"
class="text-input" type="text"/>
<input name="submit-entry" id="submit-entry"
class="form-submit" type="submit" value="create entry"/>
<div class="control-links">
<a id="show-notes" href="#"
onclick="showNewNotes(event)">add notes</a>
</div>
<div id="add-notes" class="form-col">
<label for="new-notes-input">notes:</label>
<textarea name="new-notes" id="new-notes-input"
class="text-input" rows="8" cols="40" ></textarea>
</div>
</form>
</div>
<div id="more-entries" class="last-bar top-entry">
<div>
<a href="#" onclick="loadEntries(user, activeTimeline, 'old');event.preventDefault()">load more entries</a>
</div>
</div>
<div id="login-dialog" title="Login">
<form>
<fieldset>
<label for="login-name">Username:</label>
<input type="text" name="login-name" id="login-name"
class="text ui-widget-content ui-corner-all"></input>
<label for="login-password">Password:</label>
<input type="password" name="login-password" id="login-password"
class="text ui-widget-content ui-corner-all"></input>
</fieldset>
</form>
<p class="validate-tips"></p>
</div>
</body>
</html>