Skip to content
This repository has been archived by the owner on Nov 25, 2017. It is now read-only.

Menu #9

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
Empty file modified Gemfile
100644 → 100755
Empty file.
Empty file modified Gemfile.lock
100644 → 100755
Empty file.
Empty file modified Procfile
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified Rakefile
100644 → 100755
Empty file.
38 changes: 35 additions & 3 deletions app.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
class App < Sinatra::Base
get '/' do
@error = params['error']
@full_name = params['full_name']
@city = params['city']
erb :home
end

get '/home' do
redirect to('/')
end

post '/subscribe' do
@full_name = params[:full_name]
@email = params[:email]
@city = params[:city]

if [email protected](/.+@.+/)
redirect to('/?error=email')
redirect to('/?error=email&full_name='+@full_name+'&city='+@city)
end

erb :subscribe
Expand Down Expand Up @@ -49,8 +56,12 @@ class App < Sinatra::Base

erb :schedule
end
end

get '/rainbow' do
erb :rainbow
end

end
class App < Sinatra::Base
get '/fib/:n' do
# TODO: implement an algorithm to calculate the fibonacci sequence at
Expand All @@ -63,8 +74,29 @@ class App < Sinatra::Base
# separated names. Randomize this list of names and display it as an
# ordered list (<ol>). 5 points
end

def fib(n)
# TODO: calculate fib
end
end

# in app.rb
class App
get '/youtube' do
"Hello World"
erb :youtube
end
end

class App
get '/training' do
"Hello World"
erb :training
end
end

class App
get '/reddit' do
"hello world"
erb :reddit
end
end
Empty file modified config.ru
100644 → 100755
Empty file.
Empty file modified config/environment.rb
100644 → 100755
Empty file.
Empty file modified models/.keep
100644 → 100755
Empty file.
Empty file modified models/sample_model.rb
100644 → 100755
Empty file.
Empty file modified public/favicon.ico
100644 → 100755
Empty file.
Empty file modified public/images/.keep
100644 → 100755
Empty file.
Binary file added public/images/favicon.ico
Binary file not shown.
Empty file modified public/images/learnco.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified public/javascripts/.keep
100644 → 100755
Empty file.
Empty file modified public/stylesheets/.keep
100644 → 100755
Empty file.
17 changes: 17 additions & 0 deletions public/stylesheets/main.css
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* From csslayout
*/

#container1 {
float:left;
width:100%;
}
#col1 {
float:left;
width:50%;
}
#col2 {
float:left;
width:50%;
}

/*
* What follows is the result of much research on cross-browser styling.
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
Expand Down
Empty file modified spec/spec_helper.rb
100644 → 100755
Empty file.
Empty file modified views/.keep
100644 → 100755
Empty file.
39 changes: 29 additions & 10 deletions views/home.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
<h1>Startup Sprint!</h1>
<img src="images/learnco.jpg">
<img src="images/learnco.png">

<h3>Subscribe to the Stertup Sprint newsletter</h3>
<h3>Subscribe to the Startup Sprint newsletter</h3>
<% if @error == 'email' %>
<p style="color: red;">Please enter a valid email</p>
<p style="color: red;"><%= @full_name %>, please enter a valid email</p>
<form method=POST action="/subscribe">
<label for="full-name">Full Name</label>
<input type="text" id="full-name" name="full_name" value=<%= @full_name %> required>
<label for="email">Email</label>
<input type="text" id="email" name="email" required>
<label for="city">City</label>
<input type="text" id="city" name="city" value=<%= @city %> >
<input type="Submit">
</form>
<%else%>
<form method=POST action="/subscribe">
<label for="full-name">Full Name</label>
<input type="text" id="full-name" name="full_name" required>
<label for="email">Email</label>
<input type="text" id="email" name="email" required>
<label for="city">City</label>
<input type="text" id="city" name="city">
<input type="Submit">
</form>
<% end %>
<form method=POST action="/subscribe">
<label for="full-name">Full Name</label>
<input type="text" id="full-name" name="full_name" required>
<label for="email">Email</label>
<input type="text" id="email" name="email" required>
<input type="Submit">
</form>
<ul>
<li><a href="https://salty-chamber-67169.herokuapp.com/schedule">Schedule</a></li>
<li><a href="https://salty-chamber-67169.herokuapp.com/rainbow">Rainbow</a></li>
<li><a href="https://salty-chamber-67169.herokuapp.com/reddit">Reddit</a></li>
<li><a href="https://salty-chamber-67169.herokuapp.com/training">Training</a></li>
<li><a href="https://salty-chamber-67169.herokuapp.com/youtube">Youtube</a></li>
<ul>
Empty file modified views/layout.erb
100644 → 100755
Empty file.
7 changes: 7 additions & 0 deletions views/rainbow.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<hr style= "border: 50px solid #ff0000"/>​
<hr style= "border: 50px solid #FF5733"/>
<hr style= "border: 50px solid #FEEF38"/>
<hr style= "border: 50px solid #1ECD39"/>
<hr style= "border: 50px solid #1E88CD"/>
<hr style= "border: 50px solid #5224E3"/>
<hr style= "border: 50px solid #7658D5"/>
1 change: 1 addition & 0 deletions views/reddit.erb
100644 → 100755
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script src="https://www.reddit.com/hot/.embed?limit=20&t=all" type="text/javascript"></script>
1 change: 1 addition & 0 deletions views/redditfeed.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script src="https://www.reddit.com/hot/.embed?limit=20&t=all" type="text/javascript"></script>
27 changes: 15 additions & 12 deletions views/schedule.erb
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<div>
<div class="column">
<h3>Today</h3>
<ol>
<% @today.each do |item| %>
<li><%= item.first %>: <%= item.last %></li>
<% end %>
</ol>
</div>
<div class="column">
<div class="main">
<div id="container1">

<div id="col1">
<h3>Today</h3>
<% @today.each do |item| %>
<p><%= item.first %>: <%= item.last %></p>
<% end %>
</div>

<div id="col2">
<h3>Tomorrow</h3>
<ol>
<% @tomorrow.each do |item| %>
<li><%= item.first %>: <%= item.last %></li>
<p><%= item.first %>: <%= item.last %></p>
<% end %>
</ol>
</div>
</div>

</div>
</div>
2 changes: 1 addition & 1 deletion views/subscribe.erb
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<p>Thanks for subscribing <%= @full_name %></p>

<p>Your city is <%=@city%></p>
<a href="/">Home</a>
2 changes: 2 additions & 0 deletions views/training.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1> "Flatiron School + Venture for America" </h1>
<img src="https://i.ytimg.com/vi/Q6ctb-Pb3lc/hqdefault.jpg" alt="Spongebob" style="width:304px;height:228px;">
3 changes: 3 additions & 0 deletions views/youtube.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<object width="420" height="315"
data="http://www.youtube.com/embed/XGSy3_Czz8k">
</object>