Code

Opened 7 years ago

Closed 10 months 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: fcurella, 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@… 7 years ago.
4574.diff (3.3 KB) - added by fcurella 3 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 3 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 7 years ago by calvin@…

comment:1 Changed 7 years ago by calvin@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

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

  • Component changed from Uncategorized to Admin interface
  • Owner changed from jacob to adrian
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:3 Changed 7 years ago by mtredinnick

  • Patch needs improvement set
  • Triage Stage changed from Ready for checkin to Accepted
  • Version changed from SVN to newforms-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 7 years ago by ubernostrum

  • Owner changed from nobody to xian

Reassigning to xian.

comment:5 Changed 7 years ago by brosner

  • Keywords nfa-someday added

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

comment:6 Changed 3 years ago by gabrielhurley

  • Severity set to Normal
  • Type set to Cleanup/optimization

comment:7 Changed 3 years ago by julien

  • UI/UX set

Changed 3 years ago by fcurella

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

comment:8 Changed 3 years ago by fcurella

  • Cc fcurella added
  • Easy pickings unset
  • Needs tests set

Changed 3 years ago by Silver_Ghost

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

comment:9 Changed 3 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 3 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed

comment:11 Changed 3 years ago by anonymous

  • Needs tests set

comment:12 Changed 3 years ago by julien

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reverting spam closing.

comment:13 Changed 16 months ago by aaugustin

  • Status changed from reopened to new

comment:14 Changed 10 months ago by berto

  • Owner changed from xian to berto
  • Status changed from new to assigned

comment:15 Changed 10 months ago by berto

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

comment:16 Changed 10 months ago by Julien Phalip <jphalip@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In af67ce5e18525ba52ee4533229468ed07f912536:

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.