{% extends "core/base.jinja" %}

{%- block additional_css -%}
  <link rel="stylesheet" href="{{ static('user/user_preferences.scss') }}">
{%- endblock -%}

{% block title %}
  {% trans %}Preferences{% endtrans %}
{% endblock %}

{% block content %}
  <div class="main">
    <h2>{% trans %}Preferences{% endtrans %}</h2>
    <br />
    <h3>{% trans %}Notifications{% endtrans %}</h3>
    <form action="" method="post" enctype="multipart/form-data">
      {% csrf_token %}
      <div class="form form-general">
        {{ form.as_p() }}
      </div>
      <input class="btn btn-blue" type="submit" value="{% trans %}Save{% endtrans %}" />
    </form>

    <br />
    <h3>{% trans %}Visibility{% endtrans %}</h3>

    {{ user_visibility_fragment }}

    <br />
    {% if student_card_fragment %}
      <h3>{% trans %}Student card{% endtrans %}</h3>
      {{ student_card_fragment }}
      <p class="justify">
        {% trans %}You can add a card by asking at a counter or add it yourself here. If you want to manually
          add a student card yourself, you'll need a NFC reader. We store the UID of the card which is 14 characters long.{% endtrans %}
      </p>
    {% endif %}

    <br />
    <h3>{% trans %}Trombi{% endtrans %}</h3>

    {% if trombi_form %}
      <form action="{{ url('trombi:user_tools') }}" method="post" enctype="multipart/form-data">
        {% csrf_token %}
        {{ trombi_form.as_p() }}
        <input class="btn btn-blue" type="submit" value="{% trans %}Save{% endtrans %}" />
      </form>
    {% else %}
      <p>{% trans trombi=profile.trombi_user.trombi %}You already choose to be in that Trombi: {{ trombi }}.{% endtrans %}
        <br />
        <a href="{{ url('trombi:user_tools') }}">{% trans %}Go to my Trombi tools{% endtrans %}</a>
      </p>
    {% endif %}
  </div>
{% endblock %}