<commit_before><% content_for :breadcrumb do %>
  <ol class="breadcrumb">
    <li><%= link_to "Home", root_path %></li>
    <li><%= link_to "Buses", api_v1_buses_path %></li>
    <li><%= link_to @timetable.name + ' Timetable', api_v1_buses_timetable_path(:start_date => @timetable.start) %></li>
    <li class="active">Route <%= @route.name%></li>
  </ol>
<% end %>

<% content_for :scripts do %>
  <script type="text/javascript">
    $(function() {
      var url = document.location.toString();
      if (url.match('#')) {
          $('.nav-tabs a[href=#'+url.split('#')[1]+']').tab('show') ;
      } 

      // Change hash for page-reload
      $('.nav-tabs a').on('shown', function (e) {
          window.location.hash = e.target.hash;
      })
    });
  </script>
<% end %>

<h1 class="page-header">Route <%= @route.name %> Details</h1>

<%= button_to 'Delete', api_v1_buses_timetable_route_path(:timetable_start_date => @timetable.start, :id => @route.id), method: :delete, data: { confirm: 'Are you sure you wish to delete this route?' }, :class => "btn btn-danger btn-sm pull-right", :style => "margin-left:10px" %>
<p class="pull-right"  style="margin:7px;"><%= link_to 'Edit', edit_api_v1_buses_timetable_route_path(:timetable_start_daye => @timetable.start, :id => @route.id)%></p>

<!-- Nav tabs -->
<ul class="nav nav-tabs">
  <li class="active"><a href="#times" data-toggle="tab">Times</a></li>
  <li><a href="#stops" data-toggle="tab">Stops</a></li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
  <div class="tab-pane active" id="times">
    
    <% if @route.route_stops.count == 0 %>
      <h3 class="text-center">No stops available! To get started, hit the 'Stops' tab above.</h3>
    <% else %>
      <h3>Route Times</h3>
      <%= form_tag(@route.id.to_s + '/route_stops/create_stop_links') do -%>
      <table class="table table-striped">
        <thead>
          <tr>
            <th>Stops</th>
            <th colspan="<%= @ordered_route_stops.count %>">Times</th>
          </tr>
        </thead>
        <tbody>
          <% for i in 0...@ordered_route_stops.length %>
          <tr>
            <td><strong><%= @ordered_route_stops[i].stop.name %></strong></td>
            <% @stop_links.each do |sl| %>
              <td><%= sl[i].time_string %><%= sl[i].skip ? "»" : "" %><%= sl[i].night ? "☽" : "" %></td>
            <% end %>
            <td style="padding:5px">
              <%= fields_for "stop_links[#{i}]", @new_stop_link_set[i], :child_index => i do |sl| %>
              
                <div class="form-inline">
                  <%= sl.text_field :time, { :class => "form-control input-sm", :maxlength => "6", :placeholder => "HH:mm" } %>
                  
                  <div class="checkbox">
                    <label class="checkbox-inline">
                      <%= sl.check_box :skip %> Skip
                    </label>
                  </div>
                  <div class="checkbox">
                    <label class="checkbox-inline">
                       <%= sl.check_box :night %> Night
                    </label>
                  </div>
                 
                  
                </div>
                <%= sl.hidden_field :route_stop_id, :value => @new_stop_link_set[i].route_stop.id %>
                <%= sl.hidden_field :route_id, :value => @route.id %>
                <% end %>
        
                <%= hidden_field :timetable_start_date, :value => @timetable.start %>
                <%= hidden_field :route_id, :value => @route.id %>
            </td>
          </tr>
          <% end %>
        </tbody>
    
        <tfoot>
          <tr>
            <td></td>
            <% @stop_links.each do |sl| %>
              <td>
                <%= link_to 'Edit', api_v1_buses_timetable_route_stop_link_path(:route_id => @route.id, :id => sl[0].origin_stop_link_id) %>
              </td>
            <% end %>
            <td><%= submit_tag "Add Link", class: "btn btn-primary btn-sm" %></td>
          </tr>
        </tfoot>
      </table>
      <% end %>
    <% end %>
    
  </div>
  <div class="tab-pane" id="stops"><commit_msg>Have edit and delete glyphs so it visually makes sense.<commit_after><% content_for :breadcrumb do %>
  <ol class="breadcrumb">
    <li><%= link_to "Home", root_path %></li>
    <li><%= link_to "Buses", api_v1_buses_path %></li>
    <li><%= link_to @timetable.name + ' Timetable', api_v1_buses_timetable_path(:start_date => @timetable.start) %></li>
    <li class="active">Route <%= @route.name%></li>
  </ol>
<% end %>

<% content_for :scripts do %>
  <script type="text/javascript">
    $(function() {
      var url = document.location.toString();
      if (url.match('#')) {
          $('.nav-tabs a[href=#'+url.split('#')[1]+']').tab('show') ;
      } 

      // Change hash for page-reload
      $('.nav-tabs a').on('shown', function (e) {
          window.location.hash = e.target.hash;
      })
    });
  </script>
<% end %>

<h1 class="page-header">Route <%= @route.name %> Details</h1>

<%= button_to 'Delete', api_v1_buses_timetable_route_path(:timetable_start_date => @timetable.start, :id => @route.id), method: :delete, data: { confirm: 'Are you sure you wish to delete this route?' }, :class => "btn btn-danger btn-sm pull-right", :style => "margin-left:10px" %>
<p class="pull-right"  style="margin:7px;"><%= link_to 'Edit', edit_api_v1_buses_timetable_route_path(:timetable_start_daye => @timetable.start, :id => @route.id)%></p>

<!-- Nav tabs -->
<ul class="nav nav-tabs">
  <li class="active"><a href="#times" data-toggle="tab">Times</a></li>
  <li><a href="#stops" data-toggle="tab">Stops</a></li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
  <div class="tab-pane active" id="times">
    
    <% if @route.route_stops.count == 0 %>
      <h3 class="text-center">No stops available! To get started, hit the 'Stops' tab above.</h3>
    <% else %>
      <h3>Route Times</h3>
      <%= form_tag(@route.id.to_s + '/route_stops/create_stop_links') do -%>
      <table class="table table-striped">
        <thead>
          <tr>
            <th>Stops</th>
            <th colspan="<%= @ordered_route_stops.count %>">Times</th>
          </tr>
        </thead>
        <tbody>
          <% for i in 0...@ordered_route_stops.length %>
          <tr>
            <td><strong><%= @ordered_route_stops[i].stop.name %></strong></td>
            <% @stop_links.each do |sl| %>
              <td><%= sl[i].time_string %><%= sl[i].skip ? "»" : "" %><%= sl[i].night ? "☽" : "" %></td>
            <% end %>
            <td style="padding:5px">
              <%= fields_for "stop_links[#{i}]", @new_stop_link_set[i], :child_index => i do |sl| %>
              
                <div class="form-inline">
                  <%= sl.text_field :time, { :class => "form-control input-sm", :maxlength => "6", :placeholder => "HH:mm" } %>
                  
                  <div class="checkbox">
                    <label class="checkbox-inline">
                      <%= sl.check_box :skip %> Skip
                    </label>
                  </div>
                  <div class="checkbox">
                    <label class="checkbox-inline">
                       <%= sl.check_box :night %> Night
                    </label>
                  </div>
                 
                  
                </div>
                <%= sl.hidden_field :route_stop_id, :value => @new_stop_link_set[i].route_stop.id %>
                <%= sl.hidden_field :route_id, :value => @route.id %>
                <% end %>
        
                <%= hidden_field :timetable_start_date, :value => @timetable.start %>
                <%= hidden_field :route_id, :value => @route.id %>
            </td>
          </tr>
          <% end %>
        </tbody>
    
        <tfoot>
          <tr>
            <td></td>
            <% @stop_links.each do |sl| %>
              <td>
                <%= link_to api_v1_buses_timetable_route_stop_link_path(:route_id => @route.id, :id => sl[0].origin_stop_link_id), :title => "Edit" do %>
                  <span class="glyphicon glyphicon-edit"></span>
                <% end %>
                <%= link_to api_v1_buses_timetable_route_stop_link_path(:route_id => @route.id, :id => sl[0].origin_stop_link_id), :title => "Delete",:class => "text-danger", :method => :delete, :confirm => "Are you sure you wish to delete this chain of stop times?" do %>
                  <span class="glyphicon glyphicon-trash"></span>
                <% end %>
              </td>
            <% end %>
            <td><%= submit_tag "Add Link", class: "btn btn-primary btn-sm" %></td>
          </tr>
        </tfoot>
      </table>
      <% end %>
    <% end %>
    
  </div>
  <div class="tab-pane" id="stops">
{'fraction_non_alphanumeric': 0.19335692272571625, 'fraction_numerical': 0.004793973290720238, 'mean_word_length': 1.9894234049812352, 'pattern_counts': {'":': 0, '<': 242, '<?xml version=': 0, '>': 283, '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': '7551390', 'n_tokens_mistral': 3093, 'n_tokens_neox': 2849, 'n_words': 560}