profile.html 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {% extends "sora/layout.html" %}
  2. {% load i18n %}
  3. {% load humanize %}
  4. {% load url from future %}
  5. {% import "_forms.html" as form_theme with context %}
  6. {% import "sora/macros.html" as macros with context %}
  7. {% block title %}{{ macros.page_title(profile.username) }}{% endblock %}
  8. {% block content %}
  9. <div class="profile-wrapper{% if profile.get_style() %} {{ profile.get_style() }}{% endif %}">
  10. <div class="page-header profile-header header-tabbed{% if profile.get_style() %} {{ profile.get_style() }}{% endif %}">
  11. <div class="avatar-height">
  12. <img src="{{ profile.get_avatar() }}" class="avatar pull-left" alt="">
  13. <div class="pull-left">
  14. <h1>{{ profile.username }}</h1>
  15. <p class="lead">
  16. {% if profile.title or profile.rank.title %}{% if profile.title %}{{ _(profile.title) }}{% elif profile.rank.title %}{{ _(profile.rank.title) }}{% endif %};{% endif %}
  17. {% if online and (not hidden or acl.users.can_see_hidden_users()) %}<span class="badge badge-success">{% if profile.hide_activity -%}
  18. {% trans %}Online, hidden{% endtrans %}
  19. {%- else -%}
  20. {% trans %}Online{% endtrans %}
  21. {%- endif %}</span>{% else %}<span class="badge">{% trans %}Offline{% endtrans %}</span>{% endif %} <span class="muted">{% trans last_visit=profile.last_date|reltimesince|low %}Last seen {{ last_visit }}{% endtrans %}</span>
  22. </p>
  23. </div>
  24. </div>
  25. <ul class="nav nav-tabs">
  26. {% for link in tabs %}
  27. <li{% if link.active %} class="active"{% endif %}>
  28. <a href="{{ link.route|url(user=profile.pk, username=profile.username_slug) }}">{{ link.name }}</a>
  29. </li>
  30. {% endfor %}
  31. </ul>
  32. {% if user.is_authenticated() and user.pk != profile.pk %}
  33. <ul class="nav nav-pills tabs-extra">
  34. <li class="{% if ignores %}danger{% else %}info{% endif %}">
  35. <form action="{% if ignores %}{% url 'unignore_user' user=profile.id %}{% else %}{% url 'ignore_user' user=profile.id %}{% endif %}" method="post">
  36. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  37. <input type="hidden" name="fallback" value="{{ fallback }}">
  38. <button type="submit" class="btn">
  39. <i class="icon-ban-circle"></i> {% if ignores %}{% trans %}Don't Ignore{% endtrans %}{% else %}{% trans %}Ignore{% endtrans %}{% endif %}
  40. </button>
  41. </form>
  42. </li>
  43. <li class="{% if follows %}success{% else %}info{% endif %}">
  44. <form action="{% if follows %}{% url 'unfollow_user' user=profile.id %}{% else %}{% url 'follow_user' user=profile.id %}{% endif %}" method="post">
  45. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  46. <input type="hidden" name="fallback" value="{{ fallback }}">
  47. <button type="submit" class="btn">
  48. <i class="icon-heart"></i> {% if follows %}{% trans %}Don't Follow{% endtrans %}{% else %}{% trans %}Follow{% endtrans %}{% endif %}
  49. </button>
  50. </form>
  51. </li>
  52. </ul>
  53. {% endif %}
  54. </div>
  55. <div class="profile-tab{% if profile.get_style() %} {{ profile.get_style() }}{% endif %}">
  56. {% block tab %}{% endblock %}
  57. </div>
  58. </div>
  59. {% endblock %}