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


<section class="content" ng-show="views.list">
  <a ng-if="userRole == 'admin'" ng-click="changeView('add')" class="floatRTL btn btn-success btn-flat pull-right marginBottom15">{{phrase.addPage}}</a>  
  <div class="box col-xs-12">
      <div class="box-header">
          <h3 class="box-title">{{phrase.listPages}}</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.ID}}</th>
                  <th>{{phrase.pageTitle}}</th>
                  <th>{{phrase.Status}}</th>
                  <th>{{phrase.Operations}}</th>
              </tr>
              <tr ng-repeat="page in staticPages | filter:searchText">
                  <td>{{page.id}}</td>
                  <td>{{page.pageTitle}}</td>
                  <td>
                    <span ng-show="page.pageActive == 1">{{phrase.Active}}</span>
                    <span ng-show="page.pageActive == 0">{{phrase.Inactive}}</span>
                  </td>
                  <td>
                    <a ng-click="pageActive(page.id)" type="button" class="btn btn-info btn-flat" title="{{phrase.Active}} / {{phrase.Inactive}}" tooltip><i class="fa fa-magic"></i></a>
                    <a ng-click="edit(page.id)" type="button" class="btn btn-info btn-flat" title="{{phrase.Edit}}" tooltip><i class="fa fa-pencil"></i></a>
                    <a ng-click="remove(page,$index)" type="button" class="btn btn-danger btn-flat" title="{{phrase.Remove}}" tooltip><i class="fa fa-trash-o"></i></a>
                  </td>
              </tr>
              <tr ng-show="!staticPages.length"><td class="noTableData" colspan="5">No pages</td></tr>
          </tbody></table>
      </div>
  </div>
</section>

<section class="content" ng-show="views.add">
<a ng-click="changeView('list')" class="floatRTL btn btn-danger btn-flat pull-right marginBottom15">{{phrase.cancelAdd}}</a>  
  <div class="box col-xs-12">
    <div class="box-header">
        <h3 class="box-title">{{phrase.addPage}}</h3>
    </div>
    <div class="box-body table-responsive">
      <form class="form-horizontal" name="addPage" role="form" ng-submit="saveAdd()" novalidate>
        <div class="form-group" ng-class="{'has-error': addPage.pageTitle.$invalid}">
          <label for="inputEmail3" class="col-sm-2 control-label">{{phrase.pageTitle}} * </label>
          <div class="col-sm-10">
            <input type="text" name="pageTitle" ng-model="form.pageTitle" class="form-control" required placeholder="{{phrase.pageTitle}}">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': addPage.pageContent.$invalid}">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.pageContent}}</label>
          <div class="col-sm-10">
            <textarea name="pageContent" class="form-control" ng-model="form.pageContent" required placeholder="{{phrase.pageContent}}" ck-editor></textarea>
          </div>
        </div>
        <div class="form-group">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.Status}}</label>
          <div class="col-sm-10">
            <div class="radio">
                <label>
                    <input type="radio" name="pageActive" value="1" ng-model="form.pageActive" checked="checked" required>
                    {{phrase.Active}}
                </label>
            </div>
            <div class="radio">
                <label>
                    <input type="radio" name="pageActive" value="0" ng-model="form.pageActive" required>
                    {{phrase.Inactive}}
                </label>
            </div>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default" ng-disabled="addPage.$invalid">{{phrase.addPage}}</button>
          </div>
        </div>
      </form>
    </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.editPage}}</h3>
    </div>
    <div class="box-body table-responsive">
      <form class="form-horizontal" name="editPage" role="form" ng-submit="saveEdit()" novalidate>
        <div class="form-group" ng-class="{'has-error': addPage.pageTitle.$invalid}">
          <label for="inputEmail3" class="col-sm-2 control-label">{{phrase.pageTitle}} * </label>
          <div class="col-sm-10">
            <input type="text" name="pageTitle" ng-model="form.pageTitle" class="form-control" required placeholder="{{phrase.pageTitle}}">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': addPage.pageContent.$invalid}">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.pageContent}}</label>
          <div class="col-sm-10">
            <textarea name="pageContent" class="form-control" ng-model="form.pageContent" required placeholder="{{phrase.pageContent}}" ck-editor></textarea>
          </div>
        </div>
        <div class="form-group">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.Status}}</label>
          <div class="col-sm-10">
            <div class="radio">
                <label>
                    <input type="radio" name="pageActive" value="1" ng-model="form.pageActive" checked="checked" required>
                    {{phrase.Active}}
                </label>
            </div>
            <div class="radio">
                <label>
                    <input type="radio" name="pageActive" value="0" ng-model="form.pageActive" required>
                    {{phrase.Inactive}}
                </label>
            </div>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default" ng-disabled="editPage.$invalid">{{phrase.editPage}}</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</section>

<section class="content" ng-show="views.show">
  <div class="box col-xs-12">
    <div class="box-header">
        <h3 class="box-title">{{form.pageTitle}}</h3>
    </div>
    <div class="box-body table-responsive">
      <div ng-bind-html="form.pageContent"></div>
    </div>
  </div>
</section>