{% extends 'base.html' %}
{% block title %}Chef node: {{ node.name }}{% endblock %}
{% block header %}{{ node.name }} <small>{{ node.chef_environment }}</small>{% endblock %}
{% block body %}
<div class="row">
  <div class="col-md-6">
    <h3>Run list</h3>
    <ul>
    {% for item in node.run_list %}
      <li>
        <code>{{ item }}</code>
      </li>
    {% endfor %}
    </ul>
  </div>

  <div class="col-md-6">
    <h3>Roles</h3>
    <ul>
    {% for role_name in node.roles %}
      <li>
        <a href="{{ url_for('.role', name=role_name) }}">
          <code>{{ role_name }}</code>
        </a>
      </li>
    {% endfor %}
    </ul>
  </div>
</div>

{% if node['rpm_packages'] %}
<div class="row">
  <div class="col-md-12">
    <h3>RPM Packages</h3>
    <table class="table table-condensed table-hover">
      <thead>
        <tr>
          <th>Package</th>
          <th>Version</th>
        </tr>
      </thead>
      <tbody>
      {% for package, version in node['rpm_packages'] | dictsort %}
        <tr>
          <td><code>{{ package }}</code></td>
          <td><code>{{ version }}</code></td>
        </tr>
      {% endfor %}
      </tbody>
    </table>
  </div>
</div>
{% endif %}
{% endblock %}
