{% import 'components/hljs.html' as hljs %}

Drag & Drop

{% set items = [{ image: "assets/images/stories/256_rsz_phil-hearing-769014-unsplash.jpg", title: "Learn How To Operate a JVC Camera", date: "November 10, 2018", avatar: "assets/images/256_rsz_nicolas-horn-689011-unsplash.jpg" }, { image: "assets/images/stories/256_rsz_thomas-russell-751613-unsplash.jpg", title: "Selective Focus Photography With iPhone", date: "November 11, 2018", avatar: "assets/images/256_rsz_sharina-mae-agellon-377466-unsplash.jpg" }, { image: "assets/images/stories/256_rsz_ross-sneddon-798476-unsplash.jpg", title: "Learn Amazing Macro Photography", date: "November 13, 2018", avatar: "assets/images/256_rsz_florian-perennes-594195-unsplash.jpg" }] %}
{% for item in items %}
Avatar
{{ item.date }}
{{ item.title }}
more_vert
{% endfor %}
{% set leftCards = [{ name: "Jenell D. Matney", title: "Founder and CEO", image: "assets/images/256_rsz_nicolas-horn-689011-unsplash.jpg" }, { name: "Sherri J. Cardenas", title: "Software Engineer", image: "assets/images/256_rsz_sharina-mae-agellon-377466-unsplash.jpg" }, { name: "Joseph S. Ferland", title: "Web Designer", image: "assets/images/256_rsz_karl-s-973833-unsplash.jpg" }] %} {% set rightCards = [{ name: "Bryan K. Davis", title: "Web Developer", image: "assets/images/256_rsz_90-jiang-640827-unsplash.jpg" }, { name: "Elizabeth J. Ohara", title: "Business Analyst", image: "assets/images/256_rsz_florian-perennes-594195-unsplash.jpg" }, { name: "Kaci M. Langston", title: "Human Resources", image: "assets/images/256_rsz_james-gillespie-714755-unsplash.jpg" }] %}

Containers

Add the data attribute data-dragula-containers='["#cards-left", "#cards-right"]' to allow the user to drag an element in any of the containers and drop it in any other container in the list.

{% import "components/user-feedback.html" as feedback %}
Container #1
{% for card in leftCards %} {{ feedback.component(card) }} {% endfor %}
Container #2
{% for card in rightCards %} {{ feedback.component(card) }} {% endfor %}

Handles

Add the data attribute data-dragula-moves="js-dragula-handle" to allow the user to drag an element in any of the containers and drop it in any other container in the list using a handle.

{% import "components/user-handle.html" as user %}
Container #1
{% for card in leftCards %} {{ user.component(card) }} {% endfor %}
Container #2
{% for card in rightCards %} {{ user.component(card) }} {% endfor %}