ref: canary
core/templates/cycles.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48  | 
{% extends "layout.html" %}
{% block body %}
{% if current_cycle or closed_cycles %}
	<section class="cycles">
	  <h1>Ciclo em aberto</h1>
	  <section>
		<div class="{{ "box" if current_cycle.status.value == 'published' }}">
		  <strong>Compras:</strong> {{ current_cycle.start_at.strftime("%A, %d/%m") }} até {{ current_cycle.end_at.strftime("%A, %d/%m") }}
		  {% if current_cycle.status.value == 'published' %}
			<strong class="pl-5 f-right"> ACONTECENDO </strong>
		  {% endif %}
		</div>
		<div class="{{ "box" if current_cycle.status.value == 'delivery' }}">
		  <strong>Entrega:</strong> {{ current_cycle.delivery_start_at.strftime("%d/%m/%Y ") }} até {{ current_cycle.delivery_end_at.strftime("%d/%m/%Y") }}
		  {% if current_cycle.status.value == 'delivery' %}
			<strong class="pl-5 f-right"> ACONTECENDO </strong>
		  {% endif %}
		</div>
	  </section>
	  <div class="cycle">
		<h2>{{ current_cycle.title }}</h2>
		<p class="white-space-pre">{{ current_cycle.description }}</p>
		<a href="{{url_for('cycles.show', id = current_cycle.id)}}">Ver ciclo</a>
		<a href="{{url_for('cycles.close', id = current_cycle.id)}}">Fechar ciclo</a>
	  </div>
	</section>
	<section class="closed-cycles">
	  <h1>Ciclos passados</h1>
	  {% if closed_cycles %}
		  {% for cycle in closed_cycles %}
			<div class="cycle">
			  <h2>{{ cycle.name }}</h2>
			  <em>Ciclo fechado em {{ cycle.delivery_end_at.strftime("%d/%m/%Y") }} </em>
			</div>
		 {% endfor %}
	 {% else %}
		<h2> Nenhum ciclo encerrado ainda </h2>
	 {% endif %}
	</section>
{% else %}
<h1> Nenhum ciclo criado </h1>
<div>
	<a href="{{ url_for('cycles.new') }}"> Abrir novo Ciclo </a>
</div>
{% endif %}
{% endblock %}
 |