1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-11-25 16:48:58 +00:00

Compare commits

...

4 commits

Author SHA1 Message Date
63c51ba6b2
didn't mean to commit that oops 2020-01-20 19:51:44 +10:00
5d8aa010fa
add an error message just in case 2020-01-20 19:50:16 +10:00
6db6f12687
capitalisation is important 2020-01-20 19:48:07 +10:00
cbb90e8704
added missing endif 2020-01-20 16:18:28 +10:00
3 changed files with 5 additions and 3 deletions

View file

@ -81,7 +81,8 @@ def bot_accounts_add(mysql, cfg):
username = client.account_verify_credentials()['username']
if username != session['username']:
error = "Please authenticate as {}.".format(session['username'])
print("Auth error - {} is not {}".format(session['username'], username))
if username.lower() == session['username'].lower():
error += " Make sure you capitalised the name properly - @user and @USER are different."
return render_template("bot/accounts_add.html", error = error)
except:
session['step'] = 1

View file

@ -16,6 +16,7 @@
<div class="container centred">
<form method="POST">
{% if session['step'] == 1 %}
<p>Please enter the full handle of the account you'd like your bot to learn from. Note that this is case sensitive.</p>
<label for="account" class="important">Account handle</label>
<input type="text" name="account" class="full-width" placeholder="@user@example.com">
<br>

View file

@ -23,7 +23,7 @@
<div class="panel-text">
{% set handle_list = bot['handle'].split('@') %}
<div class="panel-name">@{{ handle_list[1] }}<span class="subtle tiny">@{{ handle_list[2] }}</span></div>
<div class="panel-status">{{ "Online" if bot['enabled'] else "Offline"}}, learning from {{ bot_users[bot['handle']] }} accounts.{% if bot['handle'] in next_posts %} Next post in {{ next_posts[bot['handle']][0] }} minutes.{% endif %}</div>
<div class="panel-status">{{ "Online" if bot['enabled'] else "Offline"}}, learning from {{ bot_users[bot['handle']] }} accounts.{% if bot['handle'] in next_posts %} Next post in {{ next_posts[bot['handle']][0] }} minute{% if next_posts[bot['handle']][0] != 1 %}s{% endif %}{% endif %}.</div>
</div>
<div class="panel-actions">
<a class="button btn-secondary" href="/bot/toggle/{{ bot['handle'] }}" title="Turn on/off"><i class="fas fa-power-off"></i></a><a class="button btn-secondary" href="/bot/edit/{{ bot['handle'] }}" title="Configure"><i class="fas fa-cog"></i></a><a class="button btn-secondary" href="/bot/accounts/{{ bot['handle'] }}" title="Accounts learned from"><i class="fas fa-users"></i></a><a class="button btn-secondary" href="/bot/blacklist/{{ bot['handle'] }}" title="Banned words"><i class="fas fa-strikethrough"></i></a><a class="button btn-secondary" href="/bot/chat/{{ bot['handle'] }}" title="Chat"><i class="fas fa-comment"></i></a><a class="button btn-dangerous" href="/bot/delete/{{ bot['handle'] }}" title="Delete"><i class="fas fa-trash"></i></a>