Skip to content

Commit

Permalink
fix: Enable multiline comments (#3)
Browse files Browse the repository at this point in the history
If user submitted multiline comment it was generated as single line comment.

Closes #2
  • Loading branch information
jakuboskera authored Oct 19, 2021
1 parent a7d8e00 commit 3855577
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class EntriesModel(db.Model):

id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(), nullable=False)
comment = db.Column(db.String(), nullable=False)
comment = db.Column(db.Text(), nullable=False)
created = db.Column(db.DateTime(), nullable=False)

def __init__(self, name, comment):
Expand Down
3 changes: 3 additions & 0 deletions app/static/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.multiline {
white-space: pre-wrap;
}
2 changes: 1 addition & 1 deletion app/templates/pages/entries/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="card-header">{{ entry.created | strftime }} </div>
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>{{ entry.comment }}</p>
<p class="multiline">{{ entry.comment }}</p>
<footer class="blockquote-footer">
{{ entry.name }}
</footer>
Expand Down
1 change: 1 addition & 0 deletions app/templates/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
<title>{{ title }} Guestbook</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.png') }}" type="image/x-icon" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}" />

0 comments on commit 3855577

Please sign in to comment.