forked from brgtrainings/voting-app-sinatra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ba85f3
commit 017d90c
Showing
7 changed files
with
82 additions
and
49 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,20 +1,28 @@ | ||
.container { | ||
margin: auto; | ||
max-width: 1100px; | ||
padding: 0 20px; | ||
align-items: center; | ||
} | ||
|
||
form { | ||
background: #eee; | ||
width: 450px; | ||
padding: 1rem; | ||
} | ||
ul { | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
button { | ||
margin-top: 10px; | ||
} | ||
#container { | ||
margin: auto; | ||
margin-top: 30px; | ||
padding: 30px 100px; | ||
align-items: center; | ||
width: 40%; | ||
border-radius: 20px; | ||
} | ||
|
||
#table { | ||
width: 40%; | ||
margin: auto; | ||
margin-top: 30px; | ||
} | ||
|
||
ul { | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
button { | ||
margin-top: 10px; | ||
} | ||
|
||
.btn { | ||
margin-top: 20px; | ||
} |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
<p>You cast: <%= CHOICES[@vote] %></p> | ||
<p><a href='/results'>See the results!</a></p> | ||
<div class="container"> | ||
<h4>You Cast: <%= CHOICES[@vote] %></h4> | ||
<button onclick="document.location='/results'" class="btn btn-success">See results</button> | ||
</div> |
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 |
---|---|---|
@@ -1,16 +1,20 @@ | ||
<p>What's for dinner?</p> | ||
|
||
<form action='cast' method='post'> | ||
<ul> | ||
<% CHOICES.each do |id, text| %> | ||
<div class="container bg-secondary" id="container"> | ||
<h4>What's for dinner?</h4> | ||
<form action='cast' method='post'> | ||
<ul> | ||
<% CHOICES.each do |id, text| %> | ||
<li> | ||
|
||
<label> | ||
<input type='radio' name='vote' value='<%= id %>' id='vote_<%= id %>' /> | ||
<%= text %> | ||
</label> | ||
</li> | ||
<% end %> | ||
</ul> | ||
|
||
<button type='submit' class="btn btn-primary">Cast this vote!</button> | ||
</form> | ||
</li> | ||
<% end %> | ||
</ul> | ||
<div class="col text-center"> | ||
<button type='submit' class="btn btn-primary left">Cast this vote!</button> | ||
</div> | ||
</form> | ||
</div> |
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 |
---|---|---|
@@ -1,14 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset='UTF-8' /> | ||
<title>Voting App</title> | ||
<link rel="stylesheet" href="css/style.css"> | ||
<link rel="stylesheet" href="css/bootstrap.min.css"> | ||
</head> | ||
<body> | ||
<h1><%= @title %></h1> | ||
<%= yield %> | ||
<script src="js/bootstrap.min.js"></script> | ||
</body> | ||
<head> | ||
<meta charset='UTF-8' /> | ||
<title>Voting App</title> | ||
<link rel="stylesheet" href="css/style.css"> | ||
<link rel="stylesheet" href="css/bootstrap.min.css"> | ||
</head> | ||
<body> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-secondary"> | ||
<a class="navbar-brand" href="/">Foo Resturant</a> | ||
<ul class="navbar-nav"> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="/results">Results</a> | ||
</li> | ||
|
||
</ul> | ||
</nav> | ||
<h2 class="text-center p-2"> <%= @title%> </h2> | ||
<%= yield %> | ||
<script src="js/bootstrap.min.js"></script> | ||
</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 |
---|---|---|
@@ -1,11 +1,21 @@ | ||
<table class='table table-hover table-striped'> | ||
<% CHOICES.each do |id, text| %> | ||
<table class="table table-striped table-light" id ="table"> | ||
<thead class="thead-light"> | ||
<tr> | ||
<th scope="col">Items</th> | ||
<th scope="col">Votes</th> | ||
<th scope="col">Hashtags</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% CHOICES.each do |id, text| %> | ||
<tr> | ||
<th><%= text %></th> | ||
<td><%= @votes[id] || 0 %> | ||
<td><%= '#' * (@votes[id] || 0) %></td> | ||
</tr> | ||
<% end %> | ||
<tbody> | ||
</table> | ||
|
||
<p><a href='/'>Cast more votes!</a></p> | ||
<div class="col text-center"> | ||
<button onclick="document.location='/'" class="btn btn-success">Cast more votes</button> | ||
</div> |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
votes: | ||
HAM: 1 | ||
NOO: 2 | ||
CUR: 1 |
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