profile.html 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. <img src="{{ profile.get_avatar() }}" class="header-avatar">
  11. <div class="header-side">
  12. <h1>{{ profile.username }} <small>{% if profile.title or profile.rank.title -%}
  13. <strong>{% if profile.title %}{{ _(profile.title) }}{% elif profile.rank.title %}{{ _(profile.rank.title) }}{% endif %}</strong>; {% endif %}
  14. {%- if online and (not hidden or acl.users.can_see_hidden_users()) -%}
  15. {%- if profile.hide_activity -%}
  16. {% trans %}Online, hidden{% endtrans %}
  17. {%- else -%}
  18. {% trans %}Online{% endtrans %}
  19. {%- endif %}
  20. {%- else -%}
  21. {% trans %}Offline{% endtrans %}
  22. {%- endif -%}, {% if not hidden or acl.users.can_see_hidden_users() -%}
  23. {%- if online -%}
  24. {% trans last_click=online.last|reltimesince|low %}last click {{ last_click }}{% endtrans %}
  25. {%- elif profile.last_date -%}
  26. {% trans last_visit=profile.last_date|reltimesince|low %}last seen {{ last_visit }}{% endtrans %}
  27. {%- else -%}
  28. {% trans %}never visited{% endtrans %}
  29. {%- endif -%}
  30. {%- else -%}
  31. {% trans %}hiding activity{% endtrans %}
  32. {%- endif %}</small></h1>
  33. <ul class="nav nav-tabs header-tabs">
  34. {% for link in tabs %}
  35. <li{% if link.active %} class="active"{% endif %}>
  36. <a href="{{ link.route|url(user=profile.pk, username=profile.username_slug) }}">{{ link.name }}</a>
  37. </li>
  38. {% endfor %}
  39. {% if user.is_authenticated() and user.pk != profile.pk %}
  40. <li class="pull-right">
  41. <form class="form-inline" action="{% if follows %}{% url 'unfollow_user' user=profile.id %}{% else %}{% url 'follow_user' user=profile.id %}{% endif %}" method="post">
  42. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  43. <input type="hidden" name="fallback" value="{{ fallback }}">
  44. <button type="submit" class="btn{% if follows %} btn-success{% endif %}">
  45. <i class="icon-heart"></i> {% if follows %}{% trans %}Following{% endtrans %}{% else %}{% trans %}Follow{% endtrans %}{% endif %}
  46. </button>
  47. </form>
  48. </li>
  49. <li class="pull-right">
  50. <form class="form-inline" action="{% if ignores %}{% url 'unignore_user' user=profile.id %}{% else %}{% url 'ignore_user' user=profile.id %}{% endif %}" method="post">
  51. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  52. <input type="hidden" name="fallback" value="{{ fallback }}">
  53. <button type="submit" class="btn{% if ignores %} btn-inverse{% endif %}">
  54. <i class="icon-ban-circle"></i> {% if ignores %}{% trans %}Ignoring{% endtrans %}{% else %}{% trans %}Ignore{% endtrans %}{% endif %}
  55. </button>
  56. </form>
  57. </li>
  58. {% endif %}
  59. </ul>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="container container-primary">
  65. {% block tab %}{% endblock %}
  66. </div>
  67. </div>
  68. {% endblock %}