Opened 8 years ago

Closed 3 years ago

Last modified 3 years ago

#3542 closed New feature (fixed)

Allow month-based date_list on archive_index

Reported by: anonymous Owned by: dtulig
Component: Generic views Version: master
Severity: Normal Keywords: date_list month generic view
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

I was trying to create a blog index, similar to the Django weblog, which has a Month and Year archive sidebar.

I figured the correct thing to use was the archive_index generic view, but the date list only gives me years.

I can almost see the reason for this, as archive_index would drill down to archive_year, but it's rare that you would list the years first except for very long-running blogs.

I propose a new argument to archive_index of "date_list_period" which can be 'year' (default) or 'month'.

Attachments (3)

date_list_period.diff (1.8 KB) - added by dtulig 7 years ago.
Adds the new parameter and documentation.
t3542-r7354.diff (1.9 KB) - added by ramiro 7 years ago.
3542-month-based-archive_index-generic-view-r9973.diff (1.7 KB) - added by ramiro 6 years ago.
Updated patch to trunk after the documentation refactoring

Download all attachments as: .zip

Change History (20)

comment:1 Changed 8 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 7 years ago by jacob

  • Triage Stage changed from Design decision needed to Accepted

comment:3 Changed 7 years ago by dtulig

  • Has patch set
  • Keywords sprintdec01 added
  • Owner changed from nobody to dtulig

Changed 7 years ago by dtulig

Adds the new parameter and documentation.

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

  • Triage Stage changed from Accepted to Ready for checkin

comment:5 Changed 7 years ago by ramiro

Attaching an updated revision of the patch that appplies to trunk as of r7354.

Changed 7 years ago by ramiro

comment:6 Changed 7 years ago by mtredinnick

  • milestone set to post-1.0

comment:7 Changed 6 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

Changed 6 years ago by ramiro

Updated patch to trunk after the documentation refactoring

comment:8 Changed 6 years ago by ramiro

  • Keywords month generic view added; sprintdec01 removed

comment:9 Changed 5 years ago by mtredinnick

  • Patch needs improvement set
  • Triage Stage changed from Ready for checkin to Accepted

Hold on a bit... if I have data from multiple years in my database, isn't this going to collapse *all* the January months into one? That's considered useful?!

The documentation is a little confusing to me. It's correct, but doesn't really tell me *what* a year or month year does. Could we put in a little example of what the output of each might look like so that a user knows why they might want one or the other option?

comment:10 Changed 5 years ago by russellm

Also needs to be updated for class-based views.

comment:11 Changed 4 years ago by lrekucki

  • Severity set to Normal
  • Type set to New feature

comment:12 Changed 3 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:13 Changed 3 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:14 Changed 3 years ago by Marc Tamlyn <marc.tamlyn@…>

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

In [8d5c11caad7f87d14b486a46890782fa0b66bb74]:

Fixed #3542 -- Add support for changing granularity on ArchiveView.

Resolving the concept from a very old ticket in a more class-based-view
manner.

comment:15 Changed 3 years ago by Andrew Godwin <andrew@…>

In [5b09fc8ad2b61331496a7ed2667960ba744c01aa]:

Merge pull request #288 from mjtamlyn/date-list-period

Fixed #3542 -- Add support for changing granularity on ArchiveView.

comment:16 Changed 3 years ago by aaugustin

This commit could have used more docs... I'm taking care of them now...

comment:17 Changed 3 years ago by Aymeric Augustin <aymeric.augustin@…>

In [7207327dd313522954da167f9a41396b97354c78]:

Updated docs for dates generic views.

Fixes #18245. Refs #3542.

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