appearance tweaks
This commit is contained in:
parent
1c6293fda3
commit
92b314623a
@ -18,7 +18,7 @@ def send_email(subject, sender, recipients, text_body, html_body):
|
|||||||
def send_password_reset_email(user):
|
def send_password_reset_email(user):
|
||||||
token = user.get_reset_password_token()
|
token = user.get_reset_password_token()
|
||||||
hostname = app.config['REAL_HOSTNAME']
|
hostname = app.config['REAL_HOSTNAME']
|
||||||
send_email('[Blog] Reset Password',
|
send_email('reset oily password',
|
||||||
sender=app.config['ADMINS'][0],
|
sender=app.config['ADMINS'][0],
|
||||||
recipients=[user.email],
|
recipients=[user.email],
|
||||||
text_body=render_template('email/reset_password.txt', hostname=hostname, user=user, token=token),
|
text_body=render_template('email/reset_password.txt', hostname=hostname, user=user, token=token),
|
||||||
|
@ -51,7 +51,7 @@ class ResetPasswordRequestForm(FlaskForm):
|
|||||||
submit = SubmitField('Request Password Reset')
|
submit = SubmitField('Request Password Reset')
|
||||||
|
|
||||||
class PostForm(FlaskForm):
|
class PostForm(FlaskForm):
|
||||||
post = TextAreaField('Post:', validators=[DataRequired(), Length(min=1, max=140)])
|
post = TextAreaField('Post', validators=[DataRequired(), Length(min=1, max=140)])
|
||||||
submit = SubmitField('Submit')
|
submit = SubmitField('Submit')
|
||||||
|
|
||||||
class EmptyForm(FlaskForm):
|
class EmptyForm(FlaskForm):
|
||||||
|
@ -44,7 +44,8 @@ def index():
|
|||||||
def explore():
|
def explore():
|
||||||
query = sa.select(Post).order_by(Post.timestamp.desc())
|
query = sa.select(Post).order_by(Post.timestamp.desc())
|
||||||
page = request.args.get('page', 1, type=int)
|
page = request.args.get('page', 1, type=int)
|
||||||
posts = db.paginate(query, page=page, per_page=app.config['POSTS_PER_PAGE'], error_out=False)
|
ppp = app.config['POSTS_PER_PAGE'] * 2
|
||||||
|
posts = db.paginate(query, page=page, per_page=ppp, error_out=False)
|
||||||
next_url = url_for('explore', page=posts.next_num) if posts.has_next else None
|
next_url = url_for('explore', page=posts.next_num) if posts.has_next else None
|
||||||
prev_url = url_for('explore', page=posts.prev_num) if posts.has_prev else None
|
prev_url = url_for('explore', page=posts.prev_num) if posts.has_prev else None
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h1>File Not Found</h1>
|
<h2>File Not Found</h1>
|
||||||
<p><a href="{{ url_for('index') }}">Back</a></p>
|
<p><a href="{{ url_for('index') }}">Back</a></p>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h1>An unexpected error has occurred.</h1>
|
<h2>An unexpected error has occurred.</h1>
|
||||||
<p>Administrator has been notified.</p>
|
<p>Administrator has been notified.</p>
|
||||||
<p><a href="{{ url_for('index') }}">Back</a></p>
|
<p><a href="{{ url_for('index') }}">Back</a></p>
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
<table>
|
|
||||||
<tr style="vertical-align: top;">
|
<tr style="vertical-align: top;">
|
||||||
<td style="vertical-align: middle; width: 60px;">
|
<td style="vertical-align: middle; width: 60px;">
|
||||||
<img style="vertical-align: middle; width: 40px;" src="data:image/png;base64,{{ post.author.gen_avatar(write_png=False) }}">
|
<img style="vertical-align: middle; width: 40px;" src="data:image/png;base64,{{ post.author.gen_avatar(write_png=False) }}">
|
||||||
@ -10,4 +9,3 @@
|
|||||||
{{ post.body }}
|
{{ post.body }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
|
||||||
|
14
backend/app/templates/_postnav.html
Normal file
14
backend/app/templates/_postnav.html
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<div>
|
||||||
|
{% if prev_url %}
|
||||||
|
<a class="button" href="{{ prev_url }}">Newer</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="button" aria-disabled=true>Newer</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if next_url %}
|
||||||
|
<a class="button" href="{{ next_url }}">Older</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="button" aria-disabled=true>Older</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
@ -3,9 +3,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='simple.css') }}">
|
<link rel="stylesheet" href="{{ url_for('static', filename='simple.css') }}">
|
||||||
{% if title %}
|
{% if title %}
|
||||||
<title>{{ title }} - blogpage</title>
|
<title>{{ title }} - Page</title>
|
||||||
{% else %}
|
{% else %}
|
||||||
<title>Welcome to blog.</title>
|
<title>oily</title>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -21,8 +21,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
<h1>oily.dad</h1>
|
<h2>oily.dad</h2>
|
||||||
<h4>destroy me</h4>
|
<h5>oilydada7ckiseinkbeathsefwgkvjrce743xy7x7iiybkuxh4vheead.onion</h5>
|
||||||
</header>
|
</header>
|
||||||
<hr>
|
<hr>
|
||||||
{% with messages = get_flashed_messages() %}
|
{% with messages = get_flashed_messages() %}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Edit Profile</h1>
|
<h2>Edit Profile</h1>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
<p>
|
<p>
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
{% block explorecurrent %}class="current"{% endblock %}
|
{% block explorecurrent %}class="current"{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Hello, {{ current_user.username }}!</h1>
|
|
||||||
{% if form %}
|
{% if form %}
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
@ -17,11 +16,13 @@
|
|||||||
<p>{{ form.submit() }}</p>
|
<p>{{ form.submit() }}</p>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<table>
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
{% include '_post.html' %}
|
{% include '_post.html' %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if prev_url %}<a href="{{ prev_url }}">Newer Posts</a>{% endif %}
|
</table>
|
||||||
{% if next_url %}<a href="{{ next_url }}">Older Posts</a>{% endif %}
|
|
||||||
|
{% include '_postnav.html' %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
{% block indexcurrent %}class="current"{% endblock %}
|
{% block indexcurrent %}class="current"{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Hello, {{ current_user.username }}!</h1>
|
|
||||||
{% if form %}
|
{% if form %}
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
@ -17,11 +16,13 @@
|
|||||||
<p>{{ form.submit() }}</p>
|
<p>{{ form.submit() }}</p>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<table>
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
{% include '_post.html' %}
|
{% include '_post.html' %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if prev_url %}<a href="{{ prev_url }}">Newer Posts</a>{% endif %}
|
</table>
|
||||||
{% if next_url %}<a href="{{ next_url }}">Older Posts</a>{% endif %}
|
|
||||||
|
{% include '_postnav.html' %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
{% block logincurrent %}class="current"{% endblock %}
|
{% block logincurrent %}class="current"{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Sign In</h1>
|
<h2>Sign In</h1>
|
||||||
<form action="" method="post" novalidate>
|
<form action="" method="post" novalidate>
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
<p>
|
<p>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h1>Register</h1>
|
<h2>Register</h1>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
<p>
|
<p>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h1>Reset Your Password</h1>
|
<h2>Reset Your Password</h1>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
<p>
|
<p>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Reset Password</h1>
|
<h2>Reset Password</h1>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
<p>
|
<p>
|
||||||
|
@ -3,19 +3,15 @@
|
|||||||
{% block profilecurrent %}class="current"{% endblock %}
|
{% block profilecurrent %}class="current"{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<table>
|
<article>
|
||||||
<tr valign="top">
|
<h2>
|
||||||
<td style="vertical-align: middle; text-align: center;">
|
<img style="vertical-align: middle; width: 60px;" src="data:image/png;base64,{{ user.gen_avatar(write_png=False) }}">
|
||||||
<img style="vertical-align: middle;" src="data:image/png;base64,{{ user.gen_avatar(write_png=False) }}">
|
User: {{ user.username }}
|
||||||
</td>
|
</h2>
|
||||||
<td>
|
|
||||||
<h1>User: {{ user.username }}</h1>
|
|
||||||
<h1>CUdebug: {{ current_user }}</h1>
|
|
||||||
<h1>Udebug: {{ user }}</h1>
|
|
||||||
{% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %}
|
{% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %}
|
||||||
{% if user.last_seen %}<p>Last activity: {{ user.last_seen }}</p>{% endif %}
|
{% if user.last_seen %}<p>Last activity: {{ user.last_seen }}</p>{% endif %}
|
||||||
{% if user == current_user %}
|
{% if user == current_user %}
|
||||||
<p><a href="{{ url_for('edit_profile') }}">Edit Profile</a></p>
|
<p><a class="button" href="{{ url_for('edit_profile') }}">Edit Profile</a></p>
|
||||||
{% elif not current_user.is_following(user) %}
|
{% elif not current_user.is_following(user) %}
|
||||||
<p>
|
<p>
|
||||||
<form action="{{ url_for('follow', username=user.username) }}" method="post">
|
<form action="{{ url_for('follow', username=user.username) }}" method="post">
|
||||||
@ -31,17 +27,16 @@
|
|||||||
</form>
|
</form>
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</article>
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
<table>
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
{% include '_post.html' %}
|
{% include '_post.html' %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if prev_url %}<a href="{{ prev_url }}">Newer Posts</a>{% endif %}
|
</table>
|
||||||
{% if next_url %}<a href="{{ next_url }}">Older Posts</a>{% endif %}
|
|
||||||
|
{% include '_postnav.html' %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user