Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Commit

Permalink
Css, Author Picutres, USing List and LINQ for poem info
Browse files Browse the repository at this point in the history
Lots of changes here!
  • Loading branch information
MetzinAround committed Aug 2, 2020
1 parent 075d8f4 commit b404bdb
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 55 deletions.
12 changes: 12 additions & 0 deletions Your New Favorite Poem/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "3.1.6",
"commands": [
"dotnet-ef"
]
}
}
}
30 changes: 30 additions & 0 deletions Your New Favorite Poem/Constants/PoetsConstants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Your_New_Favorite_Poem.Models;

namespace Your_New_Favorite_Poem.Constants
{
public static class PoetsConstants
{
public static IReadOnlyList<Poem> PoemList { get; } = new List<Poem>
{
new Poem {Author = "Ocean Vuong", Title = "One Day I'll Love Ocean Vuong", URL = new Uri ("https://www.poetryinvoice.com/poems/someday-ill-love-ocean-vuong")},
new Poem {Author = "Ocean Vuong", Title = "Untitled (Blue, Green, & Brown)", URL = new Uri ("https://www.triquarterly.org/issues/issue-146/untitled-blue-green-brown-oil-canvas-mark-rothko-1952")},
new Poem {Author = "Mary Oliver", Title = "The Summer Day", URL = new Uri ("https://wordsfortheyear.com/2015/06/21/the-summer-day-by-mary-oliver/")},
new Poem {Author = "Mary Oliver", Title = "Wild Geese", URL = new Uri ("http://www.phys.unm.edu/~tw/fas/yits/archive/oliver_wildgeese.html")},
new Poem {Author = "Layli Long Soldier", Title = "38", URL = new Uri ("https://onbeing.org/poetry/38/")},
new Poem {Author = "Layli Long Soldier", Title = "Obligations 2", URL = new Uri ("https://www.poetryfoundation.org/poems/149976/obligations-2")},
new Poem {Author = "Terrance Hayes", Title = "I lock you in an American sonnet that is part prison", URL = new Uri ("https://www.poetryfoundation.org/poetrymagazine/poems/143917/american-sonnet-for-my-past-and-future-assassin-598dc83c976f1")},
new Poem {Author = "Terrance Hayes", Title = "Probably, Ghosts Are Allergic To Us. Our Uproarious", URL = new Uri ("https://rhymings.com/terrance-hayes/probably-ghosts-are-allergic-to-us-our-uproarious/")},
new Poem {Author = "Shay Alexi", Title = "John Mayer's 'Your Body is a Wonderland'is Kinda Gross But", URL = new Uri ("http://www.glass-poetry.com/journal/2018/may/alexi-john.html")},
new Poem {Author = "Shay Alexi", Title = "OUR MOTHER IS A NIGHTWITCH OR AN ODE TO FEMME FRIENDSHIP", URL = new Uri ("https://tinderboxpoetry.com/our-mother-is-a-nightwitch-or-an-ode-to-femme-friendship")},
new Poem {Author = "Marci Calabretta Cancio-Bello", Title = "In the Animal Garden of My Body", URL = new Uri ("https://poets.org/poem/animal-garden-my-body")},
new Poem {Author = "Marci Calabretta Cancio-Bello", Title = "Vase of Ashes", URL = new Uri ("https://www.tupeloquarterly.com/vase-of-ashes-by-marci-calabretta-cancio-bello/")},
new Poem {Author = "Martín Espada", Title = "Flowers and Bullets", URL = new Uri ("https://poets.org/poem/flowers-and-bullets")},
new Poem {Author = "Martín Espada", Title = "How We Could Have Lived or Died This Way", URL = new Uri ("https://poets.org/poem/how-we-could-have-lived-or-died-way")}

};
}
}
9 changes: 5 additions & 4 deletions Your New Favorite Poem/Models/Products.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

namespace Your_New_Favorite_Poem.Models
{
internal class Products
public class Poem
{
public string Name { get; set; }
public string Country { get; set; }
public string Poems { get; set; }
public string Author { get; set; }
public string Title { get; set; }
public Uri URL { get; set; }
}


}
101 changes: 73 additions & 28 deletions Your New Favorite Poem/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<head>
<title>Your New Favorite Poem</title>
<link href="~/css/site.css" rel="stylesheet" />
</head>
<body>
<section class="text-center" id="Banner">
Expand All @@ -16,91 +17,135 @@
This website is a place to discover new poets, the type of poets you wouldn't necessarily find in your English class.
They're worthy of a look and especially worthy of supporting.
</p>

</section>
<div class="buttonmove">
<form method="post" asp-page="Index">
<input class="button" type="submit" value="Generate Random Poem" asp-page-handler="RandomPoem" formtarget="_blank" />
</form>
</div>
<!--Ocean Vuong Poems-->
<section class="poets" id="Ocean Vuong">
<h2>Ocean Vuong Poems</h2>
<br />
<ul>
<li><a href="https://www.poetryinvoice.com/poems/someday-ill-love-ocean-vuong" target="_blank">"Someday I'll Love Ocean Vuong"</a></li>
<li><a href="https://www.triquarterly.org/issues/issue-146/untitled-blue-green-brown-oil-canvas-mark-rothko-1952" target="_blank">"Untitled (Blue, Green, & Brown)"</a></li>
@foreach (var poem in Your_New_Favorite_Poem.Constants.PoetsConstants.PoemList.Where(x => x.Author is "Ocean Vuong"))
{

<li><a href=@poem.URL target="_blank">@poem.Title</a></li>
}
</ul>
</section>

<!-- <section>
<img src="https://www.thenation.com/wp-content/uploads/2019/12/Ocean-Vuong-1-credit-Peter-Bienkowski.jpg" alt-text="Picure of the poet Ocean Vuong. He is sitting and smiling in a blue sweater. " width="300px" height="200px" />
</section>-->

<section class="authorPicture">
<img src="https://www.thenation.com/wp-content/uploads/2019/12/Ocean-Vuong-1-credit-Peter-Bienkowski.jpg" alt-text="Picure of the poet Ocean Vuong. He is sitting and smiling in a blue sweater. " />
</section>
<!-- Layli Long Soldier Poems-->
<section class="poets" id="Layli Long Soldier">

<h2>Layli Long Soldier</h2>
<br />
<ul>
<li><a href="https://onbeing.org/poetry/38/" target="_blank">"38"</a></li>
<li><a href="https://www.poetryfoundation.org/poems/149976/obligations-2" target="_blank">"Obligations 2"</a></li>
@foreach (var poem in Your_New_Favorite_Poem.Constants.PoetsConstants.PoemList.Where(x => x.Author is "Layli Long Soldier"))
{

<li><a href=@poem.URL target="_blank">@poem.Title</a></li>
}
</ul>
</section>

<section class="authorPicture">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Layli_Long_Soldier_172902.jpg/330px-Layli_Long_Soldier_172902.jpg" alt-text="Picure of the poet Layli Long Soldier. She is standing behind a podium in a black and white shawl giving a speech " />
</section>

<!-- Mary Oliver Poems-->
<section class="poets" id="Mary Oliver">
<h2>Mary Oliver</h2>
<br />
<ul>
<li><a href="https://wordsfortheyear.com/2015/06/21/the-summer-day-by-mary-oliver/" target="_blank">"The Summer Day"</a></li>
<li><a href="http://www.phys.unm.edu/~tw/fas/yits/archive/oliver_wildgeese.html" target="_blank">"Wild Geese"</a></li>
@foreach (var poem in Your_New_Favorite_Poem.Constants.PoetsConstants.PoemList.Where(x => x.Author is "Mary Oliver"))
{

<li><a href=@poem.URL target="_blank">@poem.Title</a></li>
}
</ul>
</section>

<section class="authorPicture">
<img src="https://media.newyorker.com/photos/5c4369fcaeb70d48728418ac/master/w_2560%2Cc_limit/Aizenman-MaryOliverTNY-1.jpg" alt-text=" A black and white photo of Mary Oliver. She is standing outside and looking to her left." />
</section>

<!--Terrance Hayes Poems-->
<section class="poets" id="Terrance Hayes">
<h2>Terrance Hayes</h2>
<br />
<ul>
<li>
<a href="https://www.poetryfoundation.org/poetrymagazine/poems/143917/american-sonnet-for-my-past-and-future-assassin-598dc83c976f1" target="_blank">
"American Sonnet for My Past and Future Assassin <br />
[“I lock you in an American sonnet that is part prison”]"
</a>
</li>
<li>
<a href="https://rhymings.com/terrance-hayes/probably-ghosts-are-allergic-to-us-our-uproarious/" target="_blank">
"American Sonnet for my Past and Future Assassin <br />
[“Probably, Ghosts Are Allergic To Us. Our Uproarious]”"
</a>
</li>
@foreach (var poem in Your_New_Favorite_Poem.Constants.PoetsConstants.PoemList.Where(x => x.Author is "Terrance Hayes"))
{

<li><a href=@poem.URL target="_blank">@poem.Title</a></li>
}
</ul>
</section>


<section class="authorPicture">
<img src="https://media.poetryfoundation.org/uploads/media/default/0001/19/198496b3f730c85668327e98d20f7bd9906064e2.jpeg?w=1274&h=&fit=max&1274" alt-text=" A black and white photo of Terrance Hayes' face. He is standing in the shadow of blinds, casting light across his face in stripes." />
</section>

<!--Shay Alexi Poems-->
<section class="poets" id="Shay Alexi">
<h2>Shay Alexi</h2>
<br />
<ul>
<li><a href="http://www.glass-poetry.com/journal/2018/may/alexi-john.html" target="_blank">"John Mayer's 'Your Body is a Wonderland'<br /> is Kinda Gross But"</a></li>
<li><a href="https://tinderboxpoetry.com/our-mother-is-a-nightwitch-or-an-ode-to-femme-friendship" target="_blank">"OUR MOTHER IS A NIGHTWITCH <br />OR AN ODE TO FEMME FRIENDSHIP"</a></li>
@foreach (var poem in Your_New_Favorite_Poem.Constants.PoetsConstants.PoemList.Where(x => x.Author is "Shay Alexi"))
{

<li><a href=@poem.URL target="_blank">@poem.Title</a></li>
}
</ul>
</section>

<section class="authorPicture">
<img src="https://img.evbuc.com/https%3A%2F%2Fcdn.evbuc.com%2Fimages%2F58740676%2F139090090596%2F1%2Foriginal.20190318-174408?auto=compress&s=3d4ce76e5ea4d37b47e63a4524f585f3" alt-text="Shay alexi is standing and looking at the camera with one arm crossed and the other posing up towards their face." />
</section>

<!-- Marci Calabretta Cancio-Bello-->
<section class="poets" id="Marci Calabretta Cancio-Bello">
<h2> Marci Calabretta Cancio-Bello </h2>
<br />
<ul>
<li><a href="https://poets.org/poem/animal-garden-my-body" target="_blank">"In the Animal Garden of My Body"</a></li>
<li><a href="https://www.tupeloquarterly.com/vase-of-ashes-by-marci-calabretta-cancio-bello/" target="_blank">"Vase of Ashes"</a></li>
@foreach (var poem in Your_New_Favorite_Poem.Constants.PoetsConstants.PoemList.Where(x => x.Author is "Marci Calabretta Cancio-Bello"))
{

<li><a href=@poem.URL target="_blank">@poem.Title</a></li>
}
</ul>
</section>


<section class="authorPicture">
<img src="https://149349728.v2.pressablecdn.com/wp-content/uploads/2019/03/Marci-Calabretta-Cancio-Bello-c-Margarita-Corporan-high-res-1-1024x998.jpg" alt-text="Headshot of Marci Calabretta Cancio-Bello. She is standing outside and the background is blurry. She is smiling at the camera." />
</section>

<!--Martín Espada-->
<section class="poets" id="Martín Espada">
<h2>Martín Espada</h2>
<br />
<ul>
<li><a href="https://poets.org/poem/flowers-and-bullets" target="_blank">:Flowers and Bullets"</a></li>
<li><a href="https://poets.org/poem/how-we-could-have-lived-or-died-way" target="_blank">"How We Could Have Lived or Died This Way"</a></li>
@foreach (var poem in Your_New_Favorite_Poem.Constants.PoetsConstants.PoemList.Where(x => x.Author is "Martín Espada"))
{

<li><a href=@poem.URL target="_blank">@poem.Title</a></li>
}
</ul>
</section>


<section class="authorPicture">
<img src="https://onwisconsin.uwalumni.com/content/uploads/2010/02/Espada_Martin_port09_4056.jpg" alt-text="Poet Martin Espada is lounging in a chair with one arm ofer the back. He is looking at the camera with a serious expression on his face." />
</section>


</body>
20 changes: 14 additions & 6 deletions Your New Favorite Poem/Pages/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,32 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using Your_New_Favorite_Poem.Constants;
using Your_New_Favorite_Poem.Models;

namespace Your_New_Favorite_Poem.Pages
{
public class IndexModel : PageModel
{

public IActionResult OnPostRandomPoem()
{
var rnd = new Random();
var index = rnd.Next(0, PoetsConstants.PoemList.Count);

var randomPoem = PoetsConstants.PoemList[index];

return Redirect(randomPoem.URL.ToString());
}
private readonly ILogger<IndexModel> _logger;

public IndexModel(ILogger<IndexModel> logger)
{
_logger = logger;
}

public void OnGet()
{

}
}
}
}
15 changes: 7 additions & 8 deletions Your New Favorite Poem/Pages/Poets.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
}

<h1>Poets</h1>
<p> This page is a work in progress! Come back later! </p>
<p> List of all currently featured poets on the page! </p>
<nav>
<!-- fullist of poets-->
<ul>
<li><a asp-area="" asp-page="/Index" asp-fragment="Ocean Vuong">Ocean Vuong</a></li>
<li><a asp-area="" asp-page="/Index" asp-fragment="Layli Long Soldier">Layli Long Soldier</a></li>
<li><a asp-area="" asp-page="/Index" asp-fragment="Mary Oliver">Mary Oliver</a></li>
<li><a asp-area="" asp-page="/Index" asp-fragment="Terrance Hayes">Terrance Hayes</a></li>
<li><a asp-area="" asp-page="/Index" asp-fragment="Shay Alexi">Shay Alexi</a></li>
<li><a asp-area="" asp-page="/Index" asp-fragment="Marci Calabretta Cancio-Bello">Marci Calabretta Cancio-Bello</a></li>
<li><a asp-area="" asp-page="/Index" asp-fragment="Martín Espada">Martín Espada</a></li>
@foreach (var author in Your_New_Favorite_Poem.Constants.PoetsConstants.PoemList.Select(x => x.Author).Distinct())
{

<li><a asp-area="" asp-page="/Index" asp-fragment=@author>@author</a></li>

}
</ul>
</nav>
3 changes: 0 additions & 3 deletions Your New Favorite Poem/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Privacy</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Poets">Poets</a> <!--made a button, but it goes to an error-->
</li>
Expand Down
12 changes: 8 additions & 4 deletions Your New Favorite Poem/Your New Favorite Poem.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
<ItemGroup>
<Compile Remove="NewFolder1\**" />
<Compile Remove="NewFolder2\**" />
<Compile Remove="NewFolder\**" />
<Content Remove="NewFolder1\**" />
<Content Remove="NewFolder2\**" />
<Content Remove="NewFolder\**" />
<EmbeddedResource Remove="NewFolder1\**" />
<EmbeddedResource Remove="NewFolder2\**" />
<EmbeddedResource Remove="NewFolder\**" />
<None Remove="NewFolder1\**" />
<None Remove="NewFolder2\**" />
<None Remove="NewFolder\**" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Pages\Privacy.cshtml.cs" />
</ItemGroup>

<ItemGroup>
<Content Remove="Pages\Privacy.cshtml" />
</ItemGroup>

<ItemGroup>
Expand Down
26 changes: 24 additions & 2 deletions Your New Favorite Poem/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ body {
width: 50%;
padding: 5%;
margin: 5%;
display: flex;
display: inline-flex;
flex-direction: row;
font-family: Helvetica;
//word-wrap: break-word;
float: left;
}

body {
Expand All @@ -110,4 +110,26 @@ body {
margin: 5%;
padding: 5%;
font-family: Helvetica;
}

.button {
color: black;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;

}

.buttonmove{
text-align: center;
//margin: 0 auto;
}

.authorPicture img {
width: 21EM;
height: 15REM;
float: right;
margin: 4rem 0rem 0rem 0rem;
}

0 comments on commit b404bdb

Please sign in to comment.