<commit_before><% content_for :title, @course.title %>

<div class="row course-main">
  <div class="col-md-12">
    <h2><%= @course.title %></h2>
  </div>
  <div class="col-md-12">
    <p><%= @course.description %></p>
  </div>
</div>
  
<div class="row course-main">
  <div class="col-md-12">
  <p>
    This course starts on <strong><%= @course.start_date.strftime("%a, %b %d, %Y") %></strong>
    <% if @course.start_date != @course.end_date %>
      and ends on <strong><%= @course.end_date.strftime("%a, %b %d %Y") %> </strong>
    <% end %>
    <br />
    The start time is <strong><%= @course.start_time.strftime("%I:%M %p") %></strong> and the finish time is <strong><%= @course.end_time.strftime("%I:%M %p") %></strong>
    (<%= distance_of_time_in_words(@course.start_time, @course.end_time,  scope: 'datetime.distance_in_words.short') %>)
  </p>
  <p>
    At: <strong> <%= @course.venue.name.titlecase  %> </strong> <br />
    <%= @course.venue.address_1.titlecase %><br />
    <%= "#{@course.venue.address_2.titlecase} <br />".html_safe unless @course.venue.address_2.blank? %>
    <%= @course.venue.address_3.titlecase %><br />
    <%= @course.venue.postcode %>
  </p>
  </div>
</div>
<div class="row course-main course-map">
  <div class="col-sm-6">

      <div class="venue-map">
          <% if @course.venue.latitude && @course.venue.longitude %>
            <%= map(center:  {
              latlng: [@course.venue.latitude, @course.venue.longitude],
              zoom: 18 
              },
              markers: [{ latlng: [@course.venue.latitude, @course.venue.longitude] }]
             ) %>
 
           <% if browser.device.mobile? %>
             <%= link_to("Open this area on your Mobile Maps", "geo:#{@course.venue.latitude},#{@course.venue.longitude};u=10")  %>
           <% else %>
             <%= link_to("Open this area on Google Maps", "https://maps.google.com/?q=#{@course.venue.latitude},#{@course.venue.longitude}") %>
           <% end %>

           <% end %>
      </div>
    </div>
    <div class="col-sm-6">
      <p>
      <% unless @course.provider.url.blank? 
           url = @course.provider.url
             unless url.split(':')[0] == 'http' || url.split(':')[0] == 'https'
               url = "http://" + url
             end
        else
          url = nil
        end
           %>
          This course is provided by <strong><%= link_to_unless(url.nil?, @course.provider.name, url) %> </strong><br />
          <% if url %> Website: <%= link_to url, url %> <% end %>
          <% unless @course.provider.telephone.blank? %> 
            <br />
            Telephone: <%= link_to phone_format(@course.provider.telephone), "tel:#{@course.provider.telephone}" %>
          <% end %>
          <% unless @course.provider.email.blank? %> 
            <br />
            Email: <%= mail_to @course.provider.email, nil, subject: "Enquiry about #{@course.title} starting on #{@course.start_date.strftime("%a, %b %d, %Y")} from Leeds Adult Learning" %> 
          <% end %>
        </p>
        <p>
        View a list of <%= link_to "all courses provided by #{@course.provider.name}", @course.provider %> offered here. <br />
        View a list of <%= link_to "all courses held at #{@course.venue.name.titlecase}", @course.venue %> offered here.
        </p>
        
        <% unless @course.provider.telephone.blank? && @course.provider.url.blank? && @course.provider.email.blank? %>
        <%  interested_links = []
            interested_links << "visit their website #{link_to(url, url)}" unless @course.provider.url.blank?
            interested_links << "telephone them on #{link_to(phone_format(@course.provider.telephone), "tel:#{@course.provider.telephone}")}" unless @course.provider.telephone.blank?
            interested_links << "email them at #{mail_to(@course.provider.email, nil, subject: "Enquiry about Course: #{@course.title} starting on #{@course.start_date.strftime("%a, %b %d, %Y")} from Leeds Adult Learning ") }"  unless @course.provider.email.blank?
        %>
          <div class="interested">
          <h4>Interested?</h4>
          <p>
          To contact <strong><%= link_to_unless(url.nil?, @course.provider.name, url) %> </strong> for further information or to book a place, please
            <%= interested_links.to_sentence(:last_word_connector => " or ", :two_words_connector => " or ").html_safe %>       
          </p>
          </div>        
        <% end %>

          <p>
          Add the first course (at <%= @course.start_date.strftime("%a, %b %d, %Y") %>) to your calendar:
          <%= render :partial => "calendar"%>
          </p>
    </div>

</div>


<div class="row course-directions">
  <div class="col-md-12">
    <% if !params[:near].blank? && !@directions.nil? %>
      <%= render :partial => 'directions', object: @directions %>
    <% elsif !params[:near].blank? && @directions.nil? %><commit_msg>add who is it for target group on course show<commit_after><% content_for :title, @course.title %>

<div class="row course-main">
  <div class="col-md-12">
    <h2><%= @course.title %></h2>
  </div>
  <div class="col-md-12">
    <p><%= @course.description %></p>
  </div>
</div>
  
<div class="row course-main">
  <div class="col-md-12">
  <p>
    This course starts on <strong><%= @course.start_date.strftime("%a, %b %d, %Y") %></strong>
    <% if @course.start_date != @course.end_date %>
      and ends on <strong><%= @course.end_date.strftime("%a, %b %d %Y") %> </strong>
    <% end %>
    <br />
    The start time is <strong><%= @course.start_time.strftime("%I:%M %p") %></strong> and the finish time is <strong><%= @course.end_time.strftime("%I:%M %p") %></strong>
    (<%= distance_of_time_in_words(@course.start_time, @course.end_time,  scope: 'datetime.distance_in_words.short') %>)
  </p>
  <p>
    At: <strong> <%= @course.venue.name.titlecase  %> </strong> <br />
    <%= @course.venue.address_1.titlecase %><br />
    <%= "#{@course.venue.address_2.titlecase} <br />".html_safe unless @course.venue.address_2.blank? %>
    <%= @course.venue.address_3.titlecase %><br />
    <%= @course.venue.postcode %>
  </p>
  </div>
</div>
<div class="row course-main course-map">
  <div class="col-sm-6">

      <div class="venue-map">
          <% if @course.venue.latitude && @course.venue.longitude %>
            <%= map(center:  {
              latlng: [@course.venue.latitude, @course.venue.longitude],
              zoom: 18 
              },
              markers: [{ latlng: [@course.venue.latitude, @course.venue.longitude] }]
             ) %>
 
           <% if browser.device.mobile? %>
             <%= link_to("Open this area on your Mobile Maps", "geo:#{@course.venue.latitude},#{@course.venue.longitude};u=10")  %>
           <% else %>
             <%= link_to("Open this area on Google Maps", "https://maps.google.com/?q=#{@course.venue.latitude},#{@course.venue.longitude}") %>
           <% end %>

           <% end %>
      </div>
    </div>
    <div class="col-sm-6">
      <p>
      <% unless @course.provider.url.blank? 
           url = @course.provider.url
             unless url.split(':')[0] == 'http' || url.split(':')[0] == 'https'
               url = "http://" + url
             end
        else
          url = nil
        end
           %>
          This course is provided by <strong><%= link_to_unless(url.nil?, @course.provider.name, url) %> </strong><br />
          <% if url %> Website: <%= link_to url, url %> <% end %>
          <% unless @course.provider.telephone.blank? %> 
            <br />
            Telephone: <%= link_to phone_format(@course.provider.telephone), "tel:#{@course.provider.telephone}" %>
          <% end %>
          <% unless @course.provider.email.blank? %> 
            <br />
            Email: <%= mail_to @course.provider.email, nil, subject: "Enquiry about #{@course.title} starting on #{@course.start_date.strftime("%a, %b %d, %Y")} from Leeds Adult Learning" %> 
          <% end %>
        </p>
        <p>
        View a list of <%= link_to "all courses provided by #{@course.provider.name}", @course.provider %> offered here. <br />
        View a list of <%= link_to "all courses held at #{@course.venue.name.titlecase}", @course.venue %> offered here.
        </p>

        <% unless @course.target_group.blank? %>
        <h4 class="interested">Who is it for?</h4>
        <p>
          The course is aimed towards: <%= @course.target_group %>. <br />
          Often courses are open to everyone, so please contact the course provider to ask. 
        </p>
        <% end %>


        
        <% unless @course.provider.telephone.blank? && @course.provider.url.blank? && @course.provider.email.blank? %>
        <%  interested_links = []
            interested_links << "visit their website #{link_to(url, url)}" unless @course.provider.url.blank?
            interested_links << "telephone them on #{link_to(phone_format(@course.provider.telephone), "tel:#{@course.provider.telephone}")}" unless @course.provider.telephone.blank?
            interested_links << "email them at #{mail_to(@course.provider.email, nil, subject: "Enquiry about Course: #{@course.title} starting on #{@course.start_date.strftime("%a, %b %d, %Y")} from Leeds Adult Learning ") }"  unless @course.provider.email.blank?
        %>
          <div class="interested">
          <h4>Interested?</h4>
          <p>
          To contact <strong><%= link_to_unless(url.nil?, @course.provider.name, url) %> </strong> for further information or to book a place, please
            <%= interested_links.to_sentence(:last_word_connector => " or ", :two_words_connector => " or ").html_safe %>       
          </p>
          </div>        
        <% end %>

          <p>
          Add the first course (at <%= @course.start_date.strftime("%a, %b %d, %Y") %>) to your calendar:
          <%= render :partial => "calendar"%>
          </p>
    </div>

</div>


<div class="row course-directions">
  <div class="col-md-12">
    <% if !params[:near].blank? && !@directions.nil? %>
      <%= render :partial => 'directions', object: @directions %>
    <% elsif !params[:near].blank? && @directions.nil? %>
{'fraction_non_alphanumeric': 0.19134709931170107, 'fraction_numerical': 0.004916420845624385, 'mean_word_length': 2.487997256515775, 'pattern_counts': {'":': 0, '<': 241, '<?xml version=': 0, '>': 237, 'https://': 2, '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': '947652', 'n_tokens_mistral': 3495, 'n_tokens_neox': 3249, 'n_words': 716}