Opened 17 years ago

Closed 11 years ago

#4574 closed Cleanup/optimization (fixed)

add CSS classes to rendered calendar

Reported by: calvin@… Owned by: berto
Component: contrib.admin Version: newforms-admin
Severity: Normal Keywords: nfa-someday javascript admin
Cc: Flavio Curella, Silver_Ghost Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: yes UI/UX: yes

Description

The current calendar does not add any CSS classes to the rendered table. This patch adds "today" for the current date, "selected" for the selected date (which is added as new function argument), and "noday" for the empty cells. The old style definitions are removed.

Attachments (3)

django_cal_css_classes.diff (3.4 KB ) - added by calvin@… 17 years ago.
4574.diff (3.3 KB ) - added by Flavio Curella 13 years ago.
patch with updated js code. No tests yet, since I have no idea on how to write tests for js code
calendar_css_today_and_selected.diff (5.7 KB ) - added by Silver_Ghost 13 years ago.
add selected and today CSS classes to calendar cells (previous patch completely does not work)

Download all attachments as: .zip

Change History (19)

by calvin@…, 17 years ago

Attachment: django_cal_css_classes.diff added

comment:1 by calvin@…, 17 years ago

Correction: the CSS class is "nonday", not "noday".

comment:2 by Simon G. <dev@…>, 17 years ago

Component: UncategorizedAdmin interface
Owner: changed from Jacob to Adrian Holovaty
Triage Stage: UnreviewedReady for checkin

comment:3 by Malcolm Tredinnick, 17 years ago

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted
Version: SVNnewforms-admin

We're not adding any patches like this to existing admin, since it's going to be replaced with newforms-admin shortly, so new features aren't so useful. If the patch can be redone against the newforms-admin branch, it can probably be applied there.

comment:4 by James Bennett, 17 years ago

Owner: changed from nobody to xian

Reassigning to xian.

comment:5 by Brian Rosner, 17 years ago

Keywords: nfa-someday added

This ticket isn't critical to merge newforms-admin into trunk. Tagging with nfa-someday.

comment:6 by Gabriel Hurley, 14 years ago

Severity: Normal
Type: Cleanup/optimization

comment:7 by Julien Phalip, 13 years ago

UI/UX: set

by Flavio Curella, 13 years ago

Attachment: 4574.diff added

patch with updated js code. No tests yet, since I have no idea on how to write tests for js code

comment:8 by Flavio Curella, 13 years ago

Cc: Flavio Curella added
Easy pickings: unset
Needs tests: set

by Silver_Ghost, 13 years ago

add selected and today CSS classes to calendar cells (previous patch completely does not work)

comment:9 by Silver_Ghost, 13 years ago

Cc: Silver_Ghost added
Easy pickings: set
Keywords: javascript admin added
Needs tests: unset
Patch needs improvement: unset

fcurella, your patch completely does not work for me. I've attached working one.

Also there is no way to testing Javacript since it need special instruments such as Selenium. Django has only server-side tests at the moment.

comment:10 by anonymous, 13 years ago

Resolution: fixed
Status: newclosed

comment:11 by anonymous, 13 years ago

Needs tests: set

comment:12 by Julien Phalip, 13 years ago

Resolution: fixed
Status: closedreopened

Reverting spam closing.

comment:13 by Aymeric Augustin, 12 years ago

Status: reopenednew

comment:14 by berto, 11 years ago

Owner: changed from xian to berto
Status: newassigned

comment:15 by berto, 11 years ago

I've created a pull request on Github at: https://github.com/django/django/pull/1608

comment:16 by Julien Phalip <jphalip@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In af67ce5e18525ba52ee4533229468ed07f912536:

Fixed #4574 -- Added CSS classes to the admin calendar widget for better control over styling.

Note: See TracTickets for help on using tickets.
Back to Top