This repository has been archived by the owner on Jun 22, 2021. It is now read-only.
-
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.
Big Changes! Added a page where users can submit a poem to be added to the database. Added a secret page! 🍔🍔🍔 Added a link to Github
- Loading branch information
1 parent
0cb23a7
commit f2dd43c
Showing
9 changed files
with
226 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
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,28 @@ | ||
@page | ||
@model Your_New_Favorite_Poem.Pages.AddPoetModel | ||
@{ | ||
ViewData["Title"] = "Add a Poet"; | ||
} | ||
<head> | ||
<title>Your New Favorite Poem</title> | ||
<link href="~/css/site.css" rel="stylesheet" /> | ||
</head> | ||
<body> | ||
<form method="post" asp-page="AddPoet"> | ||
<section class="Author"> | ||
<label for="Author">What is the name of the poet?</label> | ||
<input type="text" name="author" id="author"> | ||
</section> | ||
<section class="Poem"> | ||
<label for="Poem">What is the url for the poem?</label> | ||
<input type="text" name="poem" id="poem"> | ||
</section> | ||
<section class="PoemName"> | ||
<label for="PoemName">What is the name of the poem?</label> | ||
<input type="text" name="poemName" id="poemName"> | ||
</section> | ||
<section class="submission"> | ||
<input type="submit" value="Submit Poem" asp-page-handler="Submit"> | ||
</section> | ||
</form> | ||
</body> |
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,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using Microsoft.Extensions.Logging; | ||
using Your_New_Favorite_Poem.Database; | ||
using Your_New_Favorite_Poem.Models; | ||
|
||
namespace Your_New_Favorite_Poem.Pages | ||
{ | ||
public class AddPoetModel : PageModel | ||
{ | ||
public async Task OnPostSubmit(string author, string poem, string poemName) | ||
{ | ||
var isValidUri = Uri.TryCreate(poem, UriKind.Absolute, out var poemUri); | ||
if (!isValidUri || poemUri is null) | ||
{ | ||
//notify user of invalid URL for poem | ||
} | ||
else | ||
{ | ||
await _poemDatabase.InsertPoems(new Poem(author, poemName, poemUri)); | ||
} | ||
} | ||
|
||
public AddPoetModel(ILogger<AddPoetModel> logger, PoemDatabase poemDatabase) | ||
{ | ||
_logger = logger; | ||
_poemDatabase = poemDatabase; | ||
|
||
} | ||
private readonly PoemDatabase _poemDatabase; | ||
private readonly ILogger<AddPoetModel> _logger; | ||
public void OnGet() | ||
{ | ||
|
||
} | ||
} | ||
} |
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,96 @@ | ||
@page | ||
@model Your_New_Favorite_Poem.Pages.BurgerSecretsModel | ||
@{ | ||
ViewData["Title"] = "Burger Secrets!"; | ||
} | ||
|
||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link rel="stylesheet" type="text/css" href="style.css"> | ||
<link href="https://fonts.googleapis.com/css?family=Rubik" rel="stylesheet"> | ||
<title>BURGER SECRETS</title> | ||
</head> | ||
<body> | ||
<section id="overlay"> | ||
<img src="https://s3.amazonaws.com/codecademy-content/courses/web-101/unit-6/htmlcss1-img_burger-logo.svg" alt="Davie's Burgers Logo" id="logo"> | ||
<hr> | ||
<form method="post" asp-page="BurgerSecrets"> | ||
<h1>Create a burger!</h1> | ||
<section class="protein"> | ||
<label for="patty">What type of protein would you like?</label> | ||
<input type="text" name="patty" id="patty"> | ||
</section> | ||
<hr> | ||
|
||
<section class="patties"> | ||
<label for="amount">How many patties would you like?</label> | ||
<input type="number" name="amount" id="amount"> | ||
</section> | ||
<hr> | ||
|
||
<section class="cooked"> | ||
<label for="doneness">How do you want your patty cooked</label> | ||
<br> | ||
<span>Rare</span> | ||
<input type="range" name="doneness" id="doneness" value="3" min="1" max="5"> | ||
<span>Well-Done</span> | ||
</section> | ||
<hr> | ||
|
||
<section class="toppings"> | ||
<span>What toppings would you like?</span> | ||
<br> | ||
<input type="checkbox" name="topping" id="lettuce" value="lettuce"> | ||
<label for="lettuce">Lettuce</label> | ||
<input type="checkbox" name="topping" id="tomato" value="tomato"> | ||
<label for="tomato">Tomato</label> | ||
<input type="checkbox" name="topping" id="onion" value="onion"> | ||
<label for="onion">Onion</label> | ||
</section> | ||
<hr> | ||
|
||
<section class="cheesy"> | ||
<span>Would you like to add cheese?</span> | ||
<br> | ||
<input type="radio" name="cheese" id="yes" value="yes"> | ||
<label for="yes">Yes</label> | ||
<input type="radio" name="cheese" id="no" value="yes"> | ||
<label for="no">No</label> | ||
</section> | ||
<hr> | ||
|
||
<section class="bun-type"> | ||
<label for="bun">What type of bun would you like?</label> | ||
<select name="bun" id="bun"> | ||
<option value="sesame">Sesame</option> | ||
<option value="potatoe">Potato</option> | ||
<option value="pretzel">Pretzel</option> | ||
</select> | ||
</section> | ||
<hr> | ||
|
||
<section class="sauce-selection"> | ||
<label for="sauce">What type of sauce would you like?</label> | ||
<input list="sauces" id="sauce" name="sauce"> | ||
<datalist id="sauces"> | ||
<option value="ketchup"></option> | ||
<option value="mayo"></option> | ||
<option value="mustard"></option> | ||
</datalist> | ||
</section> | ||
<hr> | ||
<section class="extra-info"> | ||
<label for="extra">Anything else you want to add?</label> | ||
<br> | ||
<textarea id="extra" name="extra" rows="3" cols="40"></textarea> | ||
</section> | ||
<hr> | ||
|
||
<section class="submission"> | ||
<input type="submit" value="Submit" asp-page ="./Submission"> | ||
</section> | ||
</form> | ||
</section> | ||
</body> | ||
</html> |
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,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace Your_New_Favorite_Poem.Pages | ||
{ | ||
public class BurgerSecretsModel : PageModel | ||
{ | ||
|
||
public void OnGet() | ||
{ | ||
} | ||
} | ||
} |
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,22 @@ | ||
@page | ||
@model Your_New_Favorite_Poem.Pages.SubmissionModel | ||
@{ | ||
ViewData["Title"] = "Submission"; | ||
} | ||
<!DOCTYPE html> | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link rel="stylesheet" type="text/css" href="style.css"> | ||
<link href="https://fonts.googleapis.com/css?family=Rubik" rel="stylesheet"> | ||
<title>Forms Review</title> | ||
</head> | ||
<body> | ||
<section id="overlay"> | ||
<img src="https://s3.amazonaws.com/codecademy-content/courses/web-101/unit-6/htmlcss1-img_burger-logo.svg" alt="Davie's Burgers Logo" id="logo"> | ||
<hr> | ||
<h1>Thanks for your submission!</h1> | ||
<img id="burger" src="https://s3.amazonaws.com/codecademy-content/courses/learn-html-forms/burger.svg" alt="finished burger"> | ||
</section> | ||
</body> | ||
</html> |
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,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace Your_New_Favorite_Poem.Pages | ||
{ | ||
public class SubmissionModel : PageModel | ||
{ | ||
public void OnGet() | ||
{ | ||
} | ||
} | ||
} |