<template name="projectsList">
    <div class="col-sm-12">
        <h3><span class="glyphicon glyphicon-ice-lolly" aria-hidden="true"></span> Projects
            {{#if currentUser}}
                <a href="{{pathFor 'projectSubmit'}}" class="btn btn-success create">
                    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Create </a>
            {{/if}}
        </h3>
    </div>

    <div>
        {{#each projects}}
            <div class="col-sm-3">
                {{> projectSummary}}
            </div>
        {{/each}}

        {{#if Template.subscriptionsReady}}
            {{#if hasMoreEntities}}
                <div class="col-sm-12">
                    <a class="load-more" href="#">Load More</a>
                </div>
            {{/if}}
        {{else}}
            <div class="col-sm-12">
                <div class="loading">{{>spinner}}</div>
            </div>
        {{/if}}
    </div>
</template>

<template name="projectSummary">

    <div class="bootcards-cards entity-card project-border">
        <div class="entity-title">
            <h3>{{name}}</h3>
        </div>
        <div class="entity-sub">
            <a href="{{pathFor 'projectDetail'}}" class="btn btn-info detail">
                <span class="glyphicon glyphicon-sunglasses" aria-hidden="true"></span> Details </a>

            {{#if currentUser}}
                <a href="{{pathFor 'deviceSubmit'}}" class="btn btn-primary assemble">
                    <span class="glyphicon glyphicon-ice-lolly-tasted" aria-hidden="true"></span> Made It </a>
            {{/if}}
            <!--<a href="{{pathFor 'buyProject'}}" class="discuss btn btn-primary buy">Buy</a>-->
        </div>
        <div class="entity-desc">
            {{desc}}
        </div>
        <div class="entity-sub">
            {{#with firstIamge}}
                <img src="{{this.url store='thumbs'}}" class="thumbnail"/>
            {{/with}}

            {{#unless firstIamge}}
                <img src="/project.png" class="thumbnail"/>
            {{/unless}}
        </div>
    </div>
</template>

<template name="projectAdd">
    <div class="bootcards-cards entity-card project-border">
        <div class="entity-sub">
            <h3>Create New Project</h3>
        </div>
        <div class="entity-sub">
            <p>Create A New Project</p>
            <a href="{{pathFor 'projectSubmit'}}" class="btn btn-success create">
                <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Create </a>
        </div>
    </div>
</template>