{# {% extends "base_admin.html" %} #}

{% extends "admin/index.html" %}
{% load i18n %}
{% load static from staticfiles %}


{% block js %}
	{{ block.super }}
	<script type="text/javascript" src="{% static 'js/lib/sugar-1.3.9-full.development.js' %}"></script>
	<script type="text/javascript" src="{% static 'js/modeltranslation/import.js' %}"></script>
{% endblock js %}

{% block custom-css %}
	{{ block.super }}
	<link rel="stylesheet" href="{% static 'css/modeltranslation/import.css' %}" />
{% endblock %}

{% block head_title %}
	Administrar Traducciones
{% endblock %}

{% block breadcrumbs %}
	<div class="breadcrumbs">
		<a href="{% url 'admin:index' %}" class="first">{% trans "Home"%}</a>  &rsaquo;
		<a href="{% url 'admin:index' %}modeltranslation" class="first">Modeltranslations</a> &rsaquo;
		<a href="{% url 'modeltranslation:admin_url' %}" class="first">{% trans "Translations" %}</a>
		{% block breadcrumb_element %}
		{% endblock breadcrumb_element %}
	</div>
{% endblock breadcrumbs %}

{% block body %}
	<div id="body-content" class="span12">
		<div id="content-title" class="page-header">
			<h1>
				{%block title %}
					Administrar Traducciones
				{% endblock %}
			</h1>
		</div>

		<div id="content" class="">
			{% block content %}
				<div id="translation_admin_list">
					<h2>Lista de idiomas existentes:</h2>
					{% get_language_info_list for LANGUAGES as languages %}
					{% if languages|length > 0 %}
						<ul id="translation_list" class="unstyled">
						{% for lang in languages %}
							{% if LANGUAGE_CODE != lang.code %}
								{% cycle 'odd' 'even' as parity silent %}
								<li id="{{ lang.code }}" class="language {{ parity }}">
									<div class="container-li">
										<div class="btn-toolbar tpv_admin_links_list">
											<div class="btn-group">
												<a title="Ver traducción en {{lang.name_local|capfirst}}" href="{% url 'modeltranslation:view_all_url' lang.code 'all' %}" class="btn btn-mini"><span class="fa fa-eye"></span> {{lang.name_local|capfirst}}</a>
												
												<form class="import" method="post" action="{% url 'modeltranslation:import_translations_url' lang.code %}" enctype="multipart/form-data" >
													<fieldset id="import_{{lang.code}}" class="btn-group import">
														<input id="translation_file_{{lang.code}}" class="translation_file btn" type="file" name="file" />
														<input id="import_submit_{{lang.code}}" class="import_submit btn btn-mini" type="submit" name="" value="Enviar fichero" />
													</fieldset>
												</form>
												
												<a title="Importar traducción desde un fichero .po" href="javascript:void(0);" class="import-link btn btn-mini"><span class="fa fa-download"></span> Importar traducción</a>
												<a title="Exportar traducción a un fichero .po" href="{% url 'modeltranslation:export_translations_url' lang.code %}" class="export-link btn btn-mini"><span class="fa fa-upload"></span> Exportar traducción</a>
											</div>
										</div>
									</div>
								</li>
							{% endif %}
						{% endfor %}
						</ul>
					{% else %}
						<div class="alert alert-warning">No hay idiomas disponibles</div>
					{% endif %}
				</div>
				<h2>Acciones de administración</h2>
				<div class="translation_admin_actions">
					<a title="Actualizar traducciones" href="{% url 'modeltranslation:update_translations_url' %}" class="btn"><span class="fa fa-reload-alt"></span> Actualizar traducciones</a>
				</div>
			{% endblock content %}
		</div>
	</div>
{% endblock %}
