Fork me on GitHub
#beginners
<
2015-06-22
>
gary19:06:08

trying to get Selmer to play nice with Twitter Bootstrap grid system is kind of a pain

gary20:06:26

this template produces three of the same products in a row

gary20:06:34

I'm so rusty at front end stuff that's why I asked this question in beginners

gary20:06:23

Also, I've been spoiled with all the great react wrappers that it's hard going back to html templates, but I want non-clojurians to be able to work on the front end as well so this was the compromise

arrdem20:06:49

gary: nice! I may have to play with selmer...

gary20:06:00

@arrdem: it's nice until you run into a problem like this 0_o

sveri20:06:58

@arrdem: so, what's the problem with it?

sveri20:06:13

that it produces three of the same products?

gary21:06:21

@sveri: yeah, I'm trying to figure out how to make it loop through the products for one row then the next

gary21:06:04

most of the time this is done by mutating the index in a for loop, but I was hoping for something more elegant

sveri21:06:46

@arrdem: Ah, so what you want is to have one product per column and three different products per row?

gary21:06:45

@sveri: yeah, like you see on every e-commerce product page ever

sveri21:06:29

@gary: how about you partition the list on the backend into a list of sublist containing three items? that's the first approach that comes to my mind

sveri21:06:11

(partition-all 3 [1 2 3 4 5 6 7 8]) => ((1 2 3) (4 5 6) (7 8))

gary21:06:46

yeah, I'll have to play with that a bit to see how I'd pull the those out in the template

gary22:06:22

okay I got that working, will have to post another gist later. kinda ugly and couples your back to your front which is a worry