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

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

      <% unless @event.bookable? %>
        <li>
          <%= link_to 'Radera', event_path(@event), :method => :delete, :confirm => "Är du säker på att du vill radera evenemanget?" %>
        </li>
      <% end %>

      <li><%= link_to 'Hantera bilder', event_images_path(@event) %></li>
      <li><%= link_to 'Hantera filer', event_attachments_path(@event) %></li>
      <li>
        <%= link_to 'Hantera länkade arrangörer',
          event_culture_provider_links_path(:event_id => @event.id)
        %>
      </li>
      <li>
        <%= link_to 'Hantera länkade evenemang',
          event_event_links_path(:event_id => @event.id)
        %>
      </li>

      <% if current_user.has_role?(:admin) && !@event.further_education && (@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) && !@event.tickets.empty? %>
        <li><%= link_to 'Visa biljettfördelning', ticket_allotment_event_path(@event) %></li>
      <% end %>

      <% if current_user.can_view_bookings? %>
        <li>
          <%= link_to "Bokningar", event_bookings_path(@event) %>
        </li>
      <% end %>

      <% if @event.bookable? %>
        <li><%= link_to 'Hantera närvaro', event_attendance_index_path(@event) %></li>
      <% end %>
    </ul>
  </div>
<% elsif user_online? && current_user.has_role?(:host, :coordinator) && @event.bookable? %>
  <div class="admin-tools">
    <h4>Administrera <%= h @event.name %></h4>
    <ul>
      <li><%= link_to 'Hantera närvaro', event_attendance_index_path(@event) %></li>
    </ul>
  </div>
<% end -%>

<div id="kp-pri-content" class="event-pri-content">

  <div class="model-cnt">

    <% if !@event.images_excluding_main.empty? %>
      <div class="images-cnt">
        <div class="images-inner-cnt">
          <div class="images">
            <% @event.images_excluding_main.each do |image| -%>
              <div class="image">
                <%= uploaded_image_tag image %>

                <% unless image.description.blank? %>
                  <span class="image-description"><%= h image.description %></span>
                <% end %>
              </div>
            <% end -%>
          </div>
        </div>
      </div>
    <% end -%>

    <h2><%= h @event.name %></h2>
    <%= paragraphize(@event.description, 'class="description"') %>

    <% unless @event.linked_culture_providers.empty? && @event.linked_events.empty? %>
      <div class="linked-entities clearfix"><commit_msg>Fix för samordnare.<commit_after><%= render :partial => "events/menu" -%>

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

      <% unless @event.bookable? %>
        <li>
          <%= link_to 'Radera', event_path(@event), :method => :delete, :confirm => "Är du säker på att du vill radera evenemanget?" %>
        </li>
      <% end %>

      <li><%= link_to 'Hantera bilder', event_images_path(@event) %></li>
      <li><%= link_to 'Hantera filer', event_attachments_path(@event) %></li>
      <li>
        <%= link_to 'Hantera länkade arrangörer',
          event_culture_provider_links_path(:event_id => @event.id)
        %>
      </li>
      <li>
        <%= link_to 'Hantera länkade evenemang',
          event_event_links_path(:event_id => @event.id)
        %>
      </li>

      <% if current_user.has_role?(:admin) && !@event.further_education && (@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) && !@event.tickets.empty? %>
        <li><%= link_to 'Visa biljettfördelning', ticket_allotment_event_path(@event) %></li>
      <% end %>

      <% if current_user.can_view_bookings? %>
        <li>
          <%= link_to "Bokningar", event_bookings_path(@event) %>
        </li>
      <% end %>

      <% if @event.bookable? %>
        <li><%= link_to 'Hantera närvaro', event_attendance_index_path(@event) %></li>
      <% end %>
    </ul>
  </div>
<% elsif user_online? && current_user.has_role?(:host) && @event.bookable? %>
  <div class="admin-tools">
    <h4>Administrera <%= h @event.name %></h4>
    <ul>
      <li><%= link_to 'Hantera närvaro', event_attendance_index_path(@event) %></li>
    </ul>
  </div>
<% elsif user_online? && current_user.has_role?(:coordinator) %>
  <div class="admin-tools">
    <h4>Administrera <%= h @event.name %></h4>
    <ul>
      <li>
        <%= link_to "Bokningar", event_bookings_path(@event) %>
      </li>
    </ul>
  </div>
<% end -%>

<div id="kp-pri-content" class="event-pri-content">

  <div class="model-cnt">

    <% if !@event.images_excluding_main.empty? %>
      <div class="images-cnt">
        <div class="images-inner-cnt">
          <div class="images">
            <% @event.images_excluding_main.each do |image| -%>
              <div class="image">
                <%= uploaded_image_tag image %>

                <% unless image.description.blank? %>
                  <span class="image-description"><%= h image.description %></span>
                <% end %>
              </div>
            <% end -%>
          </div>
        </div>
      </div>
    <% end -%>

    <h2><%= h @event.name %></h2>
    <%= paragraphize(@event.description, 'class="description"') %>

    <% unless @event.linked_culture_providers.empty? && @event.linked_events.empty? %>
      <div class="linked-entities clearfix">
{'fraction_non_alphanumeric': 0.19252826478780927, 'fraction_numerical': 0.002293953793216451, 'mean_word_length': 2.631171921475312, 'pattern_counts': {'":': 0, '<': 188, '<?xml version=': 0, '>': 206, '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': '5912580', 'n_tokens_mistral': 2283, 'n_tokens_neox': 2100, 'n_words': 381}