{% extends "templates/base.jinja2" %}

{% block content %}
    <h1 class="view">Console <small>Interactive candies</small></h1>
    <script type="text/javascript">
        var bconsole_url = '{{ request.route_url('console_ajax') }}';
    </script>
    <div id="console" class="alert alert-info block-message">
    </div>
    <div class="row-fluid">
      <div class="span11">
          <input id="command" value="" class="span12"
              data-provide="typeahead"
              data-source='[{{ command_array }}]'
              />
      </div>
      <div class="span1">
          <button id="command-btn" class="btn btn-primary">Send</button>
      </div>
    </div>
{% endblock %}

{% block sidebar %}
    <h1 class="view">Commands</h1>
    <table id="command_help" class="table table-striped table-bordered table-condensed datatables">
        <thead>
            <tr>
                <th>command</th>
                <th>description</th>
            </tr>
        </thead>
        <tbody>
            {% for data in console_commands.items() %}
                <!-- escape help of commands because .html() with unescape html entities so we have to double escape our help text. -->
                <tr data-original-title="Parameters" data-content="{{ data[1].help|forceescape|forceescape }}">
                    <td>{{ data[0]  }}</td> <td>{{ data[1].desc }}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endblock %}
