diff options
author | Jefferson Julio <[email protected]> | 2021-06-02 23:38:09 -0300 |
---|---|---|
committer | Jefferson Julio <[email protected]> | 2021-06-02 23:38:09 -0300 |
commit | 7d773221e7711c4e534e89264c719b4cc5aabb1f (patch) | |
tree | baf59501215d3ee874b865c70c9b9d1408545a16 /pages/article.sh | |
parent | 5caf63d3897f353717fd69be9174d028fd078b23 (diff) | |
download | blog.sh-7d773221e7711c4e534e89264c719b4cc5aabb1f.tar.bz2 blog.sh-7d773221e7711c4e534e89264c719b4cc5aabb1f.zip |
support for comments on pages
Diffstat (limited to 'pages/article.sh')
-rwxr-xr-x | pages/article.sh | 46 |
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 |