<template name="deviceDetail">
    <div class="col-sm-9">
        <div class="bootcards-cards entity-box device-border">
            <div class="entity-sub">
                <h3>
                    {{name}}
                    {{#if isOwnerOrGrantedRole 'admin'}}
                        <a href="{{pathFor 'deviceEdit'}}" class="btn btn-info edit">
                            <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Edit </a>
                    {{/if}}
                </h3>
            </div>
            <div class="entity-sub">
            <!--{{#if currentUser}}-->
                <!--<a href="{{pathFor 'deviceShare'}}" class="btn btn-primary assemble">-->
                <!--<span class="glyphicon glyphicon-ice-lolly-tasted" aria-hidden="true"></span> Share It </a>-->
                    <!--{{/if}}-->

                <h4>ID : {{_id}}</h4>

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

                <p>owner : {{owner_user_id}}</p>

                <!--<p>Status : {{status}}</p>-->
                <!--<p>Project : {{project_id}}</p>-->

                <p>Share : {{share_label}}</p>

                <p>Create at : {{ formatDate create_time}} , Update at : {{ formatDate last_update_time}}</p>

                {{#unless project_id }}
                    <a href="" class="btn btn-primary selectProject">Choose a Project</a>
                {{/unless}}
            </div>

            <div class="entity-box sub-border">
                <div class="col-sm-12 bootcards-cards">
                    <h4>Images
                        {{#if isOwnerOrGrantedRole 'admin'}}
                            <a href="{{pathFor 'deviceImagesSelect'}}" class="btn btn-info select">
                                <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> Edit </a>
                        {{/if}}
                    </h4>

                    {{#each img_ids}}
                        <div class="col-sm-4">
                            {{> thumbnail id=this}}
                        </div>
                    {{/each}}
                </div>
            </div>

            {{#if project_id }}
                {{> deviceData device_id=_id}}
                {{> deviceControl device_id=_id}}
            {{/if}}

            {{#if isOwnerOrGrantedRole 'admin'}}
                <a href="" class="btn btn-danger align-right remove">
                    <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Remove </a>
            {{/if}}
        </div>
    </div>
    <div class="col-sm-3 array-editor">
        <div class="bootcards-cards entity-box project-border">
            <div class="entity-sub">

                <h3>Project</h3>
                {{#with project}}
                    {{> projectSummarySimple }}
                {{/with}}
            </div>
        </div>

        <div class="bootcards-cards entity-box device-border">
            <div class="entity-sub">
                <h3>Other's Devices</h3>
                {{#each publicDevices}}
                    {{> deviceSummarySimple}}
                {{/each}}
            </div>
            <div class="col-sm-6 text-left">
                <a href="{{pathFor 'devicesListPublic'}}" class="btn btn-info align-right">
                    <span class="glyphicon glyphicon-ice-lolly-tasted" aria-hidden="true"></span> All </a>
            </div>
        </div>

    </div>
</template>