 <section class="content-header">
    <h1>
        {{phrase.mailsmsTemplates}}
    </h1>
</section>


<section class="content" ng-show="views.list">
  <div class="box col-xs-12">
      <div class="box-header">
          <h3 class="box-title">{{phrase.listTemplates}}</h3>
          <div class="box-tools">
              <div class="input-group">
                  <input type="text" name="table_search" ng-model="searchText" class="form-control input-sm pull-right" style="width: 150px;" placeholder="{{phrase.Search}}">
                  <div class="input-group-btn">
                      <button class="btn btn-sm btn-default"><i class="fa fa-search"></i></button>
                  </div>
              </div>
          </div>
      </div>
      <div class="box-body table-responsive">
          <table class="table table-hover">
              <tbody><tr>
                  <th>{{phrase.templateTitle}}</th>
                  <th>{{phrase.Operations}}</th>
              </tr>
              <tr ng-repeat="template in templates | filter:searchText">
                  <td>{{template.templateTitle}}</td>
                  <td>
                    <a ng-click="edit(template.id)" type="button" class="btn btn-info btn-flat" title="{{phrase.Edit}}" tooltip><i class="fa fa-pencil"></i></a>
                  </td>
              </tr>
              <tr ng-show="!templates.length"><td class="noTableData" colspan="4">{{phrase.noTemplates}}</td></tr>
          </tbody></table>
      </div>
  </div>
</section>

<section class="content" ng-show="views.edit">
  <a ng-click="changeView('list')" class="floatRTL btn btn-danger btn-flat pull-right marginBottom15">{{phrase.cancelEdit}}</a> 
  <div class="box col-xs-12">
    <div class="box-header">
        <h3 class="box-title">{{phrase.editTemplate}} : {{form.templateTitle}}</h3>
    </div>
    <div class="box-body table-responsive">
      <form class="form-horizontal" name="editDorm" role="form" ng-submit="saveEdit()" novalidate>
        <div class="form-group">
          <label for="inputEmail3" class="col-sm-2 control-label">{{phrase.templateVars}} </label>
          <div class="col-sm-10">
             {{form.templateVars}}
          </div>
        </div>
        <div class="form-group">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.mailTemplate}}</label>
          <div class="col-sm-10">
            <textarea ck-editor name="templateMail" class="form-control" ng-model="form.templateMail" placeholder="{{phrase.mailTemplate}}"></textarea>
          </div>
        </div>
        <div class="form-group">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.smsTemplate}}</label>
          <div class="col-sm-10">
            <textarea name="templateSMS" class="form-control" ng-model="form.templateSMS" placeholder="{{phrase.smsTemplate}}"></textarea>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default" ng-disabled="editDorm.$invalid">{{phrase.editTemplate}}</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</section>