<commit_before><%= render :partial => "events/menu" -%>

<div id="kp-pri-content">
  <% if user_online? && current_user.can_administrate?(@event.culture_provider) -%>
    <div class="admin-tools">
      <h4>Administrera <%= h @event.name %></h4>
      <ul>
        <li><%= link_to 'Redigera', edit_event_path(@event) %></li>
        <li><%= link_to 'Hantera bilder', event_images_path(@event) %></li>
        <% if current_user.has_role?(:admin) && (@event.ticket_release_date.nil? || @event.ticket_release_date > Date.today) -%>
          <li><%= link_to 'Fördela inköpta biljetter', :controller => "allotment", :action => "init", :id => @event.id %></li>
        <% end -%>
        <% if current_user.has_role?(:admin) -%>
          <li><%= link_to "Statistik", stats_event_path(@event) %></li>
        <% end -%>
      </ul>
    </div>
  <% end -%>

  <div class="model-cnt">

    <% if !@event.images_excluding_main.empty? %>
      <div class="images-cnt">
        <div class="images">
          <% @event.images_excluding_main.each do |image| -%>
            <img src="<%= h image.image_url %>" alt="<%= h image.name %>" width="<%= h image.width %>" height="<%= h image.height %>"/>
          <% end -%>
        </div>
      </div>
    <% end -%>

    <h2><%= h @event.name %></h2>

    <%= paragraphize(@event.description, 'class="description"') %>

    <% if user_online? && current_user.can_administrate?(@event.culture_provider) -%>
      <%= render :partial => "occasions/form", :locals => { :event => @event } %>
    <% end -%>

    <div class="tabs">
      <ul>
        <li><a href="#kp-ev-meta-info">Information</a></li>
        <% unless @event.occasions.empty? -%>
          <li class="<%= "preselect" if @selected_occasion %>"><a href="#kp-ev-meta-occasions">Föreställningar</a></li>
        <% end -%>
      </ul>

      <div id="kp-ev-meta-info">
        <table class="meta">
          <% if user_online? && current_user.can_administrate?(@event.culture_provider) %>
            <tr class="show-date">
              <th>Visas mellan</th>
              <td><%= h @event.visible_from %> och <%= h @event.visible_to %></td>
            </tr>
            <% unless @event.ticket_release_date.blank? -%>
              <tr class="ticket-release-date">
                <th>Biljettsläpp</th>
                <td><%= h @event.ticket_release_date %></td>
              </tr>
            <% end -%>
          <% end -%>
          <% unless @event.booking_info.blank? -%>
            <tr class="booking-info">
              <th>Bokningsinformation</th>
              <td><%= auto_link h(@event.booking_info) %></td>
            </tr>
          <% end -%>
          <% unless @event.cost.blank? -%>
            <tr class="cost">
              <th>Kostnad</th>
              <td><%= linebreakize(@event.cost) %></td>
            </tr>
          <% end -%>
          <tr class="culture-provider">
            <th>Arrangör</th>
            <td><%= link_to h(@event.culture_provider.name), culture_provider_path(@event.culture_provider) %></td>
          </tr>
          <tr class="ages">
            <th>För åldrar</th>
            <td><%= @event.from_age %>-<%= @event.to_age %> år</td>
          </tr>
          <% if @event.further_education -%>
            <tr class="further-education">
              <th>Fortbildning pedagoger/vuxna</th>
              <td>Ja</td>
            </tr>
          <% end -%>

          <% @category_groups.each do |category_group| -%>
            <% category_names = @event.categories.select { |c| c.category_group_id == category_group.id }.map { |c| c.name } %>

            <% unless category_names.empty? -%>
              <tr class="categories">
                <th><%= h category_group.name %></th>
                <td>
                  <%= h(category_names.join(", ")) %>
                </td>
              </tr>
            <% end -%>
          <% end -%>

          <% unless @event.opening_hours.blank? -%>
            <tr class="opening-hours">
              <th>Öppettider</th>
              <td><%= linebreakize(@event.opening_hours) %></td>
            </tr>
          <% end -%>
          <% unless @event.url.blank? -%>
            <tr class="url">
              <th>Extern länk</th>
              <td><%= link_to h(@event.url), @event.url %></td>
            </tr>
          <% end -%>
          <% unless @event.movie_url.blank? -%>
            <tr class="movie-url">
              <th>Youtube-länk</th>
              <td><%= link_to h(@event.movie_url), @event.movie_url %></td>
            </tr>
          <% end -%>
        </table>
      </div>

      <% unless @event.occasions.empty? -%>
        <div id="kp-ev-meta-occasions">
          <table class="occasion-list">
            <thead>
              <tr>
                <th>Datum</th>
                <th>Tid</th>
                <th>Antal platser</th>
                <th>Adress</th>
                <th>Beskrivning</th>
                <th></th>
              </tr>
            </thead>

            <tbody>
              <% @event.occasions.each do |occasion|
                alt = cycle('', "even") %>
                <tr class="<%= alt %> <%= "selected" if @selected_occasion && @selected_occasion.id == occasion.id %>">
                  <td><%= h occasion.date %></td>
                  <td><%= l occasion.start_time, :format => :only_time %> - <%= l occasion.stop_time, :format => :only_time %></td>
                  <td>
                    <%= h occasion.seats %>
                    <% if occasion.wheelchair_seats.to_i > 0 -%>
                      + <%= h occasion.wheelchair_seats %>
                    <% end -%>
                  </td>
                  <td><%= linebreakize(occasion.address) %></td>
                  <td><%= paragraphize(occasion.description) %></td>
                  <td>
                    <% if user_online? -%>
                      <% if @event.bookable? && current_user.can_book? -%>
                        <%= link_to "Boka", :controller => "booking", :action => "book", :occasion_id => occasion.id %>
                      <% end -%>

                      <% if current_user.can_administrate?(@event.culture_provider) -%>
                        <%= link_to "Redigera", edit_occasion_path(occasion) %>
                        <%= link_to "Ta bort", occasion, :method => "destroy", :confirm => "Är du säker på att du vill radera föreställningen?" %>
                      <% end -%>
                      <% if occasion.date > Date.today %>
                        <%= link_to "Närvarolista", attendants_occasion_path(occasion) %>
                      <% else %>
                        <% if current_user.has_role?(:admin) or current_user.has_role?(:host) %>
                          <%= link_to "Rapportera närvaro" , :controller => "occasions" , :action => "report_show" , :id => occasion.id -%>
                        <% end %>
                      <% end -%>
                    <% end %>
                  </td>
                </tr>
              <% end -%>
            </tbody>

          </table>
        </div>
      <% end -%>
<commit_msg>Lade till rullstolsindikator på listningen av föreställningar i eventvyn.<commit_after><%= render :partial => "events/menu" -%>

<div id="kp-pri-content">
  <% if user_online? && current_user.can_administrate?(@event.culture_provider) -%>
    <div class="admin-tools">
      <h4>Administrera <%= h @event.name %></h4>
      <ul>
        <li><%= link_to 'Redigera', edit_event_path(@event) %></li>
        <li><%= link_to 'Hantera bilder', event_images_path(@event) %></li>
        <% if current_user.has_role?(:admin) && (@event.ticket_release_date.nil? || @event.ticket_release_date > Date.today) -%>
          <li><%= link_to 'Fördela inköpta biljetter', :controller => "allotment", :action => "init", :id => @event.id %></li>
        <% end -%>
        <% if current_user.has_role?(:admin) -%>
          <li><%= link_to "Statistik", stats_event_path(@event) %></li>
        <% end -%>
      </ul>
    </div>
  <% end -%>

  <div class="model-cnt">

    <% if !@event.images_excluding_main.empty? %>
      <div class="images-cnt">
        <div class="images">
          <% @event.images_excluding_main.each do |image| -%>
            <img src="<%= h image.image_url %>" alt="<%= h image.name %>" width="<%= h image.width %>" height="<%= h image.height %>"/>
          <% end -%>
        </div>
      </div>
    <% end -%>

    <h2><%= h @event.name %></h2>

    <%= paragraphize(@event.description, 'class="description"') %>

    <% if user_online? && current_user.can_administrate?(@event.culture_provider) -%>
      <%= render :partial => "occasions/form", :locals => { :event => @event } %>
    <% end -%>

    <div class="tabs">
      <ul>
        <li><a href="#kp-ev-meta-info">Information</a></li>
        <% unless @event.occasions.empty? -%>
          <li class="<%= "preselect" if @selected_occasion %>"><a href="#kp-ev-meta-occasions">Föreställningar</a></li>
        <% end -%>
      </ul>

      <div id="kp-ev-meta-info">
        <table class="meta">
          <% if user_online? && current_user.can_administrate?(@event.culture_provider) %>
            <tr class="show-date">
              <th>Visas mellan</th>
              <td><%= h @event.visible_from %> och <%= h @event.visible_to %></td>
            </tr>
            <% unless @event.ticket_release_date.blank? -%>
              <tr class="ticket-release-date">
                <th>Biljettsläpp</th>
                <td><%= h @event.ticket_release_date %></td>
              </tr>
            <% end -%>
          <% end -%>
          <% unless @event.booking_info.blank? -%>
            <tr class="booking-info">
              <th>Bokningsinformation</th>
              <td><%= auto_link h(@event.booking_info) %></td>
            </tr>
          <% end -%>
          <% unless @event.cost.blank? -%>
            <tr class="cost">
              <th>Kostnad</th>
              <td><%= linebreakize(@event.cost) %></td>
            </tr>
          <% end -%>
          <tr class="culture-provider">
            <th>Arrangör</th>
            <td><%= link_to h(@event.culture_provider.name), culture_provider_path(@event.culture_provider) %></td>
          </tr>
          <tr class="ages">
            <th>För åldrar</th>
            <td><%= @event.from_age %>-<%= @event.to_age %> år</td>
          </tr>
          <% if @event.further_education -%>
            <tr class="further-education">
              <th>Fortbildning pedagoger/vuxna</th>
              <td>Ja</td>
            </tr>
          <% end -%>

          <% @category_groups.each do |category_group| -%>
            <% category_names = @event.categories.select { |c| c.category_group_id == category_group.id }.map { |c| c.name } %>

            <% unless category_names.empty? -%>
              <tr class="categories">
                <th><%= h category_group.name %></th>
                <td>
                  <%= h(category_names.join(", ")) %>
                </td>
              </tr>
            <% end -%>
          <% end -%>

          <% unless @event.opening_hours.blank? -%>
            <tr class="opening-hours">
              <th>Öppettider</th>
              <td><%= linebreakize(@event.opening_hours) %></td>
            </tr>
          <% end -%>
          <% unless @event.url.blank? -%>
            <tr class="url">
              <th>Extern länk</th>
              <td><%= link_to h(@event.url), @event.url %></td>
            </tr>
          <% end -%>
          <% unless @event.movie_url.blank? -%>
            <tr class="movie-url">
              <th>Youtube-länk</th>
              <td><%= link_to h(@event.movie_url), @event.movie_url %></td>
            </tr>
          <% end -%>
        </table>
      </div>

      <% unless @event.occasions.empty? -%>
        <div id="kp-ev-meta-occasions">
          <table class="occasion-list">
            <thead>
              <tr>
                <th>Datum</th>
                <th>Tid</th>
                <th>Antal platser</th>
                <th>Adress</th>
                <th>Beskrivning</th>
                <th></th>
              </tr>
            </thead>

            <tbody>
              <% @event.occasions.each do |occasion|
                alt = cycle('', "even") %>
                <tr class="<%= alt %> <%= "selected" if @selected_occasion && @selected_occasion.id == occasion.id %>">
                  <td><%= h occasion.date %></td>
                  <td><%= l occasion.start_time, :format => :only_time %> - <%= l occasion.stop_time, :format => :only_time %></td>
                  <td>
                    <%= h(occasion.seats + occasion.wheelchair_seats) %>
                    <% if occasion.wheelchair_seats.to_i > 0 -%>
                      <%= image_tag "user_go.png", :alt => "Rullstolsplatser finns", :title => "Rullstolsplatser finns" if occasion.wheelchair_seats > 0 %>
                    <% end -%>
                  </td>
                  <td><%= linebreakize(occasion.address) %></td>
                  <td><%= paragraphize(occasion.description) %></td>
                  <td>
                    <% if user_online? -%>
                      <% if @event.bookable? && current_user.can_book? -%>
                        <%= link_to "Boka", :controller => "booking", :action => "book", :occasion_id => occasion.id %>
                      <% end -%>

                      <% if current_user.can_administrate?(@event.culture_provider) -%>
                        <%= link_to "Redigera", edit_occasion_path(occasion) %>
                        <%= link_to "Ta bort", occasion, :method => "destroy", :confirm => "Är du säker på att du vill radera föreställningen?" %>
                      <% end -%>
                      <% if occasion.date > Date.today %>
                        <%= link_to "Närvarolista", attendants_occasion_path(occasion) %>
                      <% else %>
                        <% if current_user.has_role?(:admin) or current_user.has_role?(:host) %>
                          <%= link_to "Rapportera närvaro" , :controller => "occasions" , :action => "report_show" , :id => occasion.id -%>
                        <% end %>
                      <% end -%>
                    <% end %>
                  </td>
                </tr>
              <% end -%>
            </tbody>

          </table>
        </div>
      <% end -%>

{'fraction_non_alphanumeric': 0.18490775419614372, 'fraction_numerical': 0.0007629352198640588, 'mean_word_length': 1.5665717337130651, 'pattern_counts': {'":': 0, '<': 469, '<?xml version=': 0, '>': 512, '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': '7461761', 'n_tokens_mistral': 4944, 'n_tokens_neox': 4497, 'n_words': 789}