Above the table showing all of a user's expenses, there should be a link that says something like, "Add New Expense". When the user clicks this, the form for adding a new expense should appear via a slide down, pushing the table of expenses downward.
For now, the form should just contain the following:
A text field for a date, to be formatted as YYYY-MM-DD. We will implement client-side form validation of this format later. For now, assume that the user will only enter validly formatted dates.
A description for the expense
A select drop-down of Expense Types, from which the user can choose.
A text field for the amount, to be formatted as DDD.DD. We will implement client-side form validation of this format later. For now, assume that the user will only enter validly formatted amounts.
A select drop-down of allowed currencies.
A submit button.
This form should be submitted via AJAX.
The user can then add a new expense by completing the form. If the information provided does not pass the Expense model's validations, then an error message should be displayed to the user, letting him know what needs to be fixed.
When an expense is successfully added, the form should slide up and reset, so that it is usable again. The table displaying all expenses should have a new row for this newly added expense added to the top, highlighted in green. The new row should be added to the top regardless of where it would naturally show up in a date-sorted list, to indicate prominently to the user that this is a newly added row.
If the user immediately adds a new expense, the previously green-highlighted expense can be un-highlighted, and the new expense should be highlighted.
Above the table showing all of a user's expenses, there should be a link that says something like, "Add New Expense". When the user clicks this, the form for adding a new expense should appear via a slide down, pushing the table of expenses downward.
For now, the form should just contain the following:
This form should be submitted via AJAX.
The user can then add a new expense by completing the form. If the information provided does not pass the Expense model's validations, then an error message should be displayed to the user, letting him know what needs to be fixed.
When an expense is successfully added, the form should slide up and reset, so that it is usable again. The table displaying all expenses should have a new row for this newly added expense added to the top, highlighted in green. The new row should be added to the top regardless of where it would naturally show up in a date-sorted list, to indicate prominently to the user that this is a newly added row.
If the user immediately adds a new expense, the previously green-highlighted expense can be un-highlighted, and the new expense should be highlighted.