Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qute iterating by number #6963

Closed
lordofthejars opened this issue Feb 3, 2020 · 1 comment · Fixed by #6971
Closed

Qute iterating by number #6963

lordofthejars opened this issue Feb 3, 2020 · 1 comment · Fixed by #6971
Labels
area/qute The template engine kind/enhancement New feature or request
Milestone

Comments

@lordofthejars
Copy link
Contributor

Description

Iterate by a number instead of by a list of elements.

Implementation ideas

{#repeat var.total}
   ...
{/repeat}

I think we could do things more complex like in FreeMarker but at least having this structure would help a lot in some cases.

@lordofthejars lordofthejars added the kind/enhancement New feature or request label Feb 3, 2020
@gastaldi
Copy link
Contributor

gastaldi commented Feb 3, 2020

Maybe the for statement could be smart enough to detect if the variable is a Number and iterate through that instead:
Eg.

Having total = 3:

    {#for i in total} 
      {i}
    {/for}

Would output

  1
  2 
  3

Whereas:

    {#for i in total desc} 
      {i}
    {/for}

Would output

   3
   2
   1

@mkouba mkouba added the area/qute The template engine label Feb 3, 2020
@mkouba mkouba added this to the 1.3.0 milestone Feb 3, 2020
@gsmet gsmet modified the milestones: 1.3.0, 1.3.0.Alpha1 Feb 4, 2020
DaHoC pushed a commit to DaHoC/quarkus that referenced this issue Jul 4, 2024
DaHoC pushed a commit to DaHoC/quarkus that referenced this issue Jul 4, 2024
DaHoC pushed a commit to DaHoC/quarkus that referenced this issue Jul 4, 2024
DaHoC pushed a commit to DaHoC/quarkus that referenced this issue Jul 4, 2024
DaHoC pushed a commit to DaHoC/quarkus that referenced this issue Jul 4, 2024
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Jul 31, 2024
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants