<div class="projectdetail" data-ng-controller="ProjectDetailCtrl as project">
    <div class="row fullheight">


        <div class="col-sm-6 col-md-8 fullheight">
            <div class="row detail-top-bar">
                <div class="col-sm-12 fullheight">
                    <div class="panel panel-default fullheight shadow-0 bg-primary">
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-sm-8">
                                    <h1>
                                    <span data-in-place-edit
                                          data-api-id="project.project.id"
                                          data-api-name="'project'"
                                          data-ipe-key="'name'"
                                          data-ipe-value="project.project.name"
                                          data-ipe-name="'global.name'|translate"
                                          data-ipe-deletable="false"
                                            ></span>
                                    </h1>
                                </div>
                                <div class="col-sm-4">
                                    <div class="pull-right">
                                        <i class="state-icon state-icon-{{project.project.state}}"></i>
                                    </div>
                                </div>
                            </div>
                            {{project.project.state|amaStates:'project'|translate}}
                            <button data-ng-if="project.emptyProject" class="btn btn-danger btn-link btn-icon-round" data-ng-click="project.deleteProject()" title="{{'projects.actions.delete'|translate}}"><i class="md md-delete"></i></button>
                            <button data-ng-if="!project.emptyProject" class="btn btn-warning btn-link btn-icon-round" data-ng-click="project.changeState(8, project.wasArchived)" title="{{'projects.actions.archiveProject'|translate}}"><i class="md md-archive"></i></button>

                        </div>
                    </div>
                </div>
            </div>
            <div class="under-detail-top-bar next-fullheight">
                <div class="panel panel-default shadow-3 fullheight">
                    <div class="panel-body fullheight scroll-y">

                        <div class="row">
                            <div class="col-md-6 col-sm-12">
                                <div class="row">
                                    <div class="col-sm-1 col-md-1">
                                        <h3 class="sidelabel">
                                            <i class="md md-assignment"></i>
                                        </h3>
                                    </div>
                                    <div class="col-sm-11 col-md-11">
                                        <div class="detail-block">
                                            <h3>{{'projects.offers'|translate}}
                                                <a title="{{'projects.newOffer'|translate}}" data-ui-sref="app.offerCreation({project:{ id: project.project.id, name: project.project.name}, referrer:'app.projectDetail', referrerParams: {id:project.project.id}})">
                                                    <i class="md-add-circle-outline"></i>
                                                </a></h3>
                                            <div class="listinfo-row listinfo-link" data-ng-repeat="offer in project.project.offers" data-ui-sref="app.offerDetail({id:{{offer.id}}})">
                                                <div class="row">
                                                    <div class="col-fixedwidth-46">
                                                        <i class="icon-docstate icon-docstate-{{offer.state}}"></i>
                                                    </div>
                                                    <div class="col-beneath-fixedwidth-46">
                                                        {{offer.name}}<br />
                                                        <span class="secondary">{{offer.refnumber}}</span><span class="less-important"> – {{offer.state|amaStates:'offer'|translate}}</span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                            </div>
                            <div class="col-md-6 col-sm-12">
                                <div class="row">
                                    <div class="col-sm-1 col-md-1">
                                        <h3 class="sidelabel">
                                            <i class="md md-description"></i>
                                        </h3>
                                    </div>
                                    <div class="col-sm-11 col-md-11">
                                        <div class="detail-block">
                                            <h3>{{'projects.contracts'|translate}}
                                                <a title="{{'projects.newContract'|translate}}" data-ui-sref="app.contractCreation({project:{ id: project.project.id, name: project.project.name}, referrer:'app.projectDetail', referrerParams: {id:project.project.id}})">
                                                    <i class="md-add-circle-outline"></i>
                                                </a></h3>
                                            <div class="listinfo-row listinfo-link"
                                                 data-ng-repeat="contract in project.contracts" data-ui-sref="app.contractDetail({id:contract.id,type:contract.type})">
                                                <div class="row">
                                                    <div class="col-fixedwidth-46">
                                                        <i class="icon-docstate icon-docstate-{{contract.type}}"></i>
                                                    </div>
                                                    <div class="col-beneath-fixedwidth-46">
                                                        {{contract.name}}<br />
                                                        <span class="secondary">{{contract.refnumber}}</span>
                                                    </div>
                                                </div>


                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6 col-sm-12">
                                <div class="row">
                                    <div class="col-sm-1 col-md-1">
                                        <h3 class="sidelabel">
                                            <i class="md md-list"></i>
                                        </h3>
                                    </div>
                                    <div class="col-sm-11 col-md-11">
                                        <div class="detail-block">
                                            <h3>{{'projects.todos'|translate}}
                                                <a title="{{'projects.newTodo'|translate}}" data-ui-sref="app.todoCreation({project:{ id: project.project.id, name: project.project.name}, referrer:'app.projectDetail', referrerParams: {id:project.project.id}})">
                                                    <i class="md-add-circle-outline"></i>
                                                </a></h3>
                                            <div class="listinfo-row listinfo-link"
                                                 data-ng-repeat="todo in project.project.todos" data-ui-sref="app.todoDetail({id:{{todo.id}}})">
                                                <div class="row">
                                                    <div class="col-fixedwidth-46">
                                                        <i data-ng-if="todo.items_done == todo.items_total" class="icon-docstate icon-docstate-tododone"></i>
                                                        <i data-ng-if="todo.items_done < todo.items_total && !project.checkOverdue(todo.due)" class="icon-docstate icon-docstate-todo"></i>
                                                        <i data-ng-if="todo.items_done < todo.items_total && project.checkOverdue(todo.due)" class="icon-docstate icon-docstate-todooverdue"></i>
                                                    </div>
                                                    <div class="col-beneath-fixedwidth-46">
                                                        {{todo.name}}<br />
                                                        <span class="secondary">{{todo.due|amaDate:'dd.MM.yyyy'}}</span><span class="less-important"> – {{todo.items_done}}/{{todo.items_total}}</span>
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6 col-sm-12">
                                <div class="row">
                                    <div class="col-sm-1 col-md-1">
                                        <h3 class="sidelabel">
                                            <i class="md md-assignment-turned-in"></i>
                                        </h3>
                                    </div>
                                    <div class="col-sm-11 col-md-11">
                                        <div class="detail-block">
                                            <h3>{{'projects.acceptances'|translate}}
                                                <a title="{{'projects.newAcceptance'|translate}}" data-ui-sref="app.acceptanceCreation({project:{ id: project.project.id, name: project.project.name}, referrer:'app.projectDetail', referrerParams: {id:project.project.id}})">
                                                    <i class="md-add-circle-outline"></i>
                                                </a></h3>
                                            <div class="listinfo-row listinfo-link" data-ng-repeat="acceptance in project.project.acceptances" data-ui-sref="app.acceptanceDetail({id:{{acceptance.id}}})">
                                                <div class="row">
                                                    <div class="col-fixedwidth-46">
                                                        <i class="icon-docstate icon-docstate-{{acceptance.state}}"></i>
                                                    </div>
                                                    <div class="col-beneath-fixedwidth-46">
                                                        {{acceptance.name}}<br />
                                                        <span class="secondary">{{acceptance.refnumber}}</span><span class="less-important"> – {{acceptance.state|amaStates:'acceptance'|translate}}</span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12 col-sm-12">
                                <div class="row">
                                    <div class="col-sm-1 col-md-05">
                                        <h3 class="sidelabel">
                                            <i class="md md-attach-money"></i>
                                        </h3>
                                    </div>
                                    <div class="col-sm-11 col-md-115">
                                        <div class="detail-block">
                                            <h3>{{'projects.invoices'|translate}}
                                                <a title="{{'projects.newInvoice'|translate}}" data-ui-sref="app.invoiceCreation({project:{ id: project.project.id, name: project.project.name}, referrer:'app.projectDetail', referrerParams: {id:project.project.id}})">
                                                    <i class="md-add-circle-outline"></i>
                                                </a></h3>
                                            <div class="listinfo-row listinfo-link-inside"
                                                 data-ng-repeat="invoice in project.project.invoices">
                                                <div class="listinfo-link" data-ui-sref="app.invoiceDetail({id:{{invoice.id}}})">
                                                    <div class="row">
                                                        <div class="col-fixedwidth-46">
                                                            <i class="icon-docstate icon-docstate-{{invoice.state}}"></i>
                                                        </div>
                                                        <div class="col-beneath-fixedwidth-46">
                                                            {{invoice.name}}<br />
                                                            <span class="secondary">{{invoice.refnumber}}</span><span class="less-important"> – {{invoice.state|amaStates:'invoice'|translate}}</span>
                                                        </div>
                                                    </div>

                                                </div>
                                                <div class="listinfo-row listinfo-link"
                                                     data-ng-repeat="reminder in invoice.reminders" data-ui-sref="app.reminderDetail({id:{{reminder.id}}})">
                                                    <div class="row">
                                                        <div class="col-fixedwidth-46">
                                                            <i class="icon-docstate icon-docstate-{{reminder.state}} icon-docstate-reminder"></i>
                                                        </div>
                                                        <div class="col-beneath-fixedwidth-46">
                                                            {{reminder.name}}<br />
                                                            <span class="secondary">{{reminder.refnumber}}</span><span class="less-important"> – {{reminder.state|amaStates:'reminder'|translate}}</span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>

                </div>
            </div>

        </div>

        <div class="col-sm-6 col-md-4 fullheight">

            <div class="panel panel-default fixedheight-360 shadow-1">
                <div class="panel-heading">
                    <h3>{{'global.estimatedIncome' | translate}}</h3>
                </div>
                <div class="panel-body scroll-y">
                    <div data-payment-stats="project.project.stats"></div>
                </div>
            </div>

            <div class="panel panel-default under-fixedheight-360 shadow-0 ">



                <div class="panel-heading">
                    <div class="slideanim-buttons slideanim2-buttons btn-group-sm pull-right" data-ng-init="project.showPage = 1">
                        <button class="btn btn-link ng-binding" data-ng-class="{active: project.showPage==1}" data-ng-click="project.showPage = 1"><i class="md md-lg md-person"></i> {{'clients.client' | translate}}</button>
                        <button class="btn btn-link ng-binding" data-ng-class="{active: project.showPage==2}" data-ng-click="project.showPage = 2"><i class="md md-lg md-comment"></i> {{'global.description' | translate}}</button>
                    </div>
                </div>
                <div class="panel-body nopadding nooverflow">
                    <div class="slideanim2 fullheight" data-ng-class="{panel2: project.showPage==2, panel3: project.showPage==3}">

                        <div class="slideanim-item fullheight scroll-y">

                            <div data-client-box="project.project.client"></div>

                        </div>

                        <div class="slideanim-item fullheight scroll-y">

                            <div data-in-place-edit
                                   data-api-id="project.project.id"
                                   data-api-name="'project'"
                                   data-ipe-key="'description'"
                                   data-ipe-value="project.project.description"
                                   data-ipe-name="'global.description'|translate"
                                   data-ipe-type="'textarea'">
                            </div>

                        </div>

                    </div>
                </div>
            </div>

        </div>
    </div>
</div>