{% extends "scon/base.html" %}

{% block context %}
<img src="{{MEDIA_URL}}scon/conflict-logo.png" style="position: absolute; float:left; top: -42px;">
<h1 style="margin-left: 160px;">Crafting Overview</h1>

	{% for item in items %}
	{% if item.primary_recipee %}
	<div class="row">
	
	<div class="col1 col">
		<div class="panel item">
		{% if item.icon %}<img src="{{ MEDIA_URL }}scon/icons/{{ item.icon }}.png">{% endif %} {{ item.name }}
		{% if item.sell_price %}<br><i>Sell: {{item.sell_price}} cr</i>{% endif %}
		</div>
	</div>

	{% with item.primary_recipee as recipee %}
	<div class="col2 col">&nbsp;
		<div class="arrowright nobreak">{% if recipee.amount > 1 %}{{ recipee.amount }}{% endif %}</div>
	</div>
	
	<div class="col3 col">
			<div class="nobreak">
			<div class="panel item nobreak">
			{% if recipee.output.icon %}<img src="{{ MEDIA_URL }}scon/icons/{{ recipee.output.icon }}.png">{% endif %} {{ recipee.output.html }}
			{% if recipee.output.sell_price %}<br><i>Sell: {{recipee.output.sell_price}} cr</i>{% endif %}
			</div>
			<div class="panel-light item-sub nobreak">
				<ul>
				{% for ingredient in recipee.ingredients %}
					<li>{{ ingredient.amount }} x {{ ingredient.item.html }}</li>
				{% endfor %}
				</ul>
			</div>
			</div>
	</div>
	
	<div class="col4 col">
		<ul class="remarks">
			{% for i1 in item.crafting_used_in %}
			{% with i1.crafting.output as ci %}
			{% if ci.pk != recipee.output.pk %}
			<li>{{ ci.html }}</li>
			{% endif %}
			{% for i2 in ci.crafting_used_in %}
			<li><i>{{ i2.crafting.output.html }} ({{ci.html}})</i></li>
			{% endfor %}
			{% endwith %}
			{% endfor %}
		</ul>
	</div>
		{% endwith %}
	</div>
	<span class="breakable">&nbsp;</span>
	{% endif %}
	{% endfor %}
{% endblock context %}