{% extends 'allianceauth/base.html' %}

{% load i18n %}
{% load evelinks %}

{% block page_title %}{% translate "Corporation Member Data" %}{% endblock %}

{% block content %}
    <div class="clearfix">
        <h1 class="page-header text-center">{% translate "Corporation Member Data" %}</h1>
        <div class="clearfix">
            <nav class="navbar navbar-default">
                <div class="container-fluid">
                    <ul class="nav navbar-nav">
                        {% if available %}
                            <li class="dropdown">
                                <a href="#" id="dLabel" class="dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">{% translate "Corporations" %}<span class="caret"></span></a>
                                <ul class="dropdown-menu corpstat-corp-dropdown" role="menu" aria-labelledby="dLabel">
                                    {% for corpstat in available %}
                                        <li>
                                            <a href="{% url 'corpstat:view_corp' corpstat.corp.corporation_id %}">
                                                <img src="{{ corpstat.corp.corporation_id|corporation_logo_url:32 }}" class="img-rounded" alt="{{ corpstat.corp.corporation_name }}" style="margin-right: 0.25rem; width: 1rem; height: 1rem;">
                                                {{ corpstat.corp.corporation_name }}
                                            </a>
                                        </li>
                                    {% endfor %}
                                </ul>
                            </li>
                        {% endif %}

                        {% if available.count > 1 %}
                            <li>
                                <a href="{% url 'corpstat:view_all' %}">{% translate "View All" %}</a>
                            </li>
                        {% endif %}

                        {% if perms.corpstats.add_corpstat %}
                            <li>
                                <a href="{% url 'corpstat:add' %}">{% translate "Add" %}</a>
                            </li>
                        {% endif %}
                    </ul>

                    <form class="navbar-form navbar-right" role="search" action="{% url 'corpstat:search' %}" method="GET">
                        <div class="form-group">
                            <label style="margin: 0;">
                                <input type="text" class="form-control" name="search_string" value="{{ search_string }}" placeholder="{% translate "Search all corporations..." %}">
                            </label>
                        </div>
                    </form>
                </div>
            </nav>

            {% block member_data %}{% endblock %}
        </div>
    </div>
{% endblock %}
