]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/users/user_profile_page.html
Add topics todo list based on forum parser
[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 {% if not current_user.is_authenticated and user.rank == user.rank.NOT_JOINED and user.forums_username %}
10 <div class="box box_grey alert alert-info">
11         Is this you? Claim your account now!
12
13         <a class="alert_right button" href="{{ url_for('user_claim_page', username=user.forums_username) }}">Claim</a>
14 </div>
15 {% endif %}
16
17 <div class="box box_grey">
18         <h2>{{ user.display_name }}</h2>
19
20         <table class="box-body">
21                 <tr>
22                         <td>Rank:</td>
23                         <td>
24                                 {{ user.rank.getTitle() }}
25                         </td>
26                 </tr>
27                 <tr>
28                         <td>Accounts:</td>
29                         <td>
30                                 {% if user.forums_username %}
31                                         <a href="https://forum.minetest.net/memberlist.php?mode=viewprofile&un={{ user.forums_username }}">
32                                                 Minetest Forum
33                                         </a>
34                                 {% elif user == current_user %}
35                                         No forum account
36                                 {% endif %}
37
38                                 {% if (user.forums_username and user.github_username) or user == current_user %}
39                                         |
40                                 {% endif %}
41
42                                 {% if user.github_username %}
43                                         <a href="https://github.com/{{ user.github_username }}">GitHub</a>
44                                 {% elif user == current_user %}
45                                         <a href="{{ url_for('github_signin_page') }}">Link Github</a>
46                                 {% endif %}
47
48                                 {% if user == current_user %}
49                                         &#x1f30e;
50                                 {% endif %}
51                         </td>
52                 </tr>
53                 {% if user == current_user %}
54                         <tr>
55                                 <td>Password:</td>
56                                 <td>
57                                         {% if user.password %}
58                                                 Set | <a href="{{ url_for('user.change_password') }}">Change</a>
59                                         {% else %}
60                                                 Not set | <a href="{{ url_for('set_password_page') }}">Set</a>
61                                         {% endif %}
62                                 </td>
63                         </tr>
64                 {% endif %}
65         </table>
66 </div>
67
68 {% if form %}
69         {% from "macros/forms.html" import render_field, render_submit_field %}
70         <div class="box box_grey">
71                 <h2>Edit Details</h2>
72
73                 <form action="" method="POST" class="form box-body" role="form">
74                         <div class="row">
75                                 <div class="col-sm-6 col-md-5 col-lg-4">
76                                         {{ form.hidden_tag() }}
77
78                                         {% if user.checkPerm(current_user, "CHANGE_DNAME") %}
79                                                 {{ render_field(form.display_name, tabindex=230) }}
80                                         {% endif %}
81
82                                         {% if user.checkPerm(current_user, "CHANGE_EMAIL") %}
83                                                 {{ render_field(form.email, tabindex=240) }}
84                                                 <i>We'll send you an email to verify it if changed.</i>
85                                         {% endif %}
86
87                                         {% if user.checkPerm(current_user, "CHANGE_RANK") %}
88                                                 {{ render_field(form.rank, tabindex=250) }}
89                                         {% endif %}
90
91                                         {{ render_submit_field(form.submit, tabindex=280) }}
92                                 </div>
93                         </div>
94                 </form>
95         </div>
96 {% endif %}
97
98 {% from "macros/packagegridtile.html" import render_pkggrid %}
99 {{ render_pkggrid(packages, show_author=False) }}
100
101 {% if topics_to_add %}
102         <div class="box box_grey">
103                 <h2>Topics to Add</h2>
104
105                 <table class="box-body">
106                         <tr>
107                                 <th>Id</th>
108                                 <th>Title</th>
109                                 <th>Name</th>
110                                 <th>Link</th>
111                         </tr>
112                         {% for topic in topics_to_add %}
113                                 <tr>
114                                         <td>{{ topic.topic_id }}</td>
115                                         <td>[{{ topic.getType().value }}] <a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a></td>
116                                         <td>{{ topic.name or ""}}</td>
117                                         <td><a href="{{ topic.link }}">{{ topic.link | domain }}</a></td>
118                                 </tr>
119                         {% endfor %}
120                 </table>
121         </div>
122 {% endif %}
123
124 {% endblock %}