Add banner

This commit is contained in:
pluja 2020-08-30 12:40:20 +02:00
parent 78efa0e85c
commit 22d2a73d79
6 changed files with 12 additions and 50 deletions

View File

@ -60,7 +60,7 @@ def twitter():
else:
profilePic = posts[0].userProfilePic
print("--- {} seconds fetching twitter feed---".format(time.time() - start_time))
return render_template('twitter.html', title='Parasitter | Twitter', posts=posts, avatar=avatarPath, profilePic = profilePic, followedCount=followCount, form=form)
return render_template('twitter.html', title='Yotter | Twitter', posts=posts, avatar=avatarPath, profilePic = profilePic, followedCount=followCount, form=form)
@app.route('/savePost/<url>', methods=['POST'])
@login_required
@ -194,7 +194,7 @@ def youtube():
if videos:
videos.sort(key=lambda x: x.date, reverse=True)
print("--- {} seconds fetching youtube feed---".format(time.time() - start_time))
return render_template('youtube.html', title="Parasitter | Youtube", videos=videos, followCount=followCount)
return render_template('youtube.html', title="Yotter | Youtube", videos=videos, followCount=followCount)
@app.route('/ytfollowing', methods=['GET', 'POST'])
@login_required
@ -333,7 +333,7 @@ def markupString(string):
print(request.url)
return string
## PROXY videos through Parasitter server to the client.
## PROXY videos through Yotter server to the client.
@app.route('/stream', methods=['GET', 'POST'])
@login_required
def stream():

BIN
app/static/img/banner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -6,7 +6,7 @@
{% if title %}
<title>{{ title }} - Parassiter</title>
{% else %}
<title>Parasitter</title>
<title>Yotter</title>
{% endif %}
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='semantic/semantic.min.css') }}">
<link rel="stylesheet" type= "text/css" href="{{ url_for('static',filename='styles.css') }}">
@ -14,7 +14,7 @@
<body>
<div class="ui icon menu overflow-auto">
<a href="{{ url_for('index') }}"><div class="item">
<img src="{{ url_for('static',filename='img/logo.png') }}">
<img src="{{ url_for('static',filename='img/logo_simple.png') }}">
</div></a>
{% if current_user.is_anonymous %}
<a href="{{ url_for('login') }}" class="item">Login</a>

View File

@ -1,45 +0,0 @@
from datetime import datetime, timedelta
import unittest
from app import app, db
from app.models import User, Post
class UserModelCase(unittest.TestCase):
def setUp(self):
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://'
db.create_all()
def tearDown(self):
db.session.remove()
db.drop_all()
def test_password_hashing(self):
u = User(username='susan')
u.set_password('cat')
self.assertFalse(u.check_password('dog'))
self.assertTrue(u.check_password('cat'))
def test_follow(self):
u1 = User(username='john', email='john@example.com')
u2 = User(username='Snowden', realUser=False)
db.session.add(u1)
db.session.add(u2)
db.session.commit()
self.assertEqual(u1.followed.all(), [])
self.assertEqual(u1.followers.all(), [])
u1.follow(u2)
db.session.commit()
self.assertTrue(u1.is_following(u2))
self.assertEqual(u1.followed.count(), 1)
self.assertEqual(u1.followed.first().username, 'Snowden')
self.assertEqual(u2.followers.count(), 1)
self.assertEqual(u2.followers.first().username, 'john')
u1.unfollow(u2)
db.session.commit()
self.assertFalse(u1.is_following(u2))
self.assertEqual(u1.followed.count(), 0)
self.assertEqual(u2.followers.count(), 0)
if __name__ == '__main__':
unittest.main(verbosity=2)

7
yotter.py Normal file
View File

@ -0,0 +1,7 @@
from app import app, db
from app.models import User, Post
@app.shell_context_processor
def make_shell_context():
return {'db': db, 'User': User, 'Post': Post}