aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/events/index.html.erb
blob: 573a67ba45483ade14175fc7cdbdf31446826c2f (plain) (blame)
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<p style="color: green"><%= notice %></p>

<h1>Events</h1>

<%= render partial:  "events/form", locals: { event: Event.new } %>

<%# <%= link_to "New event", new_event_path %1> %>

<h4>Help on this table</h4>

<p>This is an example of some kind of table. There are lots of things wrong with it but who cares. It is a nice 
table, isn't it? I'm hoping this text spans all the way across so I can see what it looks like when it renders.</p>

<ul class="nav nav-tabs" id="myTab" role="tablist">
  <li class="nav-item" role="presentation">
    <button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">January</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab" aria-controls="profile" aria-selected="false">February</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">March</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">April</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">May</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">June</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">July</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">August</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">September</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">October</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">November</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">December</button>
  </li>
</ul>
<div class="tab-content" id="myTabContent">
  <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
    <table id="month-table">
      <col style="width: 7%">
      <col style="width: 15%">
      <col style="width: 15%">
      <col style="width: 15%">
      <col style="width: 15%">
      <col style="width: 48%">
      <thead>
        <tr>
          <th>Date</th>
          <th>Day</th>
          <th>BAES Barrow</th>
          <th>RRDL</th>
          <th>Op. Berths</th>
          <th>Comments</th>
        </tr>
      </thead>
      <tbody>
        <% @january_dates.each do |e| %>
          <% if e.saturday? %>
            <tr>
              <td style="background: darkgreen; color: lightgray"><%= e.strftime("%d/%m") %></td>
              <td style="background: darkgreen; color: lightgray"><%= e.strftime("%A") %></td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
            </tr>
          <% elsif e.sunday? %>
            <tr>
              <td style="background: darkgreen; color: lightgray"><%= e.strftime("%d/%m") %></td>
              <td style="background: darkgreen; color: lightgray"><%= e.strftime("%A") %></td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
            </tr>
          <% else %>
            <tr>
              <td><%= e.strftime("%d/%m") %></td>
              <td><%= e.strftime("%A") %></td>
              <td>DSC 2/A</td>
              <td>-</td>
              <td>-</td>
              <td>-</td>
            </tr>
          <% end %>
        <% end %>
      </tbody>
    </table>

  </div>
  <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
    <table>
      <col style="width: 7%">
      <col style="width: 15%">
      <col style="width: 15%">
      <col style="width: 15%">
      <col style="width: 15%">
      <col style="width: 48%">
      <thead>
        <tr>
          <th>Date</th>
          <th>Day</th>
          <th>BAES Barrow</th>
          <th>RRDL</th>
          <th>Op. Berths</th>
          <th>Comments</th>
        </tr>
      </thead>
      <tbody>
        <% @january_dates.each do |e| %>
          <% if e.saturday? %>
            <tr>
              <td style="background: darkgreen; color: lightgray"><%= e.strftime("%d/%m") %></td>
              <td style="background: darkgreen; color: lightgray"><%= e.strftime("%A") %></td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
            </tr>
          <% elsif e.sunday? %>
            <tr>
              <td style="background: darkgreen; color: lightgray"><%= e.strftime("%d/%m") %></td>
              <td style="background: darkgreen; color: lightgray"><%= e.strftime("%A") %></td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
              <td style="background: darkgreen; color: lightgray">-</td>
            </tr>
          <% else %>
            <tr>
              <td><%= e.strftime("%d/%m") %></td>
              <td><%= e.strftime("%A") %></td>
              <td>DSC 2/A</td>
              <td>-</td>
              <td>-</td>
              <td>-</td>
            </tr>
          <% end %>
        <% end %>
      </tbody>
    </table>
  </div>
  <div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">...</div>
</div>

<table class="table table-success table-striped table-bordered mt-5">
  <tr>
    <th>Date</th>
    <th>Name</th>
  </tr> 
  <% @events.each do |e|  %>
    <tr>
      <td><%= e.date.to_formatted_s(:rfc822) %></td>
      <td><%= e.name %></td>
    </tr>
  <% end %>
</table>