]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/users/user_profile_page.html
Improve form CSS
[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         </table>
46 </div>
47
48 <div class="box box_grey">
49         <h2>Packages</h2>
50         <ul>
51                 {% for p in user.packages %}
52                         <li><a href="{{ p.getDetailsURL() }}">
53                                 {{ p.title }} by {{ p.author.display_name }}
54                         </a></li>
55                 {% else %}
56                         <li><i>No packages available</i></ul>
57                 {% endfor %}
58         </ul>
59         {% if user == current_user or user.checkPerm(current_user, "CHANGE_AUTHOR") %}
60                 <p><a class="button" href="{{ url_for('create_edit_package_page', author=user.username) }}">
61                         Create
62                 </a></p>
63         {% endif %}
64 </div>
65
66 {% if form %}
67         {% from "macros/forms.html" import render_field, render_submit_field %}
68         <div class="box box_grey">
69                 <h2>Edit Details</h2>
70
71                 <form action="" method="POST" class="form" role="form">
72                         <div class="row">
73                                 <div class="col-sm-6 col-md-5 col-lg-4">
74                                         {{ form.hidden_tag() }}
75
76                                         {{ render_field(form.display_name, tabindex=230) }}
77
78                                         {% if user.checkPerm(current_user, "CHANGE_EMAIL") %}
79                                                 {{ render_field(form.email, tabindex=240) }}
80                                         {% endif %}
81
82                                         {% if user.checkPerm(current_user, "CHANGE_RANK") %}
83                                                 {{ render_field(form.rank, tabindex=250) }}
84                                         {% endif %}
85
86                                         {{ render_submit_field(form.submit, tabindex=280) }}
87                                 </div>
88                         </div>
89                 </form>
90         </div>
91 {% endif %}
92 {% endblock %}