Opened 9 years ago

Closed 3 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@… 9 years ago.
4574.diff (3.3 KB) - added by Flavio Curella 5 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 5 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)

Changed 9 years ago by calvin@…

Attachment: django_cal_css_classes.diff added

comment:1 Changed 9 years ago by calvin@…

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

comment:2 Changed 9 years ago by Simon G. <dev@…>

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

comment:3 Changed 9 years ago by Malcolm Tredinnick

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 Changed 9 years ago by James Bennett

Owner: changed from nobody to xian

Reassigning to xian.

comment:5 Changed 9 years ago by Brian Rosner

Keywords: nfa-someday added

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

comment:6 Changed 6 years ago by Gabriel Hurley

Severity: Normal
Type: Cleanup/optimization

comment:7 Changed 6 years ago by Julien Phalip

UI/UX: set

Changed 5 years ago by Flavio Curella

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 Changed 5 years ago by Flavio Curella

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

Changed 5 years ago by Silver_Ghost

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

comment:9 Changed 5 years ago by Silver_Ghost

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 Changed 5 years ago by anonymous

Resolution: fixed
Status: newclosed

comment:11 Changed 5 years ago by anonymous

Needs tests: set

comment:12 Changed 5 years ago by Julien Phalip

Resolution: fixed
Status: closedreopened

Reverting spam closing.

comment:13 Changed 4 years ago by Aymeric Augustin

Status: reopenednew

comment:14 Changed 3 years ago by berto

Owner: changed from xian to berto
Status: newassigned

comment:15 Changed 3 years ago by berto

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

comment:16 Changed 3 years ago by Julien Phalip <jphalip@…>

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