<commit_before>﻿<div id="play_right-page">
  
  <!-- PLAYRIGHT -->
  
  <div class="content_panel">
    <h1>Mina kommande spelrätt bokning</h1>
    <% if current_user.play_right_bookings.size == 0 %>
        <p class="info">Du har ingen bokning</p>
    <% else %>    
      <p class="info">Du har följande bokning.</p>
      <table>
        <tr>
          <th class="first" width="30%">Golf banan</th>
	        <th width="30%">Datum</th>
          <th>&nbsp;</th>
        </tr>
        <%current_user.play_right_bookings.forthcoming.each do | booking | %>
        <tr> 
	        <td class="first"><%= h(booking.play_right.name) %></td>
          <td><%= booking.booked_on %></td>
          <td>
            <%= link_to "Ta bort", {:action => "remove", :id => booking.id}, 
              :confirm => "Är du säker du vill ta bort bokningen den #{booking.booked_on} på #{booking.play_right.name}?",
              :method => :post %>    
          </td>
        </tr>
        <% end %>
      </table>
    <% end %>
    <p/>
  </div>    
  
  <div class="content_panel">
    <h1>Boka nytt spelrätt</h1>
    
    <p>Här kan du boka golf banan. Du får bara har ett utstående bokning per gång. </p>
    <p/>
    <% semantic_form_for [:member, PlayRightBooking.new] do |form| %>
      <% form.inputs do %>
        <%= form.input :play_right, :label => 'Golfsbanan', :include_blank => false %>
        <%= form.input :booked_on, :label => 'Datum', :start_year => Time.now.year, :end_year => Time.now.year %>
        <%= form.input :num_of_resource, :as => :hidden, :value => "1" %>
      <% end %>
      <% form.buttons do %>
        <%= form.commit_button :label => "Boka" %>
      <% end %>
    <% end %>
  </p>
  </div>
 
  <div class="content_panel">
    <h1>Dagens boking av spelrätter</h1>
      <% @play_rights.each do |pr| %>  
      <%  booking_count = pr.play_right_bookings.today.count %>
      <%   if booking_count == 0 %>
             <p><%= "Idag har <strong> #{pr.name}</strong> ingen bokning" %></p>
      <%   else %>
             <p>
             <%   booking_msg = (booking_count == 1) ? "bokning" : "bokningar" %>
             <%= "Idag har <strong> #{pr.name}</strong> #{booking_count} #{booking_msg}" %>
             <ol>
                <% pr.play_right_bookings.today.each do |booking| %>
                    <li><%= "#{booking.user.name} - #{booking.user.email} - #{booking.user.mobile_phone}" %></li>
               <% end %>
             </ol>
            </p>
        <% end %>
     <% end %>
    </div>
</div> <commit_msg>add email link in booking page<commit_after>﻿<div id="play_right-page">
  
  <!-- PLAYRIGHT -->
  
  <div class="content_panel">
    <h1>Mina kommande spelrätt bokning</h1>
    <% if current_user.play_right_bookings.size == 0 %>
        <p class="info">Du har ingen bokning</p>
    <% else %>    
      <p class="info">Du har följande bokning.</p>
      <table>
        <tr>
          <th class="first" width="30%">Golf banan</th>
	        <th width="30%">Datum</th>
          <th>&nbsp;</th>
        </tr>
        <%current_user.play_right_bookings.forthcoming.each do | booking | %>
        <tr> 
	        <td class="first"><%= h(booking.play_right.name) %></td>
          <td><%= booking.booked_on %></td>
          <td>
            <%= link_to "Ta bort", {:action => "remove", :id => booking.id}, 
              :confirm => "Är du säker du vill ta bort bokningen den #{booking.booked_on} på #{booking.play_right.name}?",
              :method => :post %>    
          </td>
        </tr>
        <% end %>
      </table>
    <% end %>
    <p/>
  </div>    
  
  <div class="content_panel">
    <h1>Boka nytt spelrätt</h1>
    
    <p>Här kan du boka golf banan. Du får bara har ett utstående bokning per gång. </p>
    <p/>
    <% semantic_form_for [:member, PlayRightBooking.new] do |form| %>
      <% form.inputs do %>
        <%= form.input :play_right, :label => 'Golfsbanan', :include_blank => false %>
        <%= form.input :booked_on, :label => 'Datum', :start_year => Time.now.year, :end_year => Time.now.year %>
        <%= form.input :num_of_resource, :as => :hidden, :value => "1" %>
      <% end %>
      <% form.buttons do %>
        <%= form.commit_button :label => "Boka" %>
      <% end %>
    <% end %>
  </p>
  </div>
 
  <div class="content_panel">
    <h1>Dagens boking av spelrätter</h1>
      <% @play_rights.each do |pr| %>  
      <%  booking_count = pr.play_right_bookings.today.count %>
      <%   if booking_count == 0 %>
             <p><%= "Idag har <strong> #{pr.name}</strong> ingen bokning" %></p>
      <%   else %>
             <p>
             <%   booking_msg = (booking_count == 1) ? "bokning" : "bokningar" %>
             <%= "Idag har <strong> #{pr.name}</strong> #{booking_count} #{booking_msg}" %>
             <ol>
                <% pr.play_right_bookings.today.each do |booking| %>
                    <li>
                      <%= "#{booking.user.name} - mobil = #{booking.user.mobile_phone} - " %>
                      <%= "<a href=\"mailto:#{booking.user.email}\"> maila till spelare</a>" %>
                    </li>
               <% end %>
             </ol>
            </p>
        <% end %>
     <% end %>
    </div>
</div> 
{'fraction_non_alphanumeric': 0.18955623565416985, 'fraction_numerical': 0.005355776587605203, 'mean_word_length': 1.9212290502793297, 'pattern_counts': {'":': 0, '<': 174, '<?xml version=': 0, '>': 198, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1453346', 'n_tokens_mistral': 1986, 'n_tokens_neox': 1828, 'n_words': 378}