Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: miguelgrinberg/microblog
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.11
Choose a base ref
...
head repository: miguelgrinberg/microblog
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.12
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Jul 30, 2024

  1. Verified

    This commit was signed with the committer’s verified signature.
    miguelgrinberg Miguel Grinberg
    Copy the full SHA
    10740f4 View commit details
Showing with 7 additions and 2 deletions.
  1. +2 −0 app/__init__.py
  2. +1 −1 app/templates/_post.html
  3. +1 −0 app/templates/base.html
  4. +3 −1 app/templates/user.html
2 changes: 2 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_mail import Mail
from flask_moment import Moment
from config import Config

app = Flask(__name__)
@@ -15,6 +16,7 @@
login = LoginManager(app)
login.login_view = 'login'
mail = Mail(app)
moment = Moment(app)

if not app.debug:
if app.config['MAIL_SERVER']:
2 changes: 1 addition & 1 deletion app/templates/_post.html
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
<a href="{{ url_for('user', username=post.author.username) }}">
{{ post.author.username }}
</a>
says:
said {{ moment(post.timestamp).fromNow() }}:
<br>
{{ post.body }}
</td>
1 change: 1 addition & 0 deletions app/templates/base.html
Original file line number Diff line number Diff line change
@@ -62,5 +62,6 @@
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous">
</script>
{{ moment.include_moment() }}
</body>
</html>
4 changes: 3 additions & 1 deletion app/templates/user.html
Original file line number Diff line number Diff line change
@@ -7,7 +7,9 @@
<td>
<h1>User: {{ user.username }}</h1>
{% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %}
{% if user.last_seen %}<p>Last seen on: {{ user.last_seen }}</p>{% endif %}
{% if user.last_seen %}
<p>Last seen on: {{ moment(user.last_seen).format('LLL') }}</p>
{% endif %}
<p>{{ user.followers_count() }} followers, {{ user.following_count() }} following.</p>
{% if user == current_user %}
<p><a href="{{ url_for('edit_profile') }}">Edit your profile</a></p>