<div class="col-sm-1"></div>
<div class="col-sm-10">
	<h2 style="text-align: center;"><%=spellList.name%></h2>
	<form class="form" action="/spellList/edit/<%=spellList._id%>" method="POST">
		<div class="form-group">
			<% spells.sort((a,b) => (a.name > b.name) ? 1 : ((b.name > a.name) ? -1 : 0))%> <%;var count = 0;%> <%spells.forEach(spell => { %>
			<div class="col-sm-4">
				<input type="checkbox" name="spell[<%=count%>]" value="<%=spell._id%>" <%if(spellList.spells.includes(spell._id)){%> checked<%}%> />
				<label><%=spell.name%></label>
				<%count+=1%>
			</div>
			<%});%>
		</div>
		<button type="submit" class="btn btn-default">Update</button>
	</form>
</div>
