{% extends "keydetail/base.html" %}
{% block keydetail %}
<div class="card-header">
    <h4></h4>
    <div class="card-header-action">
        <a href="#" class="btn btn-primary" id="hash-add-btn"><i class="fas fa-plus"></i>Add</a>
    </div>
</div>
<div class="card-body">
    <table class="table table-striped">
        <tr>
            <th class="text-center" style="width: 30%">Index</th>
            <th class="text-center" style="width: 60%">Value</th>
            <th class="text-center"></th>
        </tr>
        {% for index, value in key_details.data %}
        <tr>
            <td class="text-center">{{index}}</td>
            <td class="text-center">
                {% set url=url_for('redisboard.hash_edit_value', db=db, key=key_details.name|quote_plus) %}
                <a href="#" class="myeditable" data-name="{{index}}" data-type="text" data-url="{{url}}">{{value}}</a>
            </td>
            <td class="text-center">
                <a href="#" onclick="hash_del('{{index}}')" class="btn btn-danger"><i class="fas fa-trash"></i></a>
            </td>
        </tr>
        {% endfor %}
    </table>

</div>
<div class="card-footer text-right">

</div>

<form class="modal-part" id="hash-add-value">
    <div class="form-group">
        <label>Index</label>
        <input type="text" class="form-control" name="index">
    </div>
    <div class="form-group">
        <label>Value</label>
        <div class="input-group">
            <input type="text" class="form-control" name="value">
        </div>
    </div>
</form>
{% endblock %}