jinggujiwoo7 commited on
Commit
f619d18
1 Parent(s): 3dc566d

Create templates/question.html

Browse files
Files changed (1) hide show
  1. templates/question.html +29 -0
templates/question.html ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+
3
+ {% block content %}
4
+ <h2>{{ question.content }}</h2>
5
+
6
+ <h3>Comments</h3>
7
+ <ul>
8
+ {% for comment in question.comments %}
9
+ <li>
10
+ <p><strong>{{ comment.username }}</strong></p>
11
+ {% if comment.audio_file %}
12
+ <audio controls>
13
+ <source src="{{ url_for('static', filename='audio/' ~ comment.audio_file) }}" type="audio/mpeg">
14
+ Your browser does not support the audio element.
15
+ </audio>
16
+ {% endif %}
17
+ <p>{{ comment.text_reply }}</p>
18
+ </li>
19
+ {% endfor %}
20
+ </ul>
21
+
22
+ <h3>Add a Comment</h3>
23
+ <form action="{{ url_for('question', question_id=question.id) }}" method="post" enctype="multipart/form-data">
24
+ <input type="text" name="username" placeholder="Your name" required><br>
25
+ <textarea name="text_reply" placeholder="Your comment"></textarea><br>
26
+ <input type="file" name="audio" accept="audio/*"><br>
27
+ <button type="submit">Submit</button>
28
+ </form>
29
+ {% endblock %}