{% if settings.SIDEBAR_PROFILE and 'SIDEBAR_PROFILE'|show_block_to(request.user) %}
    {% extends "two_column_body.html" %}
{% else %}
    {% extends "one_column_body.html" %}
{% endif %}
<!-- user.html -->
{% block title %}{{ page_title }}{% endblock %}
{% block layout_class %}{{ super() }} user-profile-page{% endblock %}
{% block content %}
  <h1>
    {% trans username=view_user.username|escape %}{{username}}'s profile{% endtrans %} - {% block profilesection %}{% endblock %}
    {% if request.user.is_authenticated and request.user.pk == view_user.pk and settings.USE_ASKBOT_LOGIN_SYSTEM %}
      {% set next_jwt=encode_jwt({'next_url': settings.LOGOUT_REDIRECT_URL}) %}
      (<a class="logout-link" href="{{ settings.LOGOUT_URL }}?next={{ next_jwt }}">{% trans %}sign out{% endtrans %}</a>
        {%- if settings.USE_ASKBOT_LOGIN_SYSTEM and settings.ALLOW_ADD_REMOVE_LOGIN_METHODS %}
        | <a href="{{ settings.LOGIN_URL }}?next={{ encode_jwt({'next_url': settings.LOGIN_URL}) }}">
            {% trans %}manage logins{% endtrans -%}
          </a>
        {%- endif -%})
    {% endif %}
  </h1>
  {% include "user_profile/user_tabs.html" %}
  <div>
    {% block usercontent %}
    {% endblock %}
  </div>
{% endblock %}<!-- end user.html -->
{% block endjs %}
  <script type="text/javascript">
    askbot['data']['viewUserName'] = '{{ view_user.username|escape }}';
    askbot['data']['viewUserId'] = {{ view_user.id }};
    askbot['data']['isExportingData'] = {{ exporting|as_js_bool }};
    askbot['urls']['edit_group_membership'] = '{{ url('edit_group_membership') }}';
    askbot['urls']['getGroupsList'] = '{{ url('get_groups_list') }}';
    askbot['urls']['getTopAnswers'] = '{{ url('get_top_answers') }}';
    askbot['urls']['upload'] = '{{ url('upload') }}';
    askbot['urls']['getTodaysBackupFileName'] = '{{ url('get_todays_backup_file_name',  view_user.pk ) }}';
    askbot['urls']['downloadUserData'] = '{{ url('download_user_data',  view_user.pk, "file_name" ) }}';
    {% if page_size %}
      askbot['data']['userPostsPageSize'] = {{ page_size }};
    {% endif %}
  </script>
  {% compress js %}
  <script src="{{ '/jslib/jquery.form.js'|media }}"></script>
  <script src="{{ '/js/user/response_notifs.js'|media }}"></script>
  <script src="{{ '/js/user/notifs_group.js'|media }}"></script>
  <script src="{{ '/js/user/user_group.js'|media }}"></script>
  <script src="{{ '/js/user/groups_container.js'|media }}"></script>
  <script src="{{ '/js/user/group_adder_widget.js'|media }}"></script>
  <script src="{{ '/js/user/user_groups_editor.js'|media }}"></script>
  <script src="{{ '/js/user/tweeting.js'|media }}"></script>
  <script src="{{ '/js/user/user_questions_paginator.js'|media }}"></script>
  <script src="{{ '/js/user/download_data.js'|media }}"></script>
  <script src="{{ '/js/user.js'|media }}"></script>
  <script src="{{ '/jslib/jquery.validate.min.js'|media }}"></script>
  <script src="{{ '/jslib/highlight.min.js'|media }}"></script>
  {% include "meta/markdown_javascript.html" %}
  <script src="{{ '/jslib/editor.js'|media }}"></script>
  <script src="{{ '/js/utils/toggle.js'|media }}"></script>
  <script src="{{ '/js/utils/unordered_list.js'|media }}"></script>
  <script src="{{ '/js/editors/simple_editor.js'|media }}"></script>
  <script src="{{ '/js/utils/editable.js'|media }}"></script>
  {% endcompress %}
  {% block userjs %}
  {% endblock %}
{% endblock %}
{% block sidebar %}
  {% if settings.SIDEBAR_PROFILE and 'SIDEBAR_PROFILE'|show_block_to(request.user) %}
  <div class="sidebar-box">
    {{ settings.SIDEBAR_PROFILE }}
  </div>
  {% endif %}
{% endblock %}
<!-- end of user.html -->
