profile.html 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. {% extends "cranefly/layout.html" %}
  2. {% import "cranefly/macros.html" as macros with context %}
  3. {% block title %}{{ macros.page_title(profile.username) }}{% endblock %}
  4. {% block container %}
  5. <div class="user-profile{% if profile.get_style() %} user-profile-{{ profile.get_style() }}{% endif %}">
  6. <div class="page-header header-primary user-profile-header">
  7. <div class="container">
  8. {{ messages_list(messages) }}
  9. <div class="header-row">
  10. {% if profile.id == user.id and not user.avatar_ban %}
  11. <a href="{% url 'usercp_avatar' %}"><img src="{{ profile.get_avatar() }}" class="header-avatar tooltip-right" title="{% trans %}Click to jump to your Avatar Settings{% endtrans %}"></a>
  12. {% else %}
  13. <img src="{{ profile.get_avatar() }}" class="header-avatar">
  14. {% endif %}
  15. <div class="header-side">
  16. <h1>{{ profile.username }} <small>{% if profile.title or profile.rank.title -%}
  17. <strong>{% if profile.title %}{{ _(profile.title) }}{% elif profile.rank.title %}{{ _(profile.rank.title) }}{% endif %}</strong>; {% endif %}
  18. {%- if online and (not hidden or acl.users.can_see_hidden_users()) -%}
  19. {%- if profile.hide_activity -%}
  20. {% trans %}Online, hidden{% endtrans %}
  21. {%- else -%}
  22. {% trans %}Online{% endtrans %}
  23. {%- endif %}
  24. {%- else -%}
  25. {% trans %}Offline{% endtrans %}
  26. {%- endif -%}, {% if not hidden or acl.users.can_see_hidden_users() -%}
  27. {%- if online -%}
  28. {% trans last_click=online.last|reltimesince|low %}last click {{ last_click }}{% endtrans %}
  29. {%- elif profile.last_date -%}
  30. {% trans last_visit=profile.last_date|reltimesince|low %}last seen {{ last_visit }}{% endtrans %}
  31. {%- else -%}
  32. {% trans %}never visited{% endtrans %}
  33. {%- endif -%}
  34. {%- else -%}
  35. {% trans %}hiding activity{% endtrans %}
  36. {%- endif %}</small></h1>
  37. <ul class="nav nav-tabs header-tabs">
  38. {% for link in tabs %}
  39. <li{% if link.active %} class="active"{% endif %}>
  40. <a href="{{ link.route|url(user=profile.pk, username=profile.username_slug) }}">{{ link.name }}</a>
  41. </li>
  42. {% endfor %}
  43. {% if user.is_authenticated() and user.pk != profile.pk %}
  44. <li class="pull-right">
  45. <form class="form-inline" action="{% if follows %}{% url 'unfollow_user' user=profile.id %}{% else %}{% url 'follow_user' user=profile.id %}{% endif %}" method="post">
  46. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  47. <input type="hidden" name="fallback" value="{{ fallback }}">
  48. <button type="submit" class="btn{% if follows %} btn-success{% endif %}">
  49. <i class="icon-heart"></i> {% if follows %}{% trans %}Following{% endtrans %}{% else %}{% trans %}Follow{% endtrans %}{% endif %}
  50. </button>
  51. </form>
  52. </li>
  53. <li class="pull-right">
  54. <form class="form-inline" action="{% if ignores %}{% url 'unignore_user' user=profile.id %}{% else %}{% url 'ignore_user' user=profile.id %}{% endif %}" method="post">
  55. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  56. <input type="hidden" name="fallback" value="{{ fallback }}">
  57. <button type="submit" class="btn{% if ignores %} btn-inverse{% endif %}">
  58. <i class="icon-ban-circle"></i> {% if ignores %}{% trans %}Ignoring{% endtrans %}{% else %}{% trans %}Ignore{% endtrans %}{% endif %}
  59. </button>
  60. </form>
  61. </li>
  62. {% if acl.private_threads.can_start() %}
  63. <li class="pull-right">
  64. <a href="{% url 'private_thread_start_with' username=profile.username_slug, user=profile.pk %}" class="btn"><i class="icon-envelope"></i> {% trans %}Message{% endtrans %}</a>
  65. </li>
  66. {% endif %}
  67. {% endif %}
  68. </ul>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="container container-primary">
  74. {% block tab %}{% endblock %}
  75. </div>
  76. </div>
  77. {% endblock %}