Opened 11 years ago

Closed 11 years ago

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

Download all attachments as: .zip

Change History (12)

comment:1 by Tim Graham, 11 years ago

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 by jonathanslenders, 11 years ago

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

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

comment:5 by Tim Graham, 11 years ago

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

Good job, Thank you all!

comment:7 by jonathanslenders, 11 years ago

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

Version 0, edited 11 years ago by jonathanslenders (next)

by jonathanslenders, 11 years ago

Attachment: widthratio-as.patch added

Patch + unit tests + docstring updated.

comment:8 by jonathanslenders, 11 years ago

Triage Stage: AcceptedReady for checkin

Should be okay now.

comment:9 by Tim Graham, 11 years ago

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

Resolution: fixed
Status: assignedclosed

In ff410565bf1cf1a2905c1ef83db408d455211446:

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

Thanks clay.evil@ for the suggestion.

comment:11 by jonathanslenders, 11 years ago

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

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