view foodtruck/templates/settings.html @ 587:d4a01a023998

admin: Add "FoodTruck" admin panel from the side experiment project.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 16 Jan 2016 14:24:35 -0800
parents
children c2708f20a87b
line wrap: on
line source

{% set title = 'Settings' %}

{% extends 'layouts/default.html' %}

{% block content %}
<div class="container">
{% for sec in sections %}
<form action="{{url_settings}}" method="POST">
    <h2>{{sec.title}}</h2>
    <input type="hidden" name="_section" value="{{sec.name}}" />

    {% for op in sec.options %}
    <div class="form-group">
        {% if op.type == 'checkbox' %}
        <div class="checkbox">
            <label><input type="checkbox" name="{{op.name}}" value="true" {%if op.value == 'true'%}checked="true"{%endif%} />{{op.title}}</label>
        </div>
        {% else %}
        <div class="input-group">
            <span class="input-group-addon" id="ft-setting-{{op.name}}">{{op.title}}</span>
            <input type="{{op.type}}" class="form-control" aria-describedby="ft-setting-{{op.name}}" name="{{op.name}}" value="{{op.value}}" />
        </div>
        {% endif %}
    </div>
    {% endfor %}

    <button type="submit" name="_do_save" class="btn btn-success">Save Changes</button>
</form>
{% endfor %}
<form action="{{url_reload_settings}}" method="POST">
    <h2>Reload Settings</h2>
    <p>This will reload settings from the configuration file.</p>
    <button type="submit" name="_do_reload" class="btn btn-info">Reload Settings</button>
</form>
</div>
{% endblock %}