Merge lp:~claire-couchone/sahana-eden/branch into lp:sahana-eden

Proposed by Claire McCabe
Status: Needs review
Proposed branch: lp:~claire-couchone/sahana-eden/branch
Merge into: lp:sahana-eden
Diff against target: 21 lines (+3/-1)
1 file modified
models/02_pr.py (+3/-1)
To merge this branch: bzr merge lp:~claire-couchone/sahana-eden/branch
Reviewer Review Type Date Requested Status
Fran Boon Needs Fixing
Review via email: mp+37210@code.launchpad.net

Description of the change

So, we're adding a tool tip, mmmkay?

To post a comment you must log in.
Revision history for this message
Claire McCabe (claire-couchone) wrote :

Um....so, basically, we added something so that people can have a default date of birth in the sahara eden. Um...yeah.

Revision history for this message
Fran Boon (flavour) wrote :

Thanks Claire,

#474 was, I think, requesting a little calendar icon next to the field which would provide a visual indicator that this was a date field which would bring up a date picker widget.
This could easily be added to the .comment for the field, although there should then be more work to make the icon clickable to bring up the widget (otherwise I can see a UX bug being reported for this)

I don't see any code to default the date of birth field.
I'm also not sure what the purpose of such would be - can you elaborate?

NB There shouldn't be any need to import datetime within this model since it has already been imported earlier in the request processing - in 00_db.py.

PS This merge is against a slightly older version of Sahana Eden so it still used Tstr(). This has now been deprecated since Web2Py has extended T() to support the common str() operations such as concatenation.

Best Wishes,
Fran.

review: Needs Fixing

Unmerged revisions

1261. By Sahana Eden <sahana@sahana-dev>

Ticket # 474 we've fixed the date of birth issue. Ie, we added a tooltip.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'models/02_pr.py'
2--- models/02_pr.py 2010-09-28 07:58:41 +0000
3+++ models/02_pr.py 2010-10-01 02:46:45 +0000
4@@ -290,6 +290,7 @@
5 # -----------------------------------------------------------------------------
6 resource = "person"
7 tablename = "%s_%s" % (module, resource)
8+import datetime
9 table = db.define_table(tablename,
10 pe_id(),
11 pe_label(),
12@@ -323,7 +324,8 @@
13
14 table.first_name.requires = IS_NOT_EMPTY()
15 table.first_name.requires.error_message = T("Please enter a First Name")
16-
17+table.date_of_birth.comment = DIV(DIV(_class="tooltip",
18+ _title=Tstr("ID Label") + "|" + Tstr("Click in the field for frickin' calendar options.")))
19 table.pe_label.comment = DIV(DIV(_class="tooltip",
20 _title=T("ID Label") + "|" + T("Number or Label on the identification tag this person is wearing (if any).")))
21 table.first_name.comment = DIV(SPAN("*", _class="req", _style="padding-right: 5px;"), DIV(_class="tooltip",