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):
|
||||
token = user.get_reset_password_token()
|
||||
hostname = app.config['REAL_HOSTNAME']
|
||||
send_email('[Blog] Reset Password',
|
||||
send_email('reset oily password',
|
||||
sender=app.config['ADMINS'][0],
|
||||
recipients=[user.email],
|
||||
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')
|
||||
|
||||
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')
|
||||
|
||||
class EmptyForm(FlaskForm):
|
||||
|
@ -44,7 +44,8 @@ def index():
|
||||
def explore():
|
||||
query = sa.select(Post).order_by(Post.timestamp.desc())
|
||||
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
|
||||
prev_url = url_for('explore', page=posts.prev_num) if posts.has_prev else None
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>File Not Found</h1>
|
||||
<h2>File Not Found</h1>
|
||||
<p><a href="{{ url_for('index') }}">Back</a></p>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>An unexpected error has occurred.</h1>
|
||||
<h2>An unexpected error has occurred.</h1>
|
||||
<p>Administrator has been notified.</p>
|
||||
<p><a href="{{ url_for('index') }}">Back</a></p>
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
<table>
|
||||
<tr style="vertical-align: top;">
|
||||
<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) }}">
|
||||
@ -10,4 +9,3 @@
|
||||
{{ post.body }}
|
||||
</td>
|
||||
</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>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='simple.css') }}">
|
||||
{% if title %}
|
||||
<title>{{ title }} - blogpage</title>
|
||||
<title>{{ title }} - Page</title>
|
||||
{% else %}
|
||||
<title>Welcome to blog.</title>
|
||||
<title>oily</title>
|
||||
{% endif %}
|
||||
</head>
|
||||
<body>
|
||||
@ -21,8 +21,8 @@
|
||||
{% endif %}
|
||||
|
||||
</nav>
|
||||
<h1>oily.dad</h1>
|
||||
<h4>destroy me</h4>
|
||||
<h2>oily.dad</h2>
|
||||
<h5>oilydada7ckiseinkbeathsefwgkvjrce743xy7x7iiybkuxh4vheead.onion</h5>
|
||||
</header>
|
||||
<hr>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Edit Profile</h1>
|
||||
<h2>Edit Profile</h1>
|
||||
<form action="" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
<p>
|
||||
|
@ -3,7 +3,6 @@
|
||||
{% block explorecurrent %}class="current"{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Hello, {{ current_user.username }}!</h1>
|
||||
{% if form %}
|
||||
<form action="" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
@ -17,11 +16,13 @@
|
||||
<p>{{ form.submit() }}</p>
|
||||
</form>
|
||||
{% endif %}
|
||||
<table>
|
||||
{% for post in posts %}
|
||||
{% include '_post.html' %}
|
||||
{% endfor %}
|
||||
{% if prev_url %}<a href="{{ prev_url }}">Newer Posts</a>{% endif %}
|
||||
{% if next_url %}<a href="{{ next_url }}">Older Posts</a>{% endif %}
|
||||
</table>
|
||||
|
||||
{% include '_postnav.html' %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
{% block indexcurrent %}class="current"{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Hello, {{ current_user.username }}!</h1>
|
||||
{% if form %}
|
||||
<form action="" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
@ -17,11 +16,13 @@
|
||||
<p>{{ form.submit() }}</p>
|
||||
</form>
|
||||
{% endif %}
|
||||
<table>
|
||||
{% for post in posts %}
|
||||
{% include '_post.html' %}
|
||||
{% endfor %}
|
||||
{% if prev_url %}<a href="{{ prev_url }}">Newer Posts</a>{% endif %}
|
||||
{% if next_url %}<a href="{{ next_url }}">Older Posts</a>{% endif %}
|
||||
</table>
|
||||
|
||||
{% include '_postnav.html' %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
{% block logincurrent %}class="current"{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Sign In</h1>
|
||||
<h2>Sign In</h1>
|
||||
<form action="" method="post" novalidate>
|
||||
{{ form.hidden_tag() }}
|
||||
<p>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>Register</h1>
|
||||
<h2>Register</h1>
|
||||
<form action="" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
<p>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>Reset Your Password</h1>
|
||||
<h2>Reset Your Password</h1>
|
||||
<form action="" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
<p>
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Reset Password</h1>
|
||||
<h2>Reset Password</h1>
|
||||
<form action="" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
<p>
|
||||
|
@ -3,45 +3,40 @@
|
||||
{% block profilecurrent %}class="current"{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td style="vertical-align: middle; text-align: center;">
|
||||
<img style="vertical-align: middle;" src="data:image/png;base64,{{ user.gen_avatar(write_png=False) }}">
|
||||
</td>
|
||||
<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.last_seen %}<p>Last activity:{{ user.last_seen }}</p>{% endif %}
|
||||
{% if user == current_user %}
|
||||
<p><a href="{{ url_for('edit_profile') }}">Edit Profile</a></p>
|
||||
{% elif not current_user.is_following(user) %}
|
||||
<p>
|
||||
<form action="{{ url_for('follow', username=user.username) }}" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.submit(value='Follow') }}
|
||||
</form>
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
<form action="{{ url_for('unfollow', username=user.username) }}" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.submit(value='Unfollow') }}
|
||||
</form>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<article>
|
||||
<h2>
|
||||
<img style="vertical-align: middle; width: 60px;" src="data:image/png;base64,{{ user.gen_avatar(write_png=False) }}">
|
||||
User: {{ user.username }}
|
||||
</h2>
|
||||
{% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %}
|
||||
{% if user.last_seen %}<p>Last activity: {{ user.last_seen }}</p>{% endif %}
|
||||
{% if user == current_user %}
|
||||
<p><a class="button" href="{{ url_for('edit_profile') }}">Edit Profile</a></p>
|
||||
{% elif not current_user.is_following(user) %}
|
||||
<p>
|
||||
<form action="{{ url_for('follow', username=user.username) }}" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.submit(value='Follow') }}
|
||||
</form>
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
<form action="{{ url_for('unfollow', username=user.username) }}" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.submit(value='Unfollow') }}
|
||||
</form>
|
||||
</p>
|
||||
{% endif %}
|
||||
</article>
|
||||
<hr>
|
||||
|
||||
<table>
|
||||
{% for post in posts %}
|
||||
{% include '_post.html' %}
|
||||
{% endfor %}
|
||||
{% if prev_url %}<a href="{{ prev_url }}">Newer Posts</a>{% endif %}
|
||||
{% if next_url %}<a href="{{ next_url }}">Older Posts</a>{% endif %}
|
||||
</table>
|
||||
|
||||
{% include '_postnav.html' %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user