{% extends "base.j2" -%}

{%- block call_to_action -%}
{%- endblock call_to_action -%}

{% block content -%}

<section class="one-column">
  <section class="shop-name-and-description well">
    <h3>Shop Locations</h3>
    <ul>
      {% for location in locations %}
        <li>
          <a href="{{ request.route_url('shop_location_switch', shop_id=shop.id, location_id=location.id, _query={'next': request.params.get('next', request.url)}) }}">{{ location.name }}</a>
          {% if location == request.shop_location %}(active){% endif %}
        {% if request.user in request.shop.owners %}
          <a href="{{ request.route_url('shop_location_edit', shop_id=shop.id, location_id=location.id) }}" class="button">&#9881; edit</a>
        {% endif %}
        </li>
      {% endfor %}
    </ul>
    {% if request.user in request.shop.owners %}
    <a href="{{ request.route_url('shop_location_new', shop_id=shop.id) }}" class="shop-new-button mps-button">Add New Location</a>
    {% endif %}
  </section>
</section>

{%- endblock -%}
