-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from fac-17/feature/createcard
Feature/createcard
- Loading branch information
Showing
7 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const postNewCard = require("../model/database/queries/postNewCard") | ||
|
||
exports.newtarot = (req, res) => { | ||
res.render("newtarot") | ||
} | ||
|
||
exports.newtarotpost = (req, res) => { | ||
postNewCard.postNewCard(req.body["tarot-title"], req.body["tarot-description"]) | ||
.then(result => { | ||
console.log({ result }); | ||
res.render("newtarot"); | ||
}) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const connection = require("../db_connection"); | ||
|
||
exports.postNewCard = (tarottitle, tarotdescription) => { | ||
return connection.query("INSERT INTO tarot_cards (tarot_heading, tarot_description, tarot_image) VALUES($1,$2,$3)", | ||
[tarottitle, tarotdescription, "<svg></svg>"] | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
<h1>The Post-Modern Tarot Lady</h1> | ||
<p>Select one of the cards below to get your tarot card reading:</p> | ||
<h1>DENK Tarot Lady</h1> | ||
<p>Select one of the cards below to get your tarot card reading</p> | ||
<div class="center"> | ||
<section class="createCard"> | ||
<p>Have you had a card vision?</p> | ||
<p><a href="/newtarot">+ Create Card</a> | ||
</p> | ||
|
||
<section class="createCard"></section> | ||
</section> | ||
|
||
<section class="selectCard"> | ||
<section class="selectCard"> | ||
|
||
{{> hand}} | ||
{{> hand}} | ||
|
||
{{!-- <a href="/tarot">Click here!</a> --}} | ||
</section> | ||
{{!-- <a href="/tarot">Click here!</a> --}} | ||
</section> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<section class="add-tarot"> | ||
<h1> | ||
Add your tarot card vision below | ||
</h1> | ||
|
||
<form class="add-tarot-form" method="POST" action="/newtarot"> | ||
<label for="tarotTitle">Enter tarot card title</label><br> | ||
<input name="tarot-title" id="tarotTitle"><br> | ||
<label for="tarotDescription">Enter tarot description</label><br> | ||
<input name="tarot-description" id="tarotDescription"><br> | ||
<input type="submit"> | ||
</form> | ||
</section> |