profile.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. {% extends "cranefly/layout.html" %}
  2. {% load i18n %}
  3. {% load humanize %}
  4. {% load url from future %}
  5. {% import "cranefly/macros.html" as macros with context %}
  6. {% block title %}{{ macros.page_title(profile.username) }}{% endblock %}
  7. {% block container %}
  8. <div class="user-profile{% if profile.get_style() %} user-profile-{{ profile.get_style() }}{% endif %}">
  9. <div class="page-header header-primary user-profile-header">
  10. <div class="container">
  11. {{ messages_list(messages) }}
  12. <div class="header-row">
  13. <img src="{{ profile.get_avatar() }}" class="header-avatar">
  14. <div class="header-side">
  15. <h1>{{ profile.username }} <small>{% if profile.title or profile.rank.title -%}
  16. <strong>{% if profile.title %}{{ _(profile.title) }}{% elif profile.rank.title %}{{ _(profile.rank.title) }}{% endif %}</strong>; {% endif %}
  17. {%- if online and (not hidden or acl.users.can_see_hidden_users()) -%}
  18. {%- if profile.hide_activity -%}
  19. {% trans %}Online, hidden{% endtrans %}
  20. {%- else -%}
  21. {% trans %}Online{% endtrans %}
  22. {%- endif %}
  23. {%- else -%}
  24. {% trans %}Offline{% endtrans %}
  25. {%- endif -%}, {% if not hidden or acl.users.can_see_hidden_users() -%}
  26. {%- if online -%}
  27. {% trans last_click=online|reltimesince|low %}last click {{ last_click }}{% endtrans %}
  28. {%- elif profile.last_date -%}
  29. {% trans last_visit=profile.last_date|reltimesince|low %}last seen {{ last_visit }}{% endtrans %}
  30. {%- else -%}
  31. {% trans %}never visited{% endtrans %}
  32. {%- endif -%}
  33. {%- else -%}
  34. {% trans %}hiding activity{% endtrans %}
  35. {%- endif %}</small></h1>
  36. <ul class="nav nav-tabs header-tabs">
  37. {% for link in tabs %}
  38. <li{% if link.active %} class="active"{% endif %}>
  39. <a href="{{ link.route|url(user=profile.pk, username=profile.username_slug) }}">{{ link.name }}</a>
  40. </li>
  41. {% endfor %}
  42. {% if user.is_authenticated() and user.pk != profile.pk %}
  43. <li class="pull-right">
  44. <form class="form-inline" 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{% if follows %} btn-success{% endif %}">
  48. <i class="icon-heart"></i> {% if follows %}{% trans %}Following{% endtrans %}{% else %}{% trans %}Follow{% endtrans %}{% endif %}
  49. </button>
  50. </form>
  51. </li>
  52. <li class="pull-right">
  53. <form class="form-inline" action="{% if ignores %}{% url 'unignore_user' user=profile.id %}{% else %}{% url 'ignore_user' user=profile.id %}{% endif %}" method="post">
  54. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  55. <input type="hidden" name="fallback" value="{{ fallback }}">
  56. <button type="submit" class="btn{% if ignores %} btn-inverse{% endif %}">
  57. <i class="icon-ban-circle"></i> {% if ignores %}{% trans %}Ignoring{% endtrans %}{% else %}{% trans %}Ignore{% endtrans %}{% endif %}
  58. </button>
  59. </form>
  60. </li>
  61. {% endif %}
  62. </ul>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="container container-primary">
  68. {% block tab %}{% endblock %}
  69. </div>
  70. </div>
  71. {% endblock %}
  72. {% block content %}
  73. <div class="profile-wrapper{% if profile.get_style() %} {{ profile.get_style() }}{% endif %}">
  74. <div class="page-header profile-header header-tabbed{% if profile.get_style() %} {{ profile.get_style() }}{% endif %}">
  75. <div class="avatar-height">
  76. <img src="{{ profile.get_avatar() }}" class="avatar pull-left" alt="">
  77. <div class="pull-left">
  78. <h1>{{ profile.username }}</h1>
  79. <p class="lead">
  80. {% if profile.title or profile.rank.title %}{% if profile.title %}{{ _(profile.title) }}{% elif profile.rank.title %}{{ _(profile.rank.title) }}{% endif %};{% endif %}
  81. {% if online and (not hidden or acl.users.can_see_hidden_users()) %}<span class="badge badge-success">{% if profile.hide_activity -%}
  82. {% trans %}Online, hidden{% endtrans %}
  83. {%- else -%}
  84. {% trans %}Online{% endtrans %}
  85. {%- endif %}</span>{% else %}<span class="badge">{% trans %}Offline{% endtrans %}</span>{% endif %} <span class="muted">{% if not hidden or acl.users.can_see_hidden_users() -%}
  86. {%- if online -%}
  87. {% trans last_click=online|reltimesince|low %}Last click {{ last_click }}{% endtrans %}
  88. {%- elif profile.last_date -%}
  89. {% trans last_visit=profile.last_date|reltimesince|low %}Last seen {{ last_visit }}{% endtrans %}
  90. {%- else -%}
  91. {% trans %}Never visited{% endtrans %}
  92. {%- endif -%}
  93. {%- else -%}
  94. {% trans %}Hiding activity{% endtrans %}
  95. {%- endif %}</span>
  96. </p>
  97. </div>
  98. </div>
  99. <ul class="nav nav-tabs">
  100. {% for link in tabs %}
  101. <li{% if link.active %} class="active"{% endif %}>
  102. <a href="{{ link.route|url(user=profile.pk, username=profile.username_slug) }}">{{ link.name }}</a>
  103. </li>
  104. {% endfor %}
  105. </ul>
  106. {% if user.is_authenticated() and user.pk != profile.pk %}
  107. <ul class="nav nav-pills tabs-extra">
  108. <li class="{% if ignores %}danger{% else %}info{% endif %}">
  109. <form action="{% if ignores %}{% url 'unignore_user' user=profile.id %}{% else %}{% url 'ignore_user' user=profile.id %}{% endif %}" method="post">
  110. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  111. <input type="hidden" name="fallback" value="{{ fallback }}">
  112. <button type="submit" class="btn">
  113. <i class="icon-ban-circle"></i> {% if ignores %}{% trans %}Don't Ignore{% endtrans %}{% else %}{% trans %}Ignore{% endtrans %}{% endif %}
  114. </button>
  115. </form>
  116. </li>
  117. <li class="{% if follows %}success{% else %}info{% endif %}">
  118. <form action="{% if follows %}{% url 'unfollow_user' user=profile.id %}{% else %}{% url 'follow_user' user=profile.id %}{% endif %}" method="post">
  119. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  120. <input type="hidden" name="fallback" value="{{ fallback }}">
  121. <button type="submit" class="btn">
  122. <i class="icon-heart"></i> {% if follows %}{% trans %}Don't Follow{% endtrans %}{% else %}{% trans %}Follow{% endtrans %}{% endif %}
  123. </button>
  124. </form>
  125. </li>
  126. </ul>
  127. {% endif %}
  128. </div>
  129. <div class="profile-tab{% if profile.get_style() %} {{ profile.get_style() }}{% endif %}">
  130. </div>
  131. </div>
  132. {% endblock %}