Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20709 closed New feature (fixed)

Allow widthratio tag to accept "as" parameter to put result in the template context

Reported by: clay.evil@… Owned by: jonathanslenders
Component: Template system Version: 1.5
Severity: Normal Keywords:
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

<div class="bar" style="width:{% widthratio x y 100 %}%">

{% widthratio x y 100 %}%

</div>

Attachments (1)

widthratio-as.patch (5.7 KB) - added by jonathanslenders 2 years ago.
Patch + unit tests + docstring updated.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 2 years ago by timo

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from widthratio tag to accept "as" parameter to put result to the template context to Allow widthratio tag to accept "as" parameter to put result in the template context
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 2 years ago by jonathanslenders

  • Owner changed from nobody to jonathanslenders
  • Status changed from new to assigned

Is it okay, to make widthratio as follows?

{% widthratio x y 100 as result %}

I'll do it, it's an easy one.

comment:3 Changed 2 years ago by timo

Yes, that's the syntax I'd expect.

comment:4 Changed 2 years ago by jonathanslenders

comment:5 Changed 2 years ago by timo

  • Needs documentation set

Looks good. The addition to AUTHORS should be alphabetized. You also need update the documentation: describe the change in docs/ref/templates/builtins.txt with a .. versionchanged:: 1.7 directive and also mention it in docs/releases/1.7.txt

comment:6 Changed 2 years ago by clay.evil@…

Good job, Thank you all!

comment:7 Changed 2 years ago by jonathanslenders

New patch in attachment and pull requested updated: https://github.com/django/django/pull/1472/files

wait... forgot the docs/releases/1.7.

Last edited 2 years ago by jonathanslenders (previous) (diff)

Changed 2 years ago by jonathanslenders

Patch + unit tests + docstring updated.

comment:8 Changed 2 years ago by jonathanslenders

  • Triage Stage changed from Accepted to Ready for checkin

Should be okay now.

comment:9 Changed 2 years ago by timo

  • Has patch set
  • Needs documentation unset

Thanks, looks good. FYI, you don't need to attach a patch *and* send a pull request. Also for future reference, please don't mark your own patch as "Ready for checkin". That needs to be done by a different reviewer. Also be sure to set the "Has Patch" and other flags on the ticket so the ticket is in the right state. See the triaging tickets page.

comment:10 Changed 2 years ago by Tim Graham <timograham@…>

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

In ff410565bf1cf1a2905c1ef83db408d455211446:

Fixed #20709 -- Allowed {% widthratio %} to accept an "as" parameter.

Thanks clay.evil@ for the suggestion.

comment:11 Changed 2 years ago by jonathanslenders

Oké, thanks timo! I'll do that next time!

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