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
11 changes: 10 additions & 1 deletion app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,16 @@
@rejection_count = 0

# TODO categorise rsvps into acceptances/rejections and count them
@rsvps.each do |row|
if row.last == "yes"
@acceptances << row.first
@acceptance_count += 1
else
@rejections << row.first
@rejection_count += 1
end
end


erb :rsvps
end
end
21 changes: 6 additions & 15 deletions views/index.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Event Manager 2.0</title>
</head>
<body>
<h1>Picture Unveiling Evening - Event Managment</h1>
<h1>Picture Unveiling Evening - Event Managment</h1>

<ul>
<li><a href='/todo'>Todo list</a></li>
<li><a href='/schedule'>Event schedule</a></li>
<li><a href='/rsvps'>RSVPs</a></li>
</ul>

</body>
</html>
<ul>
<li><a href='/todo'>Todo list</a></li>
<li><a href='/schedule'>Event schedule</a></li>
<li><a href='/rsvps'>RSVPs</a></li>
</ul>
12 changes: 12 additions & 0 deletions views/layout.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Event Manager 2.0</title>
<link rel="stylesheet" href="/dist/css/bootstrap.css">
</head>
<body>

<%= yield %>

</body>
</html>
40 changes: 15 additions & 25 deletions views/rsvps.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>Event Manager 2.0</title>
</head>
<body>
<h1>Invites</h1>

<h2>Attendees (25)</h2>
<ul>
<li></li>
<li></li>
<li></li>
</ul>

<h2>Apologies (22)</h2>
<ul>
<li></li>
<li></li>
<li></li>
</ul>


</body>
</html>
<h1>Invites</h1>

<h2>Attendees (<%= @acceptance_count %>)</h2>
<ul>
<% @acceptances.each do |person| %>
<li><%= person %></li>
<% end %>
</ul>

<h2>Apologies (<%= @rejection_count %>)</h2>
<ul>
<% @rejections.each do |person| %>
<li><%= person %></li>
<% end %>
</ul>
27 changes: 10 additions & 17 deletions views/schedule.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Event Manager 2.0</title>
</head>
<body>
<h1>Event schedule</h1>
<h1>Event schedule</h1>

<table>
<tr>
<td>8pm</td>
<td>Doors open</td>
</tr>
<!-- etc. etc. -->
</table>

</body>
</html>
<table>
<% @schedule.each do |row| %>
<tr>
<% row.each do |cell| %>
<td><%= cell %></td>
<% end %>
</tr>
<% end %>
</table>
21 changes: 6 additions & 15 deletions views/todo.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Event Manager 2.0</title>
</head>
<body>
<h1>Todo list</h1>
<h1>Todo list</h1>

<ul>
<li></li>
<li></li>
<li></li>
</ul>

</body>
</html>
<ol>
<% @todos.each do |todo| %>
<li><%= todo %></li>
<% end %>
</ol>