Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 1 addition & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,5 @@ DEPENDENCIES
sinatra
thin

RUBY VERSION
ruby 2.2.0p0

BUNDLED WITH
1.12.5
1.14.6
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ You'll want to create a new git branch for each ticket, and do your work on that

Submit a separate pull request for each ticket, and be sure to link your pull request to the ticket for easy reference.

Review each other's work before merging :shipit:
Review each other's work before merging testing :shipit:
1 change: 1 addition & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class App < Sinatra::Base

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

if !@email.match(/.+@.+/)
Expand Down
29 changes: 26 additions & 3 deletions public/stylesheets/main.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
/*
* TODO: add custom styling
*/
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}

li {
float: left;
}

li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}

/* Change the link color to #111 (black) on hover */
li a:hover {
background-color: #111;
}
h3 {
color: red;
}
.column {

}
3 changes: 3 additions & 0 deletions public/stylesheets/normalize.css
Original file line number Diff line number Diff line change
Expand Up @@ -445,3 +445,6 @@ template {
[hidden] {
display: none;
}
h3 {
color: red;
}
24 changes: 21 additions & 3 deletions views/home.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
<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>
<% end %>
<form method=POST action="/subscribe">
<form method=POST action="/subscribe" onsubmit="return ValidateForm()">
<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>


<script>
function ValidateForm() {
var emailText = document.getElementById("email").value;
var re = /(.+)@(.+){2,}\.(.+){2,}/;
var pass = re.test(emailText);
if (!pass) {
alert("Put in a different email");
}
return pass;
}


</script>
10 changes: 8 additions & 2 deletions views/layout.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" href="images/learnco.png" type="image/png" sizes="16x16"/>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Startup Sprint</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href="stylesheets/normalize.css">
<link rel="stylesheet" href="stylesheets/main.css">
</head>
</head>
<body>
<ul>
<li><a href="/home">Home</a><li>
<li><a href="/schedule">Schedule</a><li>
<li><a href="/reddit">Reddit</a><li>
<li><a href="/subscribe">Subscribe</a><li>
</ul>
<!--[if lt IE 8]>
<p>You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
Expand Down
3 changes: 3 additions & 0 deletions views/schedule.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<div>
<table>

<div class="column">
<h3>Today</h3>
<ol>
Expand All @@ -15,4 +17,5 @@
<% end %>
</ol>
</div>
</table>
</div>
2 changes: 1 addition & 1 deletion views/subscribe.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<p>Thanks for subscribing <%= @full_name %></p>

<p>City: <%= @city %> </p>
<a href="/">Home</a>