aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/events/index.html.erb
blob: f07b5dfa8c5f3a86db2586c4f8eacf6c82035778 (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
<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> %>

<table class="table table-success table-striped table-bordered mt-5">
  <thead>
    <tr>
      <th>January Date</th>
      <th>Day</th>
    </tr>
  </thead>
  <tbody>
    <% @january_dates.each do |e| %>
      <% if e.saturday? %>
        <tr>
          <td style="color: gray"><%= e %></td>
          <td style="color: gray"><%= e.strftime("%A") %></td>
        </tr>
      <% elsif e.sunday? %>
        <tr>
          <td style="color: gray"><%= e %></td>
          <td style="color: gray"><%= e.strftime("%A") %></td>
        </tr>
      <% else %>
        <tr>
          <td><%= e %></td>
          <td><%= e.strftime("%A") %></td>
        </tr>
      <% end %>
    <% end %>
  </tbody>
</table>

<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>