Opened 22 months ago

Closed 21 months ago

Last modified 21 months 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 21 months ago.
Patch + unit tests + docstring updated.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 21 months 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 21 months 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 21 months ago by timo

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

comment:5 Changed 21 months 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 21 months ago by clay.evil@…

Good job, Thank you all!

comment:7 Changed 21 months 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 21 months ago by jonathanslenders (previous) (diff)

Changed 21 months ago by jonathanslenders

Patch + unit tests + docstring updated.

comment:8 Changed 21 months ago by jonathanslenders

  • Triage Stage changed from Accepted to Ready for checkin

Should be okay now.

comment:9 Changed 21 months 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 21 months 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 21 months ago by jonathanslenders

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

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