<commit_before>%span
  - unless reservation.past?
    = link_to reservation_path(reservation),              :class => 'btn btn-xs btn-success' do
      Details
      %i.fa.fa-list
    = link_to edit_reservation_path(reservation),         :class => 'btn btn-xs btn-info',    :title => 'Edit reservation' do
      Edit
      %i.fa.fa-edit

  - if reservation.active? || (reservation.now? && reservation.start_instantly?)
    - if reservation.less_than_1_hour_left?
      = link_to extend_reservation_path(reservation),     :class => 'btn btn-xs btn-primary', :title => 'Extend reservation',  :method => :post,   :data => { :confirm => "This will extend your reservation if possible" } do
        Extend
        %i.fa.fa-clock-o

    - unless reservation.end_instantly?

      - if reservation.inactive_minute_counter > 0
        = link_to idle_reset_reservation_path(reservation),  :class => 'btn btn-xs btn-primary', :title => "Idle reset",           :method => :post do
          - afk_text = "#{reservation.inactive_minute_counter}/#{reservation.inactive_minute_limit}m"
          Idle reset (#{afk_text})
          %i.fa.fa-undo

      - if reservation.has_players?
        - end_message = "Are you sure you want to end your reservation? There #{I18n.t(:were_x_players_left, :count => reservation.last_number_of_players, :scope => :server)} left on the server at #{I18n.l(Time.zone.now, :format => :time_without_seconds)}"
      - else
        - end_message = "Are you sure you want to end your reservation?"
      = link_to reservation_path(reservation),              :class => 'btn btn-xs btn-danger',  :title => 'End reservation',     :method => :delete, :data => { :confirm => end_message } do
        End
        %i.fa.fa-stop

      = link_to  reservation.server_connect_url,            :class => 'btn btn-xs btn-warning' do
        Join game
        %i.fa.fa-play

      = link_to reservation.stv_connect_url,              :class => 'btn btn-xs btn-primary' do
        Join STV
        %i.fa.fa-film

  - if reservation.cancellable?
    = link_to reservation_path(reservation),              :class => 'btn btn-xs btn-warning', :title => 'Cancel reservation',  :method => :delete do
      Cancel
      %i.fa.fa-trash-o

  - if reservation.past?
    = render 'reservations/zip_file_link', :reservation => reservation
    = link_to reservation_log_uploads_path(reservation),  :class => 'btn btn-xs btn-success', :title => 'Upload the match logs to logs.tf' do
      logs.tf
      %i.fa.fa-upload<commit_msg>always show idle reset button for active reservations<commit_after>%span
  - unless reservation.past?
    = link_to reservation_path(reservation),              :class => 'btn btn-xs btn-success' do
      Details
      %i.fa.fa-list
    = link_to edit_reservation_path(reservation),         :class => 'btn btn-xs btn-info',    :title => 'Edit reservation' do
      Edit
      %i.fa.fa-edit

  - if reservation.active? || (reservation.now? && reservation.start_instantly?)
    - if reservation.less_than_1_hour_left?
      = link_to extend_reservation_path(reservation),     :class => 'btn btn-xs btn-primary', :title => 'Extend reservation',  :method => :post,   :data => { :confirm => "This will extend your reservation if possible" } do
        Extend
        %i.fa.fa-clock-o

    - unless reservation.end_instantly?

      = link_to idle_reset_reservation_path(reservation),  :class => 'btn btn-xs btn-primary', :title => "Idle reset",           :method => :post do
        - afk_text = "#{reservation.inactive_minute_counter}/#{reservation.inactive_minute_limit}m"
        Idle reset (#{afk_text})
        %i.fa.fa-undo

      - if reservation.has_players?
        - end_message = "Are you sure you want to end your reservation? There #{I18n.t(:were_x_players_left, :count => reservation.last_number_of_players, :scope => :server)} left on the server at #{I18n.l(Time.zone.now, :format => :time_without_seconds)}"
      - else
        - end_message = "Are you sure you want to end your reservation?"
      = link_to reservation_path(reservation),              :class => 'btn btn-xs btn-danger',  :title => 'End reservation',     :method => :delete, :data => { :confirm => end_message } do
        End
        %i.fa.fa-stop

      = link_to  reservation.server_connect_url,            :class => 'btn btn-xs btn-warning' do
        Join game
        %i.fa.fa-play

      = link_to reservation.stv_connect_url,              :class => 'btn btn-xs btn-primary' do
        Join STV
        %i.fa.fa-film

  - if reservation.cancellable?
    = link_to reservation_path(reservation),              :class => 'btn btn-xs btn-warning', :title => 'Cancel reservation',  :method => :delete do
      Cancel
      %i.fa.fa-trash-o

  - if reservation.past?
    = render 'reservations/zip_file_link', :reservation => reservation
    = link_to reservation_log_uploads_path(reservation),  :class => 'btn btn-xs btn-success', :title => 'Upload the match logs to logs.tf' do
      logs.tf
      %i.fa.fa-upload
{'fraction_non_alphanumeric': 0.12642300778909527, 'fraction_numerical': 0.00219692430597164, 'mean_word_length': 2.717891610987379, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 58, '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': '2480950', 'n_tokens_mistral': 1623, 'n_tokens_neox': 1549, 'n_words': 379}