<div class="col-sm-3"></div>
<div class="col-sm-6">
    <% function nth(n){return["st","nd","rd"][((n+90)%100-10)%10-1]||"th"}%>
<h1><%= spell.name%> (<%= spell.source_book.short_name%>)</h1>

<div><b>
    <% if(spell.level==0){%>
        Cantrip
    <%} else{%>
        <%=spell.level%><%= nth(spell.level)%> Level 
    <%}%>
    <%=spell.school%>
</b>
</div>
<div><b>
    Casting Time:</b>
    <% if(spell.cast_time.len == 0) { %>
    <%}else{%>
        <%= spell.cast_time.len%>
        <%if(spell.cast_time.unit === "ac"){%> Action<%}%>
        <%if(spell.cast_time.unit === "ra"){%> Reaction<%}%>
        <%if(spell.cast_time.unit === "ba"){%> Bonus Action<%}%>
        <%if(spell.cast_time.unit === "min"){%> Minute(s)<%}%>
        <%if(spell.cast_time.unit === "hr"){%> Hour(s)<%}%>
    <%}%>
    <% if(spell.cast_time.ritual){%>
        ritual
    <%}%>

</div>
<div><b>
    Components: </b>
    <% if(spell.components.V) {%>V,<%}%>
    <% if(spell.components.S) {%>S,<%}%>
    <% if(spell.components.M !== "") {%>M (<%=spell.components.M%>)<%}%>
</div>
<div><b>

</b>
</div>
<div><b>Range:</b>
    <%if (spell.range == 0){%> Touch <%}%>
    <%if (spell.range == -1){%> Self <%}%>
    <%if (spell.range > 0){%> <%= spell.range%>ft. <%}%>
</div>
<div><b>
    Duration:</b>
    <% if(spell.duration.concentration) {%>
        Concentration, up to
        <%}%>
    <% if(spell.duration.len == 0) { %>    
        <%if(spell.duration.unit === "dis"){%>
            Until Dispelled
        <% } else if(spell.duration.unit === "spe"){ %> 
            Special
        <%}else{%>
            Instantaneous
        <% } %> 
    <%}else{%>
        <%= spell.duration.len%>
        <%if(spell.duration.unit === "rnd"){%> Round(s)<%}%>
        <%if(spell.duration.unit === "min"){%> Minute(s)<%}%>
        <%if(spell.duration.unit === "hr"){%> Hour(s)<%}%>
        <%if(spell.duration.unit === "day"){%> Day(s)<%}%>
    <%}%>
</div>

<div><%- spell.description%></div>
<% if(spell.at_higher_level !== "" && spell.at_higher_level != null){%>
<h3>At Higher Levels</h3>
<%- spell.at_higher_level %>
<%}%>
<br>
<a class="btn btn-primary" href="/content/spell/edit/<%=spell._id%>" role="button">Edit Spell</a>
</div>