Skip to content

Commit

Permalink
fix messed up table
Browse files Browse the repository at this point in the history
  • Loading branch information
aronwk-aaron committed Mar 11, 2024
1 parent d6b0a91 commit f3e2254
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
22 changes: 8 additions & 14 deletions app/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ def get():
# Delete
# </a>

if not current_app.config["USER_ENABLE_EMAIL"]:
account["2"] = '''N/A'''

if account["4"]:
account["4"] = '''<h2 class="far fa-times-circle text-danger"></h2>'''
else:
Expand All @@ -267,20 +270,11 @@ def get():
else:
account["6"] = '''<h2 class="far fa-check-square text-success"></h2>'''

if current_app.config["USER_ENABLE_EMAIL"]:
if account["8"]:
account["8"] = '''<h2 class="far fa-check-square text-success"></h2>'''
else:
account["8"] = '''<h2 class="far fa-times-circle text-danger"></h2>'''
if not current_app.config["USER_ENABLE_EMAIL"]:
account["8"] = '''<h2 class="far fa-times-circle text-muted"></h2>'''
elif account["8"]:
account["8"] = '''<h2 class="far fa-check-square text-success"></h2>'''
else:
# shift columns to fill in gap of 2
account["2"] = account["3"]
account["3"] = account["4"]
account["4"] = account["5"]
account["5"] = account["6"]
account["6"] = account["7"]
# remove last two columns
del account["7"]
del account["8"]
account["8"] = '''<h2 class="far fa-times-circle text-danger"></h2>'''

return data
8 changes: 2 additions & 6 deletions app/templates/accounts/index.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@
<tr>
<th>Actions</th>
<th>Name</th>
{% if config.USER_ENABLE_EMAIL %}
<th>Email</th>
{% endif %}
<th>Email</th>
<th>GM Level</th>
<th>Locked</th>
<th>Banned</th>
<th>Muted</th>
<th>Registered</th>
{% if config.USER_ENABLE_EMAIL %}
<th>Email Confirmed</th>
{% endif %}
<th>Email Confirmed</th>
</tr>
</thead>
<tbody></tbody>
Expand Down

0 comments on commit f3e2254

Please sign in to comment.