-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html.erb
executable file
·127 lines (117 loc) · 3.73 KB
/
index.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<%
# this is the template file that generates index.html
# to generate the index.html file, run in the console:
# ruby main.rb
require './mes.rb'
require './diaSemana.rb'
@dias_semana = Array.new
@dia = DiaSemana.new("domingo", false)
@dias_semana.push(@dia)
@dia = DiaSemana.new("segunda", true)
@dias_semana.push(@dia)
@dia = DiaSemana.new("terça", true)
@dias_semana.push(@dia)
@dia = DiaSemana.new("quarta", true)
@dias_semana.push(@dia)
@dia = DiaSemana.new("quinta", true)
@dias_semana.push(@dia)
@dia = DiaSemana.new("sexta", true)
@dias_semana.push(@dia)
@dia = DiaSemana.new("sábado", false)
@dias_semana.push(@dia)
@meses = Array.new
@mes = Mes.new("janeiro", 31)
@meses.push(@mes)
@mes = Mes.new("fevereiro", 28)
@meses.push(@mes)
@mes = Mes.new("março", 31)
@meses.push(@mes)
@mes = Mes.new("abril", 30)
@meses.push(@mes)
@mes = Mes.new("maio", 31)
@meses.push(@mes)
@mes = Mes.new("junho", 30)
@meses.push(@mes)
@mes = Mes.new("julho", 31)
@meses.push(@mes)
@mes = Mes.new("agosto", 31)
@meses.push(@mes)
@mes = Mes.new("setembro", 30)
@meses.push(@mes)
@mes = Mes.new("outubro", 31)
@meses.push(@mes)
@mes = Mes.new("novembro", 30)
@meses.push(@mes)
@mes = Mes.new("dezembro", 31)
@meses.push(@mes)
@bg_color_gray = 'style="background-color: #f3f3f3;"'
@salas = ["Anfiteatro", "Sala de Reuniões", "Sala 204", "Sala 206", "Sala 225", "Sala de Informática"]
@dias_ano = 365
@dia = 0 # use this variable to count from day 1 to 365
%>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8"/>
<title>Agenda</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<script src="js/bootstrap.min.js"></script>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div id="content" class="container">
<% @salas.each do |sala| %>
<% @dia = 0 %>
<% @meses.each do |mes| %>
<div class="mes">
<h2><%= sala %> - <%= mes.name %>/2017</h2>
<table class="table table-bordered table-condensed" style="margin-top: 30px">
<thead>
<tr>
<th>DIA</th>
<th>08 - 09h</th>
<th>09 - 10h</th>
<th>10 - 11h</th>
<th>11 - 12h</th>
<th>12 - 13h</th>
<th>13 - 14h</th>
<th>14 - 15h</th>
<th>15 - 16h</th>
<th>16 - 17h</th>
<th>17 - 18h</th>
<th>18 - 19h</th>
</tr>
</thead>
<tbody>
<% for day in 1..mes.length %>
<tr>
<%
@dia = @dia + 1
@ds = @dias_semana[(@dia-1)%7]
@style = @ds.diaUtil ? "" : @bg_color_gray
%>
<th <%= @style %> > <%= day %> - <%= @ds.name[0..2] %></th>
<td <%= @style %> ></td>
<td <%= @style %> ></td>
<td <%= @style %> ></td>
<td <%= @style %> ></td>
<td <%= @style %> ></td>
<td <%= @style %> ></td>
<td <%= @style %> ></td>
<td <%= @style %> ></td>
<td <%= @style %> ></td>
<td <%= @style %> ></td>
<td <%= @style %> ></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %>
<% end %>
</div>
</body>
</html>