{% extends "layout/default.html" %}

{% set title = _("Widgets") %}

{% block body %}
<div class="card-panel white">
	<h1>{{ _("Widgets") }}</h1>
	<h3>{{_("Add")}}</h3>

	<form action="" method="post">
		<label for="box" >{{_("Widgets")}}</label>
		<select name="box" class="browser-default">
			{% for box in list %}
					<option value="{{box.name}}|{{box.url}}|{{box.see_more}}">{{box.name}}</option>
			{% endfor %}
		</select>
		<button type="submit" class="btn {{buttonColor}}">{{_("Add")}}</button>
	</form>


  <div class="row">
			{% for box in boxs %}
			<div class="col s4">
			  <div class="card {{ box.color }}">
					<div class="card-content white-text">
			      <span class="card-title">{{_(box.name)}}</span>
						<a href="{{ url_for('core.widget_delete' , id=box.id) }}" class="secondary-content"><i class="fa fa-times" aria-hidden="true"></i></a>
						<p>{{ get_widget(box.url)|safe }}</p>
					</div>
					<div class="card-action">
						<a href="{{url_for(box.see_more)}}">{{_("See More")}}</a>
					</div>
				</div>
			</div>
			{% endfor %}
  </div>

</div>
{% endblock %}
