<template name="modulesList">
    <h3><span class="glyphicon glyphicon-tree-deciduous" aria-hidden="true"></span> Modules </h3>

    <div>
        {{#each modules}}
            {{> moduleSummary}}
        {{/each}}

        {{#if currentUser}}
            {{> moduleAdd}}
        {{/if}}
    </div>
</template>

<template name="moduleSummary">
    <div class="col-sm-4">
        <div class="bootcards-cards entity-box module-border">
            <div class="entity-sub">
                <h3>{{name}}</h3>
            </div>
            <div class="entity-sub">
                <!--<h4>ID : {{_id}}</h4>-->

                <a href="{{pathFor 'moduleDetail'}}" class="btn btn-info detail">
                    <span class="glyphicon glyphicon-sunglasses" aria-hidden="true"></span> Details </a>

                {{#if currentUser}}
                    <a href="{{pathFor 'myModuleSubmit'}}" class="btn btn-primary have">
                        <span class="glyphicon glyphicon-tree-conifer" aria-hidden="true"></span> Have It </a>
                {{/if}}

                <p>{{desc}}</p>

                <div style="text-align: center">
                    {{> thumbnail id=img_id}}
                </div>
            </div>
        </div>
    </div>
</template>

<template name="moduleAdd">
    <div class="col-sm-4">
        <div class="bootcards-cards entity-box module-border">
            <div class="entity-sub">
                <h3>Create New Module</h3>
            </div>
            <div class="entity-sub">
                <p>Create A New Module</p>
                <a href="{{pathFor 'moduleSubmit'}}" class="btn btn-success create">
                    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Create </a>
            </div>
        </div>
    </div>
</template>

