aboutsummaryrefslogtreecommitdiff
path: root/pages/article.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pages/article.sh')
-rwxr-xr-xpages/article.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/pages/article.sh b/pages/article.sh
index 3cb5ab7..b7270d8 100755
--- a/pages/article.sh
+++ b/pages/article.sh
@@ -2,6 +2,8 @@
source $SCRIPT_DIR/utils/parse-article.sh
+COMMENTS_FOLDER="$SCRIPT_DIR/pages/$REQUEST_URI/comments" source $SCRIPT_DIR/components/comments.sh
+
if [ $? -gt 0 ]; then
STATUS=404
cat <<ERR
@@ -33,5 +35,49 @@ cat <<ARTICLE
</p>
</div>
</section>
+
+ <br />
+ <hr />
+ <section>
+ <h4>Deixei o seu comentário sobre este artigo</h4>
+ <form method="POST" action="/post" enctype="multipart/form-data">
+ <input type="hidden" name="destination" value="$REQUEST_URI/comments" />
+ <input type="hidden" name="redirect_to" value="$REQUEST_URI" />
+
+ <label for="name">Nome</label>
+ <input id="name" type="text" name="name" value="Anônimo" />
+ <br/>
+
+ <label for="email">Email</label>
+ <input id="email" type="email" name="email" />
+ <br/>
+
+ <label for="message">Mensagem *</label>
+ <textarea id="message" name="message" required></textarea>
+ <small>Campos marcados com asterisco (*) são obrigatórios</small>
+ <br />
+
+ <br />
+ <label for="file-attachment">Anexar arquivo</label>
+ <input id="file-attachment" type="file" name="attachment" />
+
+ <input type="submit" value="Enviar" />
+ </form>
+
+ </section>
</article>
+
+<div class="container">
+ <hr />
+ <h4 style="text-align">Discussão</h4>
+ <br />
+
+ $(
+ if [ -n "$PARSED_COMMENTS" ]; then
+ echo "$PARSED_COMMENTS"
+ else
+ echo '<p style="text-align">Sem mensagens para mostrar.</p>'
+ fi
+ )
+</div>
ARTICLE