aboutsummaryrefslogblamecommitdiffstats
path: root/app/views/events/index.html.erb
blob: 5c9402f9c155e2f0e5797e65abe6ab78bcb33dc9 (plain) (tree)
1
2
3
4
5
6
7
8



                                         

                                                                   
                                                  
 


















                                      

         

                     






                                    


                                                                                     


                           


                                                                                     


                

                               







                                                                     





                            
                                                    
                            


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

<style type="text/css" media="screen">
  table {
    width: 100%;
    border-collapse: collapse;
    background: lightgreen;
    margin-top: 30px;
    table-layout: fixed;
    border: 2px solid;
  }
  th, td {
    border: 1px solid;
    padding: 3px;
  }
</style>

<table>
  <col style="width: 5%">
  <col style="width: 10%">
  <col style="width: 85%">
  <thead>
    <tr>
      <th>Date</th>
      <th>Bunter</th>
      <th>Day</th>
    </tr>
  </thead>
  <tbody>
    <% @january_dates.each do |e| %>
      <% if e.saturday? %>
        <tr>
          <td style="background: lightgray; color: gray"><%= e.day %></td>
          <td style="background: lightgray; color: gray">Toss</td>
          <td style="background: lightgray; color: gray"><%= e.strftime("%A") %></td>
        </tr>
      <% elsif e.sunday? %>
        <tr>
          <td style="background: lightgray; color: gray"><%= e.day %></td>
          <td style="background: lightgray; color: gray">Toss</td>
          <td style="background: lightgray; color: gray"><%= e.strftime("%A") %></td>
        </tr>
      <% else %>
        <tr>
          <td><%= e.day %></td>
          <td>Toss</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>