{{ header }}{{ column_left }}
<!-- Content Wrapper. Contains page content -->
<div id="content" class="content-wrapper">
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <div>
      <div class="pull-right"></div>
      <h1>
        {{ heading_title }}
      </h1>
    </div>
    <div class="row">
      <div class="col-sm-12">
        <ul class="breadcrumb">
          {% for breadcrumb in breadcrumbs %}
          <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
          {% endfor %}
        </ul>
      </div>
    </div>
  </section>

  <!-- Alert -->
  <section class="content-header">
    {% if error_warning %}
    <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    {% endif %}
    {% if success %}
    <div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    {% endif %}
  </section>
  <!-- /.alert -->

  <!-- Main content -->
  <section class="content">

    <!-- Default box -->
    <div class="box">
      <div class="box-header with-border">
        <h3 class="box-title">{{ text_list }}</h3>

        <div class="box-tools pull-right">
          <button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="{{ text_collapse }}">
            <i class="fa fa-minus"></i></button>
        </div>
      </div>
      <div class="box-body">
        <div class="well">
          <div class="row">
            <div class="col-sm-12">
              <form action="{{ add }}" method="post" id="add-profile-form" class="form-inline pull-right" role="form">
                <input type="hidden" name="step1" value="1" />
                <div class="form-group">
                  <div class="input-group">
                    <select name="type"class="form-control">
                      {% for key, val in types %}


                        <option value="{{ key }}">{{ val.name }}</option>
                      {% endfor %}
                    </select>
                    <a data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary input-group-addon" onclick="$('#add-profile-form').submit();"><i class="fa fa-plus-circle"></i> {{ button_add }}</a>
                  </div>
                </div>
              </form>
            </div>
          </div>
        </div>
        <table class="table table-bordered table-hover">
          <thead>
            <tr>
              <td class="text-left">{{ text_profile_name }}</td>
              <td class="text-left">{{ text_profile_type }}</td>
              <td class="text-left">{{ text_profile_desc }}</td>
              <td class="text-left"></td>
            </tr>
          </thead>
          <tbody>
          {% if profiles %}
          {% for profile in profiles %}
          <tr>
            <td class="text-left">{% if profile.default == 1 %} <strong>[{{ text_profile_default }}]</strong> {% endif %} {{ profile.name }}</td>
            <td class="text-left">{{ types[profile.type].name }}</td>
            <td class="text-left">{{ profile.description }}</td>
            <td class="text-right">
              <a href="{{ profile.link_edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a>&nbsp;
              <a href="{{ profile.link_delete }}" data-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger profile-delete"><i class="fa fa-minus-circle"></i></a>
            </td>
          </tr>
          {% endfor %}
          {% else %}
          <tr>
            <td class="text-center" colspan="4">{{ text_no_results }}</td>
          </tr>
          {% endif %}
          </tbody>
        </table>
      </div>
      <!-- /.box-body -->
    </div>
    <!-- /.box -->

  </section>
  <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<script type="text/javascript"><!--
$(document).ready(function () {
  $('a.profileDelete').click(function (event) {
    event.preventDefault();
    var url = $(this).attr('href');
    var confirm_box = confirm('{{ text_confirm_delete }}');
    if (confirm_box) {
      window.location = url;
    }
  });
});
//--></script>
{{ footer }}
