Opened 3 years ago

Closed 3 years ago

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

Download all attachments as: .zip

Change History (12)

comment:1 Changed 3 years ago by Tim Graham

Summary: widthratio tag to accept "as" parameter to put result to the template contextAllow widthratio tag to accept "as" parameter to put result in the template context
Triage Stage: UnreviewedAccepted

comment:2 Changed 3 years ago by jonathanslenders

Owner: changed from nobody to jonathanslenders
Status: newassigned

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 3 years ago by Tim Graham

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

comment:4 Changed 3 years ago by jonathanslenders

comment:5 Changed 3 years ago by Tim Graham

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 3 years ago by clay.evil@…

Good job, Thank you all!

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

Changed 3 years ago by jonathanslenders

Attachment: widthratio-as.patch added

Patch + unit tests + docstring updated.

comment:8 Changed 3 years ago by jonathanslenders

Triage Stage: AcceptedReady for checkin

Should be okay now.

comment:9 Changed 3 years ago by Tim Graham

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 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In ff410565bf1cf1a2905c1ef83db408d455211446:

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

Thanks clay.evil@ for the suggestion.

comment:11 Changed 3 years ago by jonathanslenders

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

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