profile.html 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.last|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 %}