<commit_before>- content_for(:page_title) do
  Hantera föreställningar för
  = link_to @event.name, @event

%main
  %nav.return
    = link_to "Återvänd till presentationen för #{@event.name}", @event

  %section.box.context-form{class: "#{"collapsed" if @occasion.new_record?}"}
    .map-container(style="display:none;")
    %h1.box-title
      - if @occasion.new_record?
        Lägg till
      - else
        Redigera
      föreställning

    .box-content
      = simple_form_for @occasion, html: { class: "basic" } do |f|
        = f.error_notification class: "warning"

        .form-group
          = f.label :date, class: "control-label"
          .controls.input-group
            = f.input_field :date,
              as: :string,
              class: "form-control datepicker",
              data: { "start-date" => Date.today }
            %span.input-group-addon
              %span.glyphicon.glyphicon-calendar

        = f.input :start_time, minute_step: 5
        = f.input :stop_time, minute_step: 5
        = f.input :seats
        = f.input :wheelchair_seats
        = f.input :single_group,
          as: :radio_buttons,
          wrapper: :radio,
          collection: [ [ "Ja", true ], [ "Nej", false ] ]
        = f.input :address, input_html: { rows: 5 }
        = f.input :description, input_html: { rows: 5 }
        = f.input :telecoil,
          as: :radio_buttons,
          wrapper: :radio,
          collection: [ [ "Ja", true ], [ "Nej", false ] ]

        = f.input :map_address, hint: "Skriv in en gatuadress", input_html: { class: "street-address" }

        = f.hidden_field :event_id

        .form-group
          %span.control-label
          .controls
            = f.submit "Spara", class: "btn btn-primary"
            - unless @occasion.new_record?
              = link_to "Avbryt", event_occasions_path(@event), class: "btn btn-default"

  = render partial: "events/administration_menu", locals: { event: @event }

  %table
    %thead
      %tr
        %th Datum/tid
        %th Antal platser
        %th Adress
        %th Beskrivning
        %th Kartadress
        %th

    %tbody
      - @event.occasions.each do |occasion|
        %tr{class: "#{"cancelled" if occasion.cancelled}"}
          %td
            = occasion.date
            %br
            = "#{l occasion.start_time, format: :only_time}-#{l occasion.stop_time, format: :only_time}"
          %td
            = occasion.seats + occasion.wheelchair_seats
            = image_tag "icon_rullstol.png", alt: "Rullstolsplatser finns", title: "Rullstolsplatser finns" if occasion.wheelchair_seats.to_i > 0
            = image_tag "icon_horslinga.png", alt: "Hörselslinga finns", title: "Hörselslinga finns" if occasion.telecoil
          %td= occasion.address
          %td= occasion.description
          %td
            = link_to "Visa på karta",
              "http://www.malmo.se/karta?poi=#{u(occasion.map_address)}&amp;zoomlevel=4&amp;maptype=karta",
              class: "show-on-map m-icon-location",
              title: occasion.map_address,
              "data-poi" => occasion.map_address,
              "data-map-selector" => ".map-container",
              "data-scroll-to" => ".map-container"
          %td
            - if !occasion.cancelled
              .btn-group
                = link_to "Redigera", edit_occasion_path(occasion), class: "btn btn-default btn-sm"

                - if @event.bookable?
                  - if occasion.date >= Date.today
                    = link_to "Ställ in",
                      cancel_occasion_path(occasion),
                      data: { confirm: "Är du säker på att du vill ställa in föreställningen?" },
                      class: "btn btn-danger btn-sm"
                - else
                  = link_to "Ta bort", occasion,
                    method: "delete",
                    data: { confirm: "Är du säker på att du vill radera föreställningen?"},
                    class: "btn btn-danger btn-sm"
<commit_msg>Möjliggör upplägg av föreställningar även om wheelchair_seats är null<commit_after>- content_for(:page_title) do
  Hantera föreställningar för
  = link_to @event.name, @event

%main
  %nav.return
    = link_to "Återvänd till presentationen för #{@event.name}", @event

  %section.box.context-form{class: "#{"collapsed" if @occasion.new_record?}"}
    .map-container(style="display:none;")
    %h1.box-title
      - if @occasion.new_record?
        Lägg till
      - else
        Redigera
      föreställning

    .box-content
      = simple_form_for @occasion, html: { class: "basic" } do |f|
        = f.error_notification class: "warning"

        .form-group
          = f.label :date, class: "control-label"
          .controls.input-group
            = f.input_field :date,
              as: :string,
              class: "form-control datepicker",
              data: { "start-date" => Date.today }
            %span.input-group-addon
              %span.glyphicon.glyphicon-calendar

        = f.input :start_time, minute_step: 5
        = f.input :stop_time, minute_step: 5
        = f.input :seats
        = f.input :wheelchair_seats
        = f.input :single_group,
          as: :radio_buttons,
          wrapper: :radio,
          collection: [ [ "Ja", true ], [ "Nej", false ] ]
        = f.input :address, input_html: { rows: 5 }
        = f.input :description, input_html: { rows: 5 }
        = f.input :telecoil,
          as: :radio_buttons,
          wrapper: :radio,
          collection: [ [ "Ja", true ], [ "Nej", false ] ]

        = f.input :map_address, hint: "Skriv in en gatuadress", input_html: { class: "street-address" }

        = f.hidden_field :event_id

        .form-group
          %span.control-label
          .controls
            = f.submit "Spara", class: "btn btn-primary"
            - unless @occasion.new_record?
              = link_to "Avbryt", event_occasions_path(@event), class: "btn btn-default"

  = render partial: "events/administration_menu", locals: { event: @event }

  %table
    %thead
      %tr
        %th Datum/tid
        %th Antal platser
        %th Adress
        %th Beskrivning
        %th Kartadress
        %th

    %tbody
      - @event.occasions.each do |occasion|
        %tr{class: "#{"cancelled" if occasion.cancelled}"}
          %td
            = occasion.date
            %br
            = "#{l occasion.start_time, format: :only_time}-#{l occasion.stop_time, format: :only_time}"
          %td
            = occasion.seats + (occasion.wheelchair_seats || 0)
            = image_tag "icon_rullstol.png", alt: "Rullstolsplatser finns", title: "Rullstolsplatser finns" if occasion.wheelchair_seats.to_i > 0
            = image_tag "icon_horslinga.png", alt: "Hörselslinga finns", title: "Hörselslinga finns" if occasion.telecoil
          %td= occasion.address
          %td= occasion.description
          %td
            = link_to "Visa på karta",
              "http://www.malmo.se/karta?poi=#{u(occasion.map_address)}&amp;zoomlevel=4&amp;maptype=karta",
              class: "show-on-map m-icon-location",
              title: occasion.map_address,
              "data-poi" => occasion.map_address,
              "data-map-selector" => ".map-container",
              "data-scroll-to" => ".map-container"
          %td
            - if !occasion.cancelled
              .btn-group
                = link_to "Redigera", edit_occasion_path(occasion), class: "btn btn-default btn-sm"

                - if @event.bookable?
                  - if occasion.date >= Date.today
                    = link_to "Ställ in",
                      cancel_occasion_path(occasion),
                      data: { confirm: "Är du säker på att du vill ställa in föreställningen?" },
                      class: "btn btn-danger btn-sm"
                - else
                  = link_to "Ta bort", occasion,
                    method: "delete",
                    data: { confirm: "Är du säker på att du vill radera föreställningen?"},
                    class: "btn btn-danger btn-sm"

{'fraction_non_alphanumeric': 0.12143834764215504, 'fraction_numerical': 0.001866368047779022, 'mean_word_length': 1.8233227959255356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4104974', 'n_tokens_mistral': 2587, 'n_tokens_neox': 2512, 'n_words': 557}