Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#10043 closed (fixed)

widthratio tag does not accept a variable as the max_width argument

Reported by: Oliver Beattie Owned by: nobody
Component: Template system Version: 1.0
Severity: Keywords: widthratio
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When using the widthratio template tag, it isn't possible to use a template variable as the max_width argument. This would have been useful for me recently, and I can't see a reason why this functionality shouldn't exist. I've attached a patch which adds the feature.

Attachments (3)

widthratio-variable.diff (2.0 KB ) - added by Oliver Beattie 16 years ago.
Patch to the widthratio template tag to allow variables to be passed for the max_width argument
10043-with-tests.diff (2.6 KB ) - added by Eric Holscher 16 years ago.
10043-with-tests.2.diff (2.6 KB ) - added by Eric Holscher 16 years ago.

Download all attachments as: .zip

Change History (8)

by Oliver Beattie, 16 years ago

Attachment: widthratio-variable.diff added

Patch to the widthratio template tag to allow variables to be passed for the max_width argument

comment:1 by Jacob, 16 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

by Eric Holscher, 16 years ago

Attachment: 10043-with-tests.diff added

by Eric Holscher, 16 years ago

Attachment: 10043-with-tests.2.diff added

comment:2 by Alex Gaynor, 16 years ago

Triage Stage: AcceptedReady for checkin

comment:3 by Eric Holscher, 16 years ago

Note that I changed widthratio10 from a test to a working implementation. It is now possible to pass a float to the max_width argument instead of it failing on floats.

I talked to Jacob and Brian about this and they said it made sense.

comment:4 by Brian Rosner, 16 years ago

Resolution: fixed
Status: newclosed

(In [10352]) Fixed #10043 -- widthratio tag now accepts a variable for the max_width argument.

The max_width argument now passes through FilterExpression which by side-affect
allows float values, but will be truncated.

Thanks obeattie and Eric Holscher for patches.

comment:5 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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