Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sat/master #44

Open
wants to merge 22 commits into
base: sat/master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Finalized self method for blog
trowbrsa committed Oct 30, 2015
commit 0af314112c08233514168c2913350732d6d4124f
6 changes: 5 additions & 1 deletion my-site.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "sinatra"
require "./seattle.rb"

class MySite < Sinatra::Base

@@ -10,7 +11,7 @@ class MySite < Sinatra::Base


get "/index" do
@title = 'My Homepage'
@title = 'Sarah Trowbridge'
@h1 = "Sarah Trowbridge"
erb :index
end
@@ -24,6 +25,9 @@ class MySite < Sinatra::Base
get "/blog" do
@title = "Blog"
@h1 = "Blog"
@activities1 = Activities::Seattle.all[rand(1..52)].options
@activities2 = Activities::Seattle.all[rand(1..52)].options
@activities3 = Activities::Seattle.all[rand(1..52)].options
erb :blog
end

14 changes: 13 additions & 1 deletion public/css/style.css
Original file line number Diff line number Diff line change
@@ -45,6 +45,17 @@ body {
max-width: 960px;
}

footer .links {
float: left;
padding-right: 5px;
}
footer .copyright {
float: right;
}
.clear {
clear: both;
}

footer {
padding: 5px 5px 5px 5px;
background-color: rgb(213, 213, 213);
@@ -53,8 +64,9 @@ footer {
border-radius: 5px;
}

footer p {
footer span a{
display: inline-block;
word-spacing: 5px;

}

22 changes: 22 additions & 0 deletions seattle.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'csv'

module Activities

class Seattle

attr_reader :options

def initialize(options)
@options = options
end

def self.all
activities = []
CSV.foreach('./support/seattle_activities.csv') do |row|
things = Seattle.new row[0].to_s
activities.push(things)
end
return activities
end
end
end
1 change: 1 addition & 0 deletions support/seattle_activities.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Tasting Room SeattleWest Seattle Wine CellarsEsquin Wine MerchantsDeLaurenti Specialty Food & WineChampion Wine CellarsMcCarthy & Schiering WineEuropean Vine SelectionsVino VeritePyramid BreweriesWilliams-SonomaBlu Water BistroCommunity YogaLululemon Run ClubThe Grinning YogiREI ClassesHothouse SpaCountry Dance LessonsTiger Lily YogaUrban Yoga SpaYoga to the PeopleRed Square YogaOlympic Sculpture ParkVolunteer Park ConservatoryWashington Park ArboretumBoat Rides at Center for Wooden BoatsMuseum PassesSeattle Free Art FridaysThe Paramount TheatreAvalon Glassworks"PCC Walk, Talk, and Taste Class"Frye Art MuseumKlondike Gold Rush National Historical ParkFree Museum DaysCentral CinemaSundance CinemasMovies at Seattle Public LibraryThe Royal RoomBellevue Demonstration GardenSeward Park AudobonBarolo RistortanteBlueacre SeafoodChan SeattleMistral KitchenListAlki Beach Fire PitsSeattle Chinese GardenMonthly Neighborhood Art WalksSancaWaterfall GardenTheo Chocolate TourFremont TrollUmi Sake HouseJaponessaMagnuson ParkMarymoor Park
23 changes: 22 additions & 1 deletion views/blog.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
<article>
<header>
<h2> Things to do in Seattle! </h2>
</header>

<p><time datetime="2015-10-29">Posted Thursday, October 29th</time>.</p>
<p>
My fellow Adie, Kelly, made a great spreadsheet of things to do in Seattle on the cheap.
This entry pulls a couple of things to do from the list of over 50 items she provided to our cohort.
Check out some of the items below, or refresh the page for some new ideas!
</p>
<h4>Activities for you:</h4>
<ul>
<li><%= @activities1 %></li>
<li><%= @activities2 %></li>
<li><%= @activities3 %></li>

<p>Refresh the page for more fun!</p>

</article>


<article>
<header>
<h2> On Fonts </h2>
@@ -20,7 +42,6 @@

</article>

<br>

<table border="1", style="font-family: helvetica; border-collapse: collapse; text-align: center">
<thead>
33 changes: 0 additions & 33 deletions views/index.erb
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
<!-- <!DOCTYPE html>
<html>
<head>

<link href="css/style.css" rel="stylesheet">

<title>Home Page</title>
<meta charset = "utf-8">
</head>

<body> -->

<!-- <h1> Sarah's first Sinatra site! </h1> -->

<!-- <nav>
<a href="/projects">Projects</a>
<a href="/blog">Blog</a>
</nav> -->


<img id="header-img" src ="seattle_pano.jpeg"></a>

@@ -39,17 +20,3 @@
<figcaption>This is how happy I am you visited my site!</figcaption>
</figure>
</article>

<!-- <h4><a href="file:///Users/Sarah/Ada/class-exs/HTML%20templates/blog.html/">Click here to check out my blog</a></h3> -->

<!-- <footer>
Follow me on:
<a href="http://twitter.com/SarahinSEA">Twitter</a>
<a href="www.linkedin.com/in/SarahATrowbridge">LinkedIn</a>
<% t=Time.new %>
<p class="copyright"> &copy; <%= t.year%> </p>
</footer>

</body>

</html> -->
13 changes: 7 additions & 6 deletions views/layout.erb
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
</head>

<body>
<h1><%= @title %></h1>
<h1><%= @h1 %></h1>
<nav>
<a href="/index">Homepage</a>
<a href="/projects">Projects</a>
@@ -18,11 +18,12 @@
<%= yield %>

<footer>
Follow me on:
<a href="http://twitter.com/SarahinSEA">Twitter</a>
<a href="www.linkedin.com/in/SarahATrowbridge">LinkedIn</a>
<% t=Time.new %>
<p class="copyright"> &copy; <%= t.year%> </p>
<span class "links"><a href="/index">Home</a><a href="/projects">Projects</a><a href="/blog">Blog</a>
<!-- <span class="links"><a href="http://twitter.com/SarahinSEA">Twitter</a><a href="www.linkedin.com/in/SarahATrowbridge">LinkedIn</a> -->
</span>
<% t=Time.new %>
<span class="copyright"> &copy;<%= t.year%> </span>
<div class="clear"></div>
</footer>

</body>