{% extends "base.html" %}
{% load i18n %}
{% block user_profile__menu %}cur{% endblock %}
{% block content %}
{% if messages %}
<div>
  {% for message in messages %}
  <p class="{{ message.tags }}">{{ message }}
  {% endfor %}
</div>
{% endif %}
<table class="g g_padding-t_XL">
  <tbody>
    <tr>
      <td class="c">
        <div class="title">
          <h2>{{ object.login }}</h2>
          {% if payment_info_url %}
          <h3>
            {% blocktrans with username=object.login %}
            <a href="{{ payment_info_url }}" class="link">Платежная информация</a>
            {% endblocktrans %}
          </h3>
          {% else %}
          <h3>
            {% trans "Платежная информация отсутствует" %}
          </h3>
          {% endif %}
          {%  if user_rewards_url %}
              <br/>
              <h3>
                <a href="{{ user_rewards_url }}" class="link">Rewards</a>
              </h3>
          {% endif %}
          {% if object.balance_contract_id %}
          <br/>
          <h4>{% trans "Идентификатор договора: " %}</h4>
          <h4>{{ object.balance_contract_id }}</h4>
          {% endif %}
        </div>
    <tr>
      <td class="c">
        <div class="b b_gap-x_M">
          {% for award in object.userbadge_set.all %}
          <div class="c">
            <div class="badge-ctrl">
              <form action="{% url 'user_profile:delete_badge' award.pk %}" method="POST">{% csrf_token %}
                <input type="hidden" name="user" value="{{ award.pk }}"/>
                <input type="hidden" name="badge" value="{{ award.badge.id }}"/>
                <button class="badge-ctrl__del"></button>
              </form>
              <div class="badge-ctrl__i">
                {% if award.badge.image_url %}
                <i style="background: url('{{ award.badge.image_url }}'); background-size: 100px 100px;" class="award{% if award.deactivated %} award_inactive{% endif %}"></i>
                {% else %}
                <i class="award award_empty{% if award.deactivated %} award_inactive{% endif %}"></i>
                {% endif %}
              </div>
            </div>
          </div>
          {% endfor %}
        </div>
</table>
<form method="POST">{% csrf_token %}
<table class="g g_padding-t_XL g_gap_L">
  <tr>
    <td class="c">
      <label class="label label_forms label_forms_min label_L">
        {% trans "user.name" %}
      </label>
    <td class="c">
      <span class="input input_size_L w550">
        {{ form.display_name }}
      </span>
  <tr>
    <td class="c">
      <label class="label label_forms label_forms_min label_L">
        {% trans "user.email" %}
      </label>
    <td class="c">
      <span class="input input_size_L w550">
        {{ form.contact_email }}
      </span>
  <tr>
    <td class="c">
      <label class="label label_forms label_forms_min label_L">
        {% trans "Facebook" %}
      </label>
    <td class="c">
      <span class="input input_size_L w550">
        {{ form.fb_link }}
      </span>
  <tr>
    <td class="c">
      <label class="label label_forms label_forms_min label_L">
        {% trans "Twitter" %}
      </label>
    <td class="c">
      <span class="input input_size_L w550">
        {{ form.twitter_link }}
      </span>
  <tr>
    <td class="c">
      <label class="label label_forms label_forms_min label_L">
        {% trans "HackerOne" %}
      </label>
    <td class="c">
      <span class="input input_size_L w550">
        {{ form.hacker_one_link }}
      </span>
  <tr>
    <td class="c">
      <label class="label label_forms label_forms_min label_L">
        {% trans "BugCrowd" %}
      </label>
    <td class="c">
      <span class="input input_size_L w550">
        {{ form.bug_crowd_link }}
      </span>
  <tr>
    <td class="c">
      <label class="label label_forms label_forms_min label_L">
        {% trans "user.website" %}
      </label>
    <td class="c">
      <span class="input input_size_L w550">
        {{ form.personal_website }}
      </span>
  <tr>
    <td class="c">
      <label class="label label_forms label_forms_min label_L">
        {% trans "user.company_name" %}
      </label>
    <td class="c">
      <span class="input input_size_L w550">
        {{ form.company_name }}
      </span>
  <tr>
    <td class="c">
    <td class="c">
      <div class="b">
        <span class="check check_size_L">
          {{ form.show_on_hall }}
          <span class="check__label">{% trans "user.show_on_hall" %}</span>
        </span>
      </div>
  <tr>
    <td class="c">
    <td class="c">
      <div class="b b_middle b_gap-x_XS">
        <div class="c">
          <button class="button button_size_L button_type_action">
            <span class="button__label">{% trans "Save" %}</span>
          </button>
        </div>
        <div class="c">
          <a href="{% url "user_profile:list" %}" class="button button_size_L button_type_normal">
            <span class="button__label">{% trans "Cancel" %}</span>
          </a>
        </div>
      </div>
</table>
</form>
{% endblock %}
