<div class="content-wrapper">
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="text-indigo">
                        <go-back/>
                        <i class="fas fa-envelope"></i> Emailtemplate List ({{emailtemplates.length}})
                    </h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a ng-href="{{baseurl}}/dashboard">Home</a></li>
                        <li class="breadcrumb-item active">Emailtemplates</li>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>
    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <div class="card card-indigo card-outline">
                        <div class="card-header border-transparent">
                            <h3 class="card-title">&nbsp;</h3>
                            <div class="card-tools">
                                <div class="btn-group">
                                    <button ng-click="goTo($event,'emailtemplateAdd')" type="button" class="btn bg-indigo"><i class="fas fa-plus"></i> <span class="d-none d-lg-inline-block">Create Email Template</span></button>
                                    <!--<button ng-click="goTo($event,'projectAdd')" type="button" class="btn btn-success"><i class="fas fa-table"></i> <span class="d-none d-lg-inline-block">Create Project</span></button>-->
                                    <button type="button" title="Fullscreen Toggle" class="btn btn-dark toggle-fullscreen"><i class="fas fa-expand"></i></button>
                                    <button type="button" class="btn btn-dark" data-widget="collapse"><i class="fas fa-minus"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="card-body p-0">
                            <div class="table table-responsive">
                                <table id="emailtemplateList" class="table table-bordered table-striped table-sm">
                                    <thead>
                                    <tr>
                                        <th>Key</th>
                                        <th>Subject</th>
                                        <th>Description</th>
                                        <th>Actions</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="emailtemplate in emailtemplates">
                                        <td><span class="nowrap">{{emailtemplate.key}}</span></td>
                                        <td><span class="nowrap">{{emailtemplate.subject}}</span></td>
                                        <td><span class="nowrap">{{emailtemplate.description}}</span></td>
                                        <td>
                                            <div class="btn-group btn-group-sm nowrap">
                                                <button type="button" class="btn btn-xs bg-indigo" ng-click="goToSelf('emailtemplateView',{emailtemplateid:emailtemplate.id})"><i class="fas fa-eye"></i> View/Edit</button>
                                                <button ng-click="openEmailPopup(emailtemplate,$index)" class="btn btn-success btn-xs float-right"><i class="fas fa-envelope"></i> Send Test Mail</button>

                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <script type="text/ng-template" id="DeleteEmailtemplate.html">
        <div class="">
            <div class="modal-header bg-danger">
                <h3 class="modal-title" id="modal-title">Delete Emailtemplate {{data.emailtemplate.first_name}}</h3>
            </div>
            <div class="modal-body" id="modal-body"><p>Are you sure to delete this emailtemplate</p></div>
            <div class="modal-footer bg-danger">
                <button class="btn btn-default" type="button" ng-click="ok()">Yes</button>
                <button class="btn btn-primary" type="button" ng-click="cancel()">No</button>
            </div>
        </div>
    </script>

</div>
<script type="text/ng-template" id="sendEmailTemp77.html"> 
    <div class="modal-header bg-dark"><strong><i class="{{mInfo.head_icon}}"></i> {{ mInfo.head_title }} </strong>
    </div> 
    <div class="modal-body" id="modal-body"> 
        <div class="row"> <div class="form-group col-sm-6"> 
            <label for="emailtemp">Send Test Email</label> </div> 
            <div class="form-group col-sm-3"></div> 
            <div class="form-group col-sm-12"> 
                <!-- Get content of Email template start --> 
                <section class="content"> <div class="row"> 
                    <div class="col-sm-12"> <div class="card card-indigo card-outline"> 
                        <div class="card-body"> <div class="row"> <div class="col-md-12"> 
                            <div class="form-group"> <label for="testHeroEmail">Enter Email-id</label> 
                                <input type="email" id="testHeroEmail" class="form-control" ng-model="testHeroEmail" required placeholder="Enter Email-id"> 
                            </div> 
                        </div> 
                    </div> 
                </div> 
            </div>
         </div> 
        </div> 
    </section> <!-- Get content of Email template end --> 
</div> 
</div>
 <div class="modal-footer p-2">
     <button class="btn btn-danger btn-xs" type="button" ng-click="cancel()"><i class="fas fa-times"></i> Cancel</button> 
     <button class="btn btn-success btn-xs" type="button" ng-click="send()"><i class="{{mInfo.btn_icon}}"></i> {{mInfo.btn_title}}</button> 
    </div> 
</div>
 </script>
