Move web application into /web.

This commit is contained in:
2024-08-04 20:48:32 -05:00
parent 338eab1c96
commit 111be977c6
138 changed files with 0 additions and 0 deletions

97
web/doc/api.rst Normal file
View File

@ -0,0 +1,97 @@
TimeStamper Web Service API
===========================
This document describes the REST API the TimeStamper web service exposes.
General Assumptions and Definitions
-----------------------------------
Values that vary are notated using typeset in *emphasized text* when they
appear in the text of the documentation and are ``<enclosed by angle
brackets>`` when they appear in code examples or other monospaced text.
Paths in this document are relative to the server root. So
``/<user-id>/current`` refers to ``http://sub.domain.tld/<user-id>/current``
Any paths inteded to be interpreted differently will use the full, absolute
form (ie. ``http://www.twitter.com/bob``)
User Management: ``/<user-id>``
-------------------------------
All requests directed at the user id URL are related to user management. The
request is further interpreted by the request type. This resource responds to
the ``GET``, ``POST``, ``PUT``, and ``DELETE`` HTTP verbs.
*user-id*:
The user identifier, or username. This is a string value; valid characters
are ``[a-zA-Z0-9_]``.
PUT
~~~
Create a new user. A new user is created only if there is not an existing user
with the same *user-id*. If
Returns:
* ``201 Created`` if the user was successfully created.
* ``409 Conflict`` if a user already exists for this *user-id*.
.. TODO: input format, preconditions, other returns
GET
~~~
Returns the information about the user for *user-id*.
Return:
* ``200 OK``
* ``404 Not Found`` if there is no user for *user-id*.
POST
~~~~
Updates information about the user for *user-id*.
DELETE
~~~~~~
Deletes the user for *user-id*.
Timelines: ``/<user-id>/<timeline-id>``
---------------------------------------
*user-id*:
See `User Management`_.
*timeline-id*:
A timeline identifier. A string; valid characters are ``[a-zA-Z0-9_]``.
GET
~~~
Returns the timeline meta-data.
POST
~~~~
Update timeline meta-data.
PUT
~~~
Create a new timeline.
DELETE
~~~~~~
Delete a timeline.
List Events
-----------
``/<user-id>/<timeline-id>/list``
---------------------------------
GET
~~~

24
web/doc/db_layer.rst Normal file
View File

@ -0,0 +1,24 @@
TimeStamper DB Layer
====================
The following modules make up the database layer:
* ``ts_user``: Interface to user data.
* ``ts_timeline``: Interface to timeline data.
* ``ts_entry``: Interface to timeline entry data.
* ``ts_ext_data``: Interface to extended data that can be set on different
records.
* ``ts_db_records``: Definition of data records.
The following modules and files are implementation details of the DB layer:
* ``id_counter``: Adds support for unique, sequential ID generation.
* ``ts_common``: Provides the implementation for any operations that are common
between the different interfaces.
Philosophy
----------
The database layer should abstract all database-specific code away from the
caller. Users of the DB layer should not have to think about transactions,
locking, etc.

View File

@ -0,0 +1,4 @@
- Switch to local storage if unable to reach the server, sync when server is
available.
- Provide full-text search on timestamp marks and notes. Use Lucene in a
seperate process? Build our own Erlang indexing code?

View File

@ -0,0 +1,4 @@
Refactor models and views.
==========================
Try to find the behavior that is common to mobile and desktop versions.

View File

@ -0,0 +1,2 @@
Add UI for note taking.
=======================

View File

@ -0,0 +1,9 @@
Add Markdown converter for notes.
=================================
Brief description.
========= ==========
Created: 2011-05-15
Resolved: 2011-05-15
========= ==========

View File

@ -0,0 +1,11 @@
Duration mis-set on new entries.
================================
Fix the duration bug when adding new events. Need to set the nextModel for
the previously 'current' timestamp and set the nextModel of the new timestamp
to 'null'
========= ==========
Created: 2011-05-15
Resolved: 2011-05-15
========= ==========

View File

@ -0,0 +1,15 @@
Generate day seperators.
========================
When generating EventViews in the EventListView, we need to automatically
create and insert day seperators (see prototype).
Resolution
----------
Day separators are added to the timeline by EntryListView.render.
========= ==========
Created: 2011-05-15
Resolved: 2011-05-17
========= ==========

View File

@ -0,0 +1,10 @@
Fix UI for tasks with a duration a day or longer.
=================================================
Tasks that are extremely long-running can overflow the space set aside for
the *Duration* column.
========= ==========
Created: 2011-05-15
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,14 @@
Fix user menu UI.
=================
UI for user menu does not work.
Resolution
----------
UI menu changed to be displayed to the right of the username, in the empty black space vailable.
========= ==========
Created: 2011-05-15
Resolved: 2011-06-01
========= ==========

View File

@ -0,0 +1,9 @@
Fix timeline menu UI.
=====================
UI for timeline menu does not work.
========= ==========
Created: 2011-05-15
Resolved: 2011-06-07
========= ==========

View File

@ -0,0 +1,9 @@
Implement timeline selection.
=============================
Allow the user to change timelines.
========= ==========
Created: 2011-05-15
Resolved: 2011-06-08
========= ==========

View File

@ -0,0 +1,15 @@
Create UI for timeline creation.
================================
There should be a way through the interface for a user to create a new
timeline.
Resolution
----------
Abstracted the login dialog CSS to support other dialogs of the same look and feel. Used this to create a dialog for creating new timelines.
========= ==========
Created: 2011-05-15
Resolved: 2011-06-01
========= ==========

View File

@ -0,0 +1,12 @@
Implement correct start time editor.
====================================
The start time input field needs to look the same as the start time view.
Alternatively, use a date picker.
----
========= ==========
Created: 2011-05-15
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,18 @@
Implement UI for entry re-order when chronological order changes.
=================================================================
The UI should re-order the EntryList display when the chronological of the entries
changes based on user input.
Two ways to do this spring to mind:
1. ``slideUp`` the EntryView at it's original position, find the new position,
move it in the DOM and ``slideDown`` the element into view.
2. Detach the element from the list, position it absolutely, animate it to it's new
absolute position (based on the position of its new neighbors) and re-insert it
into the list.
========= ==========
Created: 2011-05-15
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,10 @@
Create a subtle alternating background for EntryViews
=====================================================
The goal is to visually tie together elements in the same row, and subtley
distinquish each row from its neighbors.
========= ==========
Created: 2011-05-15
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,9 @@
Create tooltip/some help system.
================================
Need some way to make actions discoverable and easy to understand.
========= ==========
Created: 2011-05-15
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,10 @@
Create a real-time tick-tock for the current entry duration.
============================================================
Have some visible indication that the display is being updated as time passes.
Blink the field, or just the units.
========= ==========
Created: 2011-05-15
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,12 @@
Automatic code highlighting.
============================
Look at content in ``<pre>`` and ``<code>`` blocks and see if we can highlight it.
Planning to use Highlight.js to do this.
----
========= ==========
Created: 2011-05-15
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,9 @@
Create new timeline button in timeline menu.
============================================
Need a button to trigger the new timeline dialog.
========= ==========
Created: 2011-06-01
Resolved: 2011-06-07
========= ==========

View File

@ -0,0 +1,7 @@
Duration of next previous entries are not updated when a timestamp is updated.
==============================================================================
========= ==========
Created: 2011-06-01
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,7 @@
Implement timeline creation.
============================
========= ==========
Created: 2011-06-01
Resolved: 2011-06-07
========= ==========

View File

@ -0,0 +1,15 @@
Error in UI when creating or selecting a timeline.
==================================================
A type error is occurring whenever a timeline link is clicked.
Resolution
----------
The problem was an event registered on the AppView class, linked
to 'selectTimeline' function, which was not defined.
========= ==========
Created: 2011-06-07
Resolved: 2011-06-08
========= ==========

View File

@ -0,0 +1,16 @@
API calls fail silently after session timeout.
==============================================
API starts failing with a 500 error after session time-out.
Steps to Reproduce
------------------
1. Login
2. Wait until session times out (5 min?)
3. Try to create a new entry.
========= ==========
Created: 2011-06-08
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,22 @@
Add exclusion filter for entries.
=================================
Add a way for users to add regexes for entries to be ignored in the
display. Exclusions may be per-timeline or per-user.
Resolution
----------
``ts_user`` and ``ts_timeline`` both support an exnteded data property called
``entry_exclusions`` which accepts a list of regular expression strings. Any entries
whose marks match any of the regular expressions should be excluded from view.
EntryListView.render filters out any matching entries from its display. It still
takes them into account when calculating the duration of other entries.
----
========= ==========
Created: 2011-06-10
Resolved: 2011-06-15
========= ==========

View File

@ -0,0 +1,7 @@
Constrain width of notes fields to width of mark.
=================================================
========= ==========
Created: 2011-06-10
Resolved: 2011-06-17
====================

View File

@ -0,0 +1,12 @@
Deleting an entry should cascade delete extended data.
======================================================
Currently the data remains in the database. It should not cause any
problems, but it is wasting space.
----
========= ==========
Created: 2011-06-15
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,12 @@
Check for exclusion after mark update.
======================================
If a user rewrites the mark of an entry, we should check to see if it now
matches one of the defined entry exclusions.
----
========= ==========
Created: YYYY-MM-DD
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,11 @@
Hide day separators when all entries that day are excluded.
===========================================================
We should hide headings when there is no visible data.
----
========= ==========
Created: 2011-06-17
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,21 @@
Never animate excluded entries.
===============================
We need to have some visible indication when a user enters an
exlucded item that it was added, but it looks ugly and dirty when
we first render the list.
Part of this is motivated by the fact that entering an excluded
entry is the excpected way for a user to stop the timer on an item
without having an explicit next item.
If we choose to implement *D0026* this would free up the UI a bit.
In that case, we could gently flash the 'Show/Hide Excluded Items'
button (*D0027*).
----
========= ==========
Created: 2011-06-17
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,16 @@
Add a default 'stop' behaviour.
===============================
It might be more natural to allow the user to hit a button on
the current entry to stop the timer on it than to explicitly
create a new excluded entry.
Maybe have a default exclusion for all users, "ENTRY STOP" for example,
and have the button automatically add this entry.
----
========= ==========
Created: 2011-06-17
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,12 @@
Create a way to unhide excluded entries.
========================================
A button somewhere would be a good way to allow users to
show/hide excluded entries.
----
========= ==========
Created: 2011-06-17
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1,11 @@
Put more visual emphasis on the new entry text field.
=====================================================
Add a shadow, or light highlight, something.
----
========= ==========
Created: 2011-05-15
Resolved: YYYY-MM-DD
========= ==========

View File

@ -0,0 +1 @@
Prototype out mobile workflow.

34
web/doc/model.txt Normal file
View File

@ -0,0 +1,34 @@
Data
----
UserModel
TimelineModel
TimelineListModel
EntryListModel
EntryModel
Views
-----
EntryView
NewEntryInput
TimelineListView
TimelineView
UserView
Data Dependencies
-----------------
UserModel: none
TimelineModel: none
TimelineListModel: UserModel
EntryModel: none
EntryListModel: TimelineModel
View Dependencies
-----------------
UserView: UserModel
TimelineView: TimelineModel, UserView
TimelineListView: TimelineListModel, UserView
EntryView: EntryModel, EntryListView
EntryListView: EntryListModel, TimelineView

BIN
web/doc/model.xcf Normal file

Binary file not shown.

5
web/doc/sampl-urls.txt Normal file
View File

@ -0,0 +1,5 @@
/ts_api/users/jdbernard
/ts_api/timelines/jdbernard/work
/ts_api/entries/jdbernard/work/1
/ts_api/app/user_summary/jdbernard

29
web/doc/todo.rst Normal file
View File

@ -0,0 +1,29 @@
Current
=======
Upcoming
========
- Generate day seperators
- Fix UI for tasks with a duration a day or longer
- Fix hover UI for user menu
- Fix hover UI for timeline menu
- Test (implement?) timeline selection
- Add UI for timeline creation
- Change the UI for editing the start-time. Use a date-picker (custom jQuery
UI theme?)
- Fix UI for timestamp edits which change the order of events in the timeline.
- Create a light, alternating background for entries
- Add hover-enabled icons for editing entries/showing notes
- Create tooltips.
- Create a realtime tick-tock for the duration of the current item.
- Mobile version of the app.
- Refactor code, seperate out reusable bits for mobile version.
- Automatic code-highlighting (Highlight.js)
Done
====
- Add UI for note-taking
- Add Markdown converter for notes.
- Fix the duration bug when adding new events. Need to set the nextModel for
the previously 'current' timestamp and set the nextModel of the new timestamp
to 'null'