|
@@ -1,4 +1,4 @@
|
|
-{%- from theme("macros.html") import sidebar with context -%}
|
|
|
|
|
|
+{%- from theme("_macros/navigation.html") import sidebar with context -%}
|
|
{% extends theme("layout.html") %}
|
|
{% extends theme("layout.html") %}
|
|
{% set page_title = _("%(user)s - User", user=user.username) %}
|
|
{% set page_title = _("%(user)s - User", user=user.username) %}
|
|
|
|
|
|
@@ -6,91 +6,107 @@
|
|
|
|
|
|
{% block breadcrumb %}
|
|
{% block breadcrumb %}
|
|
{% endblock %}
|
|
{% endblock %}
|
|
-
|
|
|
|
<div class="page-view">
|
|
<div class="page-view">
|
|
- <div class="row">
|
|
|
|
- <div class="col-md-12 col-sm-12 col-xs-12">
|
|
|
|
- <div class="panel page-panel">
|
|
|
|
- <div class="panel-heading page-head">
|
|
|
|
- <a href="{{ user.url }}">{{ user.username }}</a>
|
|
|
|
- <div class="pull-right">
|
|
|
|
- {# Ban user #}
|
|
|
|
- {% if current_user|can_ban_user and not user.permissions['banned'] %}
|
|
|
|
- <form class="inline-form" method="post" action="{{ url_for('management.ban_user', user_id=user.id) }}">
|
|
|
|
- <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
|
|
- <button class="btn btn-xs btn-danger">
|
|
|
|
- <i class="fa fa-ban"></i> {% trans %}Ban{% endtrans %}
|
|
|
|
- </button>
|
|
|
|
- </form>
|
|
|
|
- {% endif %}
|
|
|
|
-
|
|
|
|
- {# Unban user #}
|
|
|
|
- {% if current_user|can_ban_user and user.permissions['banned'] %}
|
|
|
|
- <form class="inline-form" method="post" action="{{ url_for('management.unban_user', user_id=user.id) }}">
|
|
|
|
- <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
|
|
- <button class="btn btn-xs btn-warning">
|
|
|
|
- <i class="fa fa-ban"></i> {% trans %}Unban{% endtrans %}
|
|
|
|
- </button>
|
|
|
|
- </form>
|
|
|
|
- {% endif %}
|
|
|
|
|
|
+ <div class="card profile">
|
|
|
|
|
|
- {% if current_user|can_edit_user %}
|
|
|
|
- <a class="btn btn-xs btn-primary" href="{{ url_for('management.edit_user', user_id=user.id)}}"><i class="fa fa-pencil"></i> {% trans %}Edit{% endtrans %}</a>
|
|
|
|
- {% endif %}
|
|
|
|
|
|
+ <div class="card-header profile-header bg-white">
|
|
|
|
+ <div class="row">
|
|
|
|
+ <div class="col-12 col-sm-auto mb-3">
|
|
|
|
+ <div class="mx-auto" style="width: 150px;">
|
|
|
|
+ <div class="d-flex justify-content-center align-items-center">
|
|
|
|
+ <img class="rounded" src="{{ url_for('static', filename='avatar150x150.png') }}" alt="" />
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="panel-body page-body profile-body">
|
|
|
|
- {% block profile_sidebar %}
|
|
|
|
- <div class="col-md-3 col-sm-3 col-xs-12 profile-sidebar">
|
|
|
|
- <div class="profile-picture">
|
|
|
|
- {% if user.avatar %}
|
|
|
|
- <img src="{{ user.avatar }}" alt="{{ user.username }}'s Avatar">
|
|
|
|
- {% endif %}
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <div class="profile-groupname">
|
|
|
|
- {{ user.primary_group.name }}
|
|
|
|
|
|
+ <div class="col d-flex flex-column flex-sm-row justify-content-between mb-3">
|
|
|
|
+ <div class="text-sm-left mb-2 mb-sm-0">
|
|
|
|
+ <h4 class="pt-sm-2 pb-1 mb-0 text-nowrap">{{ user.username }}</h4>
|
|
|
|
+ <p class="mb-0">{{ user.primary_group.name }}</p>
|
|
|
|
+ <div class="text-muted">
|
|
|
|
+ <small>
|
|
|
|
+ {%- if user|is_online %}
|
|
|
|
+ <span class="badge bg-success">{% trans %}online{% endtrans %}</span>
|
|
|
|
+ {%- else %}
|
|
|
|
+ {%- if user.lastseen -%}
|
|
|
|
+ Last seen {{ user.lastseen|time_since }}
|
|
|
|
+ {%- else -%}
|
|
|
|
+ {% trans %}Never seen{% endtrans %}
|
|
|
|
+ {%- endif -%}
|
|
|
|
+ {%- endif %}
|
|
|
|
+ </small>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="mt-2">
|
|
|
|
|
|
- <div class="profile-online" data-toggle="tooltip" data-placement="top" title="{%- if user.lastseen -%} {{ user.lastseen|time_since }} {%- else -%} {% trans %}Never seen{% endtrans %} {%- endif -%}">
|
|
|
|
- {%- if user|is_online %}
|
|
|
|
- <span class="label label-success">{% trans %}online{% endtrans %}</span>
|
|
|
|
- {%- else %}
|
|
|
|
- <span class="label label-default">{% trans %}offline{% endtrans %}</span>
|
|
|
|
- {%- endif %}
|
|
|
|
- </div>
|
|
|
|
|
|
+ {% if current_user|can_edit_user %}
|
|
|
|
+ <a class="btn btn-sm btn-primary" href="{{ url_for('management.edit_user', user_id=user.id)}}">
|
|
|
|
+ <span class="fas fa-edit"></span> {% trans %}Edit{% endtrans %}
|
|
|
|
+ </a>
|
|
|
|
+ {% endif %}
|
|
|
|
|
|
- <div class="profile-sidebar-stats">
|
|
|
|
- <div class="profile-posts">
|
|
|
|
- {{ user.post_count }} {% trans %}posts{% endtrans %}
|
|
|
|
- </div>
|
|
|
|
|
|
+ {# Ban user #}
|
|
|
|
+ {% if current_user|can_ban_user and not user.permissions['banned'] %}
|
|
|
|
+ <form class="d-inline" method="post" action="{{ url_for('management.ban_user', user_id=user.id) }}">
|
|
|
|
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
|
|
+ <button class="btn btn-sm btn-danger">
|
|
|
|
+ <span class="fas fa-ban"></span> {% trans %}Ban{% endtrans %}
|
|
|
|
+ </button>
|
|
|
|
+ </form>
|
|
|
|
+ {# Unban user #}
|
|
|
|
+ {% elif current_user|can_ban_user and user.permissions['banned'] %}
|
|
|
|
+ <form class="d-inline" method="post" action="{{ url_for('management.unban_user', user_id=user.id) }}">
|
|
|
|
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
|
|
+ <button class="btn btn-sm btn-warning">
|
|
|
|
+ <span class="fas fa-ban"></span> {% trans %}Unban{% endtrans %}
|
|
|
|
+ </button>
|
|
|
|
+ </form>
|
|
|
|
+ {% endif %}
|
|
|
|
|
|
- <div class="profile-date">
|
|
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="text-sm-right col-2">
|
|
|
|
+ <!-- TODO: Make this nicer -->
|
|
|
|
+ <div class="row">
|
|
|
|
+ <div class="col text-end text-nowrap" style="max-width: 80px;">Joined:</div>
|
|
|
|
+ <div class="col ps-0 float-start text-nowrap">
|
|
{{ user.date_joined|format_date }}
|
|
{{ user.date_joined|format_date }}
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
- {{ run_hook("flaskbb_tpl_profile_sidebar_stats", user=user) }}
|
|
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
- {{ sidebar(
|
|
|
|
- run_hook(
|
|
|
|
- "flaskbb_tpl_profile_sidebar_links",
|
|
|
|
- user=user,
|
|
|
|
- is_markup=False
|
|
|
|
- ),
|
|
|
|
- extra_class="profile-sidebar"
|
|
|
|
- )
|
|
|
|
- }}
|
|
|
|
|
|
+ <div class="row">
|
|
|
|
+ <div class="col text-end text-nowrap" style="max-width: 80px;">Posts:</div>
|
|
|
|
+ <div class="col ps-0 text-start text-nowrap">{{ user.post_count }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="row">
|
|
|
|
+ <div class="col text-end text-nowrap" style="max-width: 80px;">Topics:</div>
|
|
|
|
+ <div class="col ps-0 float-start text-nowrap">{{ user.topic_count }}</div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- {% endblock %}
|
|
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ {% block profile_navigation %}
|
|
|
|
+
|
|
|
|
+ {{ sidebar(
|
|
|
|
+ run_hook(
|
|
|
|
+ "flaskbb_tpl_profile_sidebar_links",
|
|
|
|
+ user=user,
|
|
|
|
+ is_markup=False
|
|
|
|
+ ),
|
|
|
|
+ extra_class="nav-tabs card-header-tabs profile-header-tab"
|
|
|
|
+ )
|
|
|
|
+ }}
|
|
|
|
|
|
- {% block profile_content %}
|
|
|
|
- {% endblock %}
|
|
|
|
|
|
+ {% endblock %}
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="card-body page-body">
|
|
|
|
+ <div class="row">
|
|
|
|
+ {% block profile_content %}
|
|
|
|
+ {% endblock %}
|
|
|
|
+ </div>
|
|
|
|
|
|
- </div> <!-- end profile widget -->
|
|
|
|
- </div> <!-- end page-panel -->
|
|
|
|
</div> <!-- end col -->
|
|
</div> <!-- end col -->
|
|
</div> <!-- end row -->
|
|
</div> <!-- end row -->
|
|
</div> <!-- end page-view -->
|
|
</div> <!-- end page-view -->
|
|
|
|
|
|
-{% endblock %} {# content #}
|
|
|
|
|
|
+
|
|
|
|
+{% endblock content %}
|