]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/users/user_profile_page.html
Add list of packages to profile
[cheatdb.git] / app / templates / users / user_profile_page.html
1 {% extends "base.html" %}
2
3 {% block title %}
4         {{ user.username }}
5 {% endblock %}
6
7 {% block content %}
8
9 <div class="box box_grey">
10         <h2>{{ user.username }}</h2>
11
12         <table>
13                 <tr>
14                         <td>Rank:</td>
15                         <td>
16                                 {{ user.rank.getTitle() }}
17                         </td>
18                 </tr>
19                 <tr>
20                         <td>Accounts:</td>
21                         <td>
22                                 {% if user.forums_username %}
23                                         <a href="https://forum.minetest.net/memberlist.php?mode=viewprofile&un={{ user.forums_username }}">
24                                                 Minetest Forum
25                                         </a>
26                                 {% elif user == current_user %}
27                                         <a href="">Link Forums Account</a>
28                                 {% endif %}
29
30                                 {% if (user.forums_username and user.github_username) or user == current_user %}
31                                         |
32                                 {% endif %}
33
34                                 {% if user.github_username %}
35                                         <a href="https://github.com/{{ user.github_username }}">GitHub</a>
36                                 {% elif user == current_user %}
37                                         <a href="{{ url_for('github_signin_page') }}">Link Github</a>
38                                 {% endif %}
39
40                                 {% if user == current_user %}
41                                         &#x1f30e;
42                                 {% endif %}
43                         </td>
44                 </tr>
45                 {% if user == current_user %}
46                         <tr>
47                                 <td>Email:</td>
48                                 <td>
49                                         {{ user.email }} |
50                                         <a href="">{% if user.email %}change{% else %}add{% endif %}</a>
51                                         &#x1f512;
52                                 </td>
53                         </tr>
54                         <tr>
55                                 <td>Password:</td>
56                                 <td>
57                                         <a href="{{ url_for('user.change_password') }}">
58                                                 {% if user.password %}Change password{% else %}Add password{% endif %}
59                                         </a> &#x1f512;
60                                 </td>
61                         </tr>
62                 {% endif %}
63         </table>
64 </div>
65
66 <div class="box box_grey">
67         <h2>Packages</h2>
68         <ul>
69                 {% for p in user.packages %}
70                         <li><a href="{{ p.getDetailsURL() }}">
71                                 {{ p.title }} by {{ p.author.display_name }}
72                         </a></li>
73                 {% else %}
74                         <li><i>No packages available</i></ul>
75                 {% endfor %}
76         </ul>
77 </div>
78
79 {% if form %}
80         {% from "macros/forms.html" import render_field, render_submit_field %}
81         <form class="box box_grey" action="" method="POST" class="form" role="form">
82                 <h2>Edit Details</h2>
83
84                 <div class="row">
85                         <div class="col-sm-6 col-md-5 col-lg-4">
86                                 {{ form.hidden_tag() }}
87
88                                 {{ render_field(form.display_name, tabindex=240) }}
89
90                                 {{ render_submit_field(form.submit, tabindex=280) }}
91                         </div>
92                 </div>
93         </form>
94 {% endif %}
95 {% endblock %}