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

@ -80,4 +80,8 @@ button:hover, .button:hover{
margin: 20px auto;
font-size:1.8em;
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>
<span class='pc-avi-label'>{{ session['cc'] }}</span><br /><br />
</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' %}
</body>
</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']))
db.commit()
return redirect(url_for('home'))
#cc connection
@app.route('/cc_connect')
def cc_connect():
return render_template('cc_connect.html')