#208 closed enhancement (fixed)
Allow the strings the cycle tag uses to contain spaces
Reported by: | anonymous | Owned by: | Chris Beaven |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | normal | Keywords: | sprintsept14 |
Cc: | espen@… | 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
I would like to be able to use the cycle tag like so:
{% cycle <td class="tdClass">,</tr><tr><td class="tdClass"> %}
The current cycle tag (as I understand it) does not allow spaces or a way to escape spaces.
Attachments (5)
Change History (22)
comment:1 by , 19 years ago
comment:3 by , 19 years ago
Now that we have an intelligent string splitter in the template system, I'd like to change cycle
in a backwards-incompatible way, so that you'd pass in strings, separated by spaces. Examples:
{% cycle 'value 1' 'value 2' %}
{% cycle 'value 1' 'value 2' 'value 3' %}
{% cycle 'value 1' 'value 2' as foo %}
Variables would be allowed as the cycle values, too:
{% cycle some_var 'some value' %}
comment:4 by , 19 years ago
Status: | new → assigned |
---|
comment:5 by , 18 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Marking as accepted since Adrian stated how he would like this tag to change.
by , 18 years ago
Patch that changes behavior of cycle tag according to Adrian's description.
comment:6 by , 18 years ago
Has patch: | set |
---|---|
Version: | → SVN |
comment:7 by , 18 years ago
I found a bug in the admin interface while using the patch attached to this ticket. I also looked around for more of the same bug in the admin interface but could not find any. Will upload a new patch that fixes this bug.
comment:8 by , 18 years ago
Summary: | Allow the strings the cycle tag uses to contain spaces. → [patch]Allow the strings the cycle tag uses to contain spaces. |
---|
comment:9 by , 18 years ago
Summary: | [patch]Allow the strings the cycle tag uses to contain spaces. → Allow the strings the cycle tag uses to contain spaces. |
---|
No need to put [patch] in the title any longer. We have the "has patch" flag for that purpose.
comment:10 by , 18 years ago
I'd like to see this with backwards compatibility which is possible: After checking for as something
, you can see if there's only one bit left with commas, in which case use the old method.
comment:11 by , 18 years ago
Cc: | added |
---|
comment:12 by , 17 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
by , 17 years ago
Attachment: | 208-update-templates.patch added |
---|
separate patch which should be applied - updates admin and databrowse templates to use new format
comment:13 by , 17 years ago
Summary: | Allow the strings the cycle tag uses to contain spaces. → Allow the strings the cycle tag uses to contain spaces |
---|---|
Triage Stage: | Accepted → Ready for checkin |
comment:14 by , 17 years ago
Keywords: | cycle removed |
---|
So just to clarify, 208.patch
contains just the code and 208-update-templates.patch
contains just the template changes.
comment:16 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:17 by , 17 years ago
Keywords: | sprintsept14 added |
---|
I think this would be better handled with a blockcycle tag.
Eg
{%blockcycle %}
{%next%}
{%endblockcycle %}
Not that I'm sure this example is very good....