Fixing the issue of "show entries" dropdown setting not being saved.
After some investigation, it seems like we're destroying the calendar
everytime we modify the dropdown value, and create a new one,
which explains why the new setting is not being saved.
Fixed by moving the code that handles the updating to the place after
we create the new calendar. This makes the code cleaner as well.
Added system preference in Preference page for user to select the start day of a week
(defaults to Sunday).
Calendar will utilize this information and update the calendar UI accordingly.
For week and day views under Calendar page, save the change to pref db table when
user updates the interval dropdown. Same thing goes for the "show XXX entries"
dropdown found under Playlist Builder page.
When visiting these pages, we retrieves the entry from database for current user
and use those values. Defaults to 30m for interval and 10 entries for "show xxx entries"
if values were never set.
Updated the calendar page so that when user chooses a different time scale to display(day/week/month),
the new setting is stored in the pref database. Each user id has its own entry in the database.
When visiting the calendar, we retrieves the entry from database for current user
and show that time scale; defaults to monthly view if no entry found.
The show content window size is detemined dynamically based on
browsers viewport size.
I'm not sure what the size should be. So I set width and height
as like following:
width = viewport width * 4/5
height = viewport height * 2/3
Ratio can be easily changed.
Download action were added in two placese.
1. Playlist Builder. jjmenu now showing 'Download'.
2. Calendar-> Show Content. Click on the file, you will see
Downlaod menu.
Limitation:
File name is set to original file name.
On the ticket it said, file format should be like
"show_name-12012011-2130.mp3". However, in my opinion,
this is only possible, if a user downloads it from
calender->show content. We know what the show names and etc,
but, if the user downloads it from Playlist Builder, we cannot
retrive such information. To be consistent in both area, I just
set the file name to original file name. This can be easily
modified in the future.