Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#10043 closed (fixed)

widthratio tag does not accept a variable as the max_width argument

Reported by: obeattie 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: UI/UX:

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 obeattie 6 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 ericholscher 6 years ago.
10043-with-tests.2.diff (2.6 KB) - added by ericholscher 6 years ago.

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by obeattie

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

comment:1 Changed 6 years ago by jacob

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 6 years ago by ericholscher

Changed 6 years ago by ericholscher

comment:2 Changed 6 years ago by Alex

  • Triage Stage changed from Accepted to Ready for checkin

comment:3 Changed 6 years ago by ericholscher

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 Changed 6 years ago by brosner

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

(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 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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