started adding the curious cat connection functionality

This commit is contained in:
Lynne Megido 2018-11-12 18:40:50 +10:00
parent d7c348e594
commit 2bb182bf85
Signed by: lynnesbian
GPG key ID: FB7B970303ACE499
4 changed files with 35 additions and 1 deletions

View file

@ -81,3 +81,7 @@ button:hover, .button:hover{
font-size:1.8em; font-size:1.8em;
font-weight:300; font-weight:300;
} }
#ccprompt {
font-size: 1.2em;
line-height:2.6em;
}

18
templates/cc_connect.html Normal file
View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Curious Greg - Curious Cat Connection</title>
{% include 'imports.html' %}
</head>
<body>
<h1>Connect to Curious Cat</h1>
<!-- <div id='logo-main'></div> -->
<form action='/internal/ccc_a' method='POST'>
<div id='form-avi' style="background-image:url('https://lynnesbian.space/res/ceres/cc_smol.png')"></div>
<label for='cc'>Curious Cat username</label><br />
<input name='cc' required /><br />
<button>Connect</button>
</form>
{% include 'footer.html' %}
</body>
</html>

View file

@ -17,6 +17,12 @@
<div class='pc-avi' style={{ ccbg }}></div> <div class='pc-avi' style={{ ccbg }}></div>
<span class='pc-avi-label'>{{ session['cc'] }}</span><br /><br /> <span class='pc-avi-label'>{{ session['cc'] }}</span><br /><br />
</div> </div>
{% if session['cc'] == "None" or session['cc'] == None %}
<div id='ccprompt'>
You haven't connected your Curious Cat account yet.<br>
<a href='/cc_connect' class='button'>Connect</a>
</div>
{% endif %}
{% include 'footer.html' %} {% include 'footer.html' %}
</body> </body>
</html> </html>

6
web.py
View file

@ -176,3 +176,9 @@ def create_account():
c.execute("INSERT INTO data (username, instance, avi, password, secret, client_id, client_secret) VALUES (%s, %s, %s, %s, %s, %s, %s)", (session['username'], session['instance'], session['avi'], pw, session['secret'], session['client_id'], session['client_secret'])) c.execute("INSERT INTO data (username, instance, avi, password, secret, client_id, client_secret) VALUES (%s, %s, %s, %s, %s, %s, %s)", (session['username'], session['instance'], session['avi'], pw, session['secret'], session['client_id'], session['client_secret']))
db.commit() db.commit()
return redirect(url_for('home')) return redirect(url_for('home'))
#cc connection
@app.route('/cc_connect')
def cc_connect():
return render_template('cc_connect.html')