{{!
  Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.

  WSO2 Inc. licenses this file to you under the Apache License,
  Version 2.0 (the "License"); you may not use this file except
  in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied. See the License for the
  specific language governing permissions and limitations
  under the License.
}}
{{unit "cdmf.unit.ui.title" pageTitle="Add Certificate"}}
{{unit "cdmf.unit.ui.modal"}}

{{#zone "breadcrumbs"}}
    <li>
        <a href="{{@app.context}}/">
            <i class="icon fw fw-home"></i>
        </a>
    </li>
    <li>
        <a href="{{@app.context}}/certificates">
           Certificate
        </a>
    </li>
{{/zone}}

{{#zone "navbarActions"}}
    {{#if removePermitted}}
        <li>
            <a href="{{@app.context}}/certificates/add">
            <span class="fw-stack">
               <i class="fw fw-circle-outline fw-stack-2x"></i>
               <i class="fw fw-document fw-stack-1x"></i>
            </span>
                Add Certificate
            </a>
        </li>
    {{/if}}
{{/zone}}

{{#zone "content"}}
    {{unit "cdmf.unit.data-tables-extended"}}

    <!-- content -->
    <div id="loading-content" class="col-centered">
        {{#if removePermitted}}
            <input type="hidden" id="can-remove" value="true"/>
        {{/if}}
        {{#if viewPermitted}}
            <input type="hidden" id="can-view" value="true"/>
        {{/if}}
        <i class="fw fw-settings fw-spin fw-2x"></i>
        Loading Certificates . . .
        <br>
    </div>

    <div id="certificate-listing-status" class="raw hidden">
        <ul style="list-style-type: none;">
            <li class="message message-info" >
                <h4>
                    <i class="icon fw fw-info"></i>
                    <a id="certificate-listing-status-msg"></a>
                </h4>
            </li>
        </ul>
    </div>

    <div id="certificate-table" class="hidden" data-user={{adminUser}}>
        <table class="table table-striped table-hover list-table display responsive nowrap data-table grid-view"
               id="certificate-grid">
            <thead>
            <tr class="sort-row">
                <th class="no-sort"></th>
                <th>By Serial Number</th>
                <th class="no-sort"></th>
                <th class="no-sort"></th>
            </tr>
            <tr class="filter-row filter-box">
                <th colspan="3">
                    <label class="wr-input-label" for="search-by-certificate">
                        By Serial Number
                    </label>
                    <input id="search-by-certificate" type="text" class="form-control"
                           placeholder="Search By Serial Number">
                </th>
                <th style="vertical-align:bottom;">
                    <button id="search-btn" class="wr-btn">
                        Search
                    </button>
                </th>
            </tr>

            </thead>
            <tbody id="ast-container">

            <br class="c-both"/>
            </tbody>
        </table>
    </div>
    <br class="c-both"/>
    <div id="content-filter-types" style="display: none">
        <div class="sort-title">Sort By</div>
        <div class="sort-options">
            <a href="#">By Serial Number</a>
        </div>
    </div>
{{/zone}}

{{#zone "bottomJs"}}
    <script id="certificate-listing" data-current-user="{{@user.username}}"
            src="{{@page.publicUri}}/templates/certificate-listing.hbs"
            type="text/x-handlebars-template"></script>

    {{js "/js/certificate-listing.js"}}
{{/zone}}
