Skip to content

Commit

Permalink
Simplify looping over user's recordings with :for attr
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Mar 15, 2024
1 parent 32be2c6 commit da36f63
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/asciinema_web/controllers/user/show.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,9 @@
<% {0, false} -> %>
<% _ -> %>
<div :for={asciicasts <- Enum.chunk_every(@page, 2, 2)} class="row">
<%= for asciicast <- asciicasts do %>
<div class="col-md-6">
<RecordingHTML.card asciicast={asciicast} />
</div>
<% end %>
<div :for={asciicast <- asciicasts} class="col-md-6">
<RecordingHTML.card asciicast={asciicast} />
</div>
</div>
<% end %>
</div>
Expand Down

0 comments on commit da36f63

Please sign in to comment.