diff --git a/hiboo/account/__init__.py b/hiboo/account/__init__.py index 94a5a7de563864608d15580fd5bd2a3bb9342c24..53cca236a30568086e5c17b06a889e0573bdadc7 100644 --- a/hiboo/account/__init__.py +++ b/hiboo/account/__init__.py @@ -3,4 +3,4 @@ import flask blueprint = flask.Blueprint("account", __name__, template_folder="templates") -from hiboo.account import login, home, settings +from hiboo.account import login, home, settings, profiles \ No newline at end of file diff --git a/hiboo/account/profiles.py b/hiboo/account/profiles.py new file mode 100644 index 0000000000000000000000000000000000000000..40bf740c6d5301705eb2f785a924e82c67c2bb98 --- /dev/null +++ b/hiboo/account/profiles.py @@ -0,0 +1,12 @@ +from hiboo.account import blueprint +from hiboo import security + +import flask +import flask_login + + +@blueprint.route("/profiles") +@security.authentication_required() +def profiles(): + history = flask_login.current_user.history + return flask.render_template("account_profiles.html", history=history) \ No newline at end of file diff --git a/hiboo/account/templates/account_profiles.html b/hiboo/account/templates/account_profiles.html new file mode 100644 index 0000000000000000000000000000000000000000..10824f557f12e4951735133e4dfbdaa01d3b8d0d --- /dev/null +++ b/hiboo/account/templates/account_profiles.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block title %}{% trans %}My account{% endtrans %}{% endblock %} +{% block subtitle %}{% trans %}my profiles{% endtrans %}{% endblock %} + +{% block content %} +<div class="row"> + <div class="col-xs-12"> + <div class="box"> + <div class="box-body table-responsive no-padding"> + <table class="table table-hover"> + <tr> + {% if not service %} + <th>{% trans %}Service{% endtrans %}</th> + {% endif %} + <th>{% trans %}Profile username{% endtrans %}</th> + <th>{% trans %}Owned by{% endtrans %}</th> + <th>{% trans %}Status{% endtrans %}</th> + <th>{% trans %}Created on{% endtrans %}</th> + </tr> + {% for profile in current_user.profiles %} + <tr> + <td>{{ profile.service.name }}</td> + <td>{{ profile.username }}</td> + <td>{{ profile.user.username }}</td> + <td>{{ profile.status }}</td> + <td>{{ profile.created_at.date() }}</td> + </tr> + {% endfor %} + </table> + </div> + </div> + </div> + </div> +{% endblock %} \ No newline at end of file diff --git a/hiboo/templates/sidebar.html b/hiboo/templates/sidebar.html index 672c161a67a1fb5ffc8d90e8c11dcfe4af6e65b2..975ea31cf55a1c76be0fcf3fe0a217bca1220177 100644 --- a/hiboo/templates/sidebar.html +++ b/hiboo/templates/sidebar.html @@ -5,6 +5,11 @@ <i class="fa fa-home"></i> <span>{% trans %}My account{% endtrans %}</span> </a> </li> +<li> + <a href="{{ url_for("account.profiles") }}"> + <i class="fa fa-address-card"></i> <span>{% trans %}My profiles{% endtrans %}</span> + </a> +</li> <li> <a href="{{ url_for("account.password") }}"> <i class="fa fa-lock"></i> <span>{% trans %}Change password{% endtrans %}</span>