<commit_before><?python
from datetime import timedelta
from babel.dates import format_date

page = 'flights'
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">

  <xi:include href="master/page.html" />

  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" py:if="False"/>
    <script src="/static/jquery/jquery.js" type="text/javascript" language="javascript" />
    <script src="/static/jquery/jquery.dataTables.js" type="text/javascript" language="javascript" />
    <script src="/static/jquery/jquery.dataTables.ext.js" type="text/javascript" language="javascript" />

    <script src="/static/jquery/bootstrap-datepicker.js" type="text/javascript" language="javascript" />
    <script src="/static/bootstrap/js/bootstrap-tooltip.js" type="text/javascript" language="javascript" />

    <script src="/static/jquery/jquery.cookie.js" type="text/javascript" language="javascript" />
    <script src="/js/general.js" type="text/javascript" language="javascript" />

    <link href="/css/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="/css/datepicker.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" charset="utf-8">
    /* <![CDATA[ */
      $(document).ready(function() {
        var pinnedFlights = getPinnedFlights();

        $('#flight-table').dataTable({
          "bProcessing": true,
          "sPaginationType": "bootstrap",
          "iDisplayLength": ${repr(int(config.get('skylines.lists.display_length', 50)))},
          "iDeferLoading": ${flights_count},
          "bServerSide": (${flights_count} > ${repr(int(config.get('skylines.lists.server_side', 250)))})?true:false,
          "sAjaxSource": (${flights_count} > ${repr(int(config.get('skylines.lists.server_side', 250)))})?"${request.url}?json=true":null,
          "sDom": "<'row'<'span6'i><'span6'p>>rt<'row'<'span6'i><'span6'p>>",
          "aaSorting": [[ 0, "desc" ]],
          "aoColumnDefs": [
            { "bSortable": false, "aTargets": [-1] },
            { "sType": "date-eu", "aTargets": ["date"] },
            { "sType": "numeric-comma-formatted", "aTargets": ["numeric"] }
          ],
          "fnCreatedRow": function(nRow, aData, iDataIndex) {
            $(nRow).find(".pin").each(function() {
              var sfid = parseInt($(this).text());
              $(this).tooltip();
              if ($.inArray(sfid, pinnedFlights) >= 0) {
                $(this).html("<i class='icon-star'></i>");
                $(this).show();
                $(this).addClass("pinned");
              } else {
                $(this).html("<i class='icon-star-empty'></i>");
              }

              $(this).find("i").click(function() {
                if ($(this).parent(".pin").hasClass("pinned")) {
                  unpinFlight(sfid);
                  $(this).addClass("icon-star-empty");
                  $(this).removeClass("icon-star");
                  $(this).parent(".pin").removeClass("pinned");
                } else {
                  pinFlight(sfid);
                  $(this).addClass("icon-star");
                  $(this).removeClass("icon-star-empty");
                  $(this).parent(".pin").addClass("pinned");
                }
              });
            });

            jQuery(nRow).hover(function(e) {
              if (e.type == "mouseenter") {
                $(this).find(".pin").each(function() {
                  $(this).show();
                });
              } else if (e.type == "mouseleave") {
                $(this).find(".pin").each(function() {
                  if (!$(this).hasClass("pinned"))
                    $(this).hide();
                });
              }
            });
          }
        });

        var datepicker = $('#datepicker').datepicker({
          format: 'dd.mm.yyyy',
          autoclose: true
        });
        datepicker.on('changeDate', function(e) {
          var url = "/flights/date/" + e.date.getFullYear() + "-" +
            pad(e.date.getMonth()+1, 2) + "-" + pad(e.date.getDate(), 2);
          window.location.href = url;
        });

        $("[rel=tooltip]").tooltip();
      });
    /* ]]> */
    </script>

    <title py:if="date">Flights on ${format_date(date)}</title>
    <title py:if="pilot">Flights of pilot "${pilot}"</title>
    <title py:if="club">Flights of club "${club}"</title>"
    <title py:if="not date and not pilot and not club">Flight list</title>
  </head>

  <body>
    <xi:include href="nav.html" />

    <h3 py:if="date">
      <noscript>
        <a href="/flights/date/${(date - timedelta(days=1)).strftime('%Y-%m-%d')}"><span class="add-on"><i class="icon-arrow-left"></i></span></a>
      </noscript>
      Flights on ${format_date(date)}
      <noscript>
        <a href="/flights/date/${(date + timedelta(days=1)).strftime('%Y-%m-%d')}"><span class="add-on"><i class="icon-arrow-right"></i></span></a>
      </noscript>
    </h3>

    <h3 py:if="pilot">
      Flights of pilot "<a href="/users/id/${pilot.user_id}/">${pilot}</a>"
    </h3>

    <h3 py:if="club">
      Flights of club "<a href="/clubs/id/${club.id}/">${club}</a>"
    </h3>

      <div id="getting_started">
        <table id="flight-table" class="table table-striped">
          <thead>
            <tr>
              <th class="date" py:if="not date">Date</th>
              <th class="numeric">Score</th>
              <th>Pilot</th>
              <th class="numeric">Distance</th>
              <th py:if="not club and not pilot">Club</th>
              <th>Time</th>
              <th></th>
            </tr>
          </thead>
          <tbody>
            <tr py:for="flight in flights">
              <td class="date" py:if="not date">
                <span py:if="flight.takeoff_time" py:replace="format_date(flight.takeoff_time)">
                  2012-05-21
                </span>
              </td>
              <td class="numeric" py:content="flight.olc_plus_score">
                500
              </td>
              <td>
                <a py:if="flight.pilot" py:content="flight.pilot" href="/flights/pilot/${flight.pilot_id}">
                  Pilot Name
                </a>
                <br py:if="flight.pilot and flight.co_pilot"/>
                <a py:if="flight.co_pilot" py:content="flight.co_pilot" href="/flights/pilot/${flight.co_pilot_id}">
                  Co-Pilot Name
                </a>
                <span py:if="not flight.pilot and not flight.co_pilot" py:strip="True">
                  [${flight.owner}]
                </span>
              </td>
              <td class="numeric">
                <span py:if="flight.olc_classic_distance is not None">
                  <span py:content="flight.olc_classic_distance / 1000">500</span> km
                </span>
              </td>
              <td py:if="not club and not pilot">
                <a py:if="flight.club" py:content="flight.club" href="/flights/club/${flight.club_id}">
                  Club Name
                </a>
              </td>
              <td>
                <span py:if="flight.takeoff_time and flight.landing_time" py:strip="True">
                  <span py:replace="flight.takeoff_time.strftime('%H:%M')">10:00</span>-<span py:replace="flight.landing_time.strftime('%H:%M')">15:00</span>
                </span>
              </td>
              <td nowrap="nowrap">
                <a href="/flights/id/${flight.id}/">Show</a>
                <span class="pin" style="display: none;" rel="tooltip" title="Activate this to show the flight on top of other flights on the map">${flight.id}</span>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
  </body>
</html>
<commit_msg>Revert "flights/list: Used show()/hide() to set visibility"<commit_after><?python
from datetime import timedelta
from babel.dates import format_date

page = 'flights'
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">

  <xi:include href="master/page.html" />

  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" py:if="False"/>
    <script src="/static/jquery/jquery.js" type="text/javascript" language="javascript" />
    <script src="/static/jquery/jquery.dataTables.js" type="text/javascript" language="javascript" />
    <script src="/static/jquery/jquery.dataTables.ext.js" type="text/javascript" language="javascript" />

    <script src="/static/jquery/bootstrap-datepicker.js" type="text/javascript" language="javascript" />
    <script src="/static/bootstrap/js/bootstrap-tooltip.js" type="text/javascript" language="javascript" />

    <script src="/static/jquery/jquery.cookie.js" type="text/javascript" language="javascript" />
    <script src="/js/general.js" type="text/javascript" language="javascript" />

    <link href="/css/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="/css/datepicker.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" charset="utf-8">
    /* <![CDATA[ */
      $(document).ready(function() {
        var pinnedFlights = getPinnedFlights();

        $('#flight-table').dataTable({
          "bProcessing": true,
          "sPaginationType": "bootstrap",
          "iDisplayLength": ${repr(int(config.get('skylines.lists.display_length', 50)))},
          "iDeferLoading": ${flights_count},
          "bServerSide": (${flights_count} > ${repr(int(config.get('skylines.lists.server_side', 250)))})?true:false,
          "sAjaxSource": (${flights_count} > ${repr(int(config.get('skylines.lists.server_side', 250)))})?"${request.url}?json=true":null,
          "sDom": "<'row'<'span6'i><'span6'p>>rt<'row'<'span6'i><'span6'p>>",
          "aaSorting": [[ 0, "desc" ]],
          "aoColumnDefs": [
            { "bSortable": false, "aTargets": [-1] },
            { "sType": "date-eu", "aTargets": ["date"] },
            { "sType": "numeric-comma-formatted", "aTargets": ["numeric"] }
          ],
          "fnCreatedRow": function(nRow, aData, iDataIndex) {
            $(nRow).find(".pin").each(function() {
              var sfid = parseInt($(this).text());
              $(this).tooltip();
              if ($.inArray(sfid, pinnedFlights) >= 0) {
                $(this).html("<i class='icon-star'></i>");
                $(this).css("visibility", "visible");
                $(this).addClass("pinned");
              } else {
                $(this).html("<i class='icon-star-empty'></i>");
              }

              $(this).find("i").click(function() {
                if ($(this).parent(".pin").hasClass("pinned")) {
                  unpinFlight(sfid);
                  $(this).addClass("icon-star-empty");
                  $(this).removeClass("icon-star");
                  $(this).parent(".pin").removeClass("pinned");
                } else {
                  pinFlight(sfid);
                  $(this).addClass("icon-star");
                  $(this).removeClass("icon-star-empty");
                  $(this).parent(".pin").addClass("pinned");
                }
              });
            });

            jQuery(nRow).hover(function(e) {
              if (e.type == "mouseenter") {
                $(this).find(".pin").each(function() {
                  $(this).css("visibility", "visible");
                });
              } else if (e.type == "mouseleave") {
                $(this).find(".pin").each(function() {
                  if (!$(this).hasClass("pinned"))
                    $(this).css("visibility", "hidden");
                });
              }
            });
          }
        });

        var datepicker = $('#datepicker').datepicker({
          format: 'dd.mm.yyyy',
          autoclose: true
        });
        datepicker.on('changeDate', function(e) {
          var url = "/flights/date/" + e.date.getFullYear() + "-" +
            pad(e.date.getMonth()+1, 2) + "-" + pad(e.date.getDate(), 2);
          window.location.href = url;
        });

        $("[rel=tooltip]").tooltip();
      });
    /* ]]> */
    </script>

    <title py:if="date">Flights on ${format_date(date)}</title>
    <title py:if="pilot">Flights of pilot "${pilot}"</title>
    <title py:if="club">Flights of club "${club}"</title>"
    <title py:if="not date and not pilot and not club">Flight list</title>
  </head>

  <body>
    <xi:include href="nav.html" />

    <h3 py:if="date">
      <noscript>
        <a href="/flights/date/${(date - timedelta(days=1)).strftime('%Y-%m-%d')}"><span class="add-on"><i class="icon-arrow-left"></i></span></a>
      </noscript>
      Flights on ${format_date(date)}
      <noscript>
        <a href="/flights/date/${(date + timedelta(days=1)).strftime('%Y-%m-%d')}"><span class="add-on"><i class="icon-arrow-right"></i></span></a>
      </noscript>
    </h3>

    <h3 py:if="pilot">
      Flights of pilot "<a href="/users/id/${pilot.user_id}/">${pilot}</a>"
    </h3>

    <h3 py:if="club">
      Flights of club "<a href="/clubs/id/${club.id}/">${club}</a>"
    </h3>

      <div id="getting_started">
        <table id="flight-table" class="table table-striped">
          <thead>
            <tr>
              <th class="date" py:if="not date">Date</th>
              <th class="numeric">Score</th>
              <th>Pilot</th>
              <th class="numeric">Distance</th>
              <th py:if="not club and not pilot">Club</th>
              <th>Time</th>
              <th></th>
            </tr>
          </thead>
          <tbody>
            <tr py:for="flight in flights">
              <td class="date" py:if="not date">
                <span py:if="flight.takeoff_time" py:replace="format_date(flight.takeoff_time)">
                  2012-05-21
                </span>
              </td>
              <td class="numeric" py:content="flight.olc_plus_score">
                500
              </td>
              <td>
                <a py:if="flight.pilot" py:content="flight.pilot" href="/flights/pilot/${flight.pilot_id}">
                  Pilot Name
                </a>
                <br py:if="flight.pilot and flight.co_pilot"/>
                <a py:if="flight.co_pilot" py:content="flight.co_pilot" href="/flights/pilot/${flight.co_pilot_id}">
                  Co-Pilot Name
                </a>
                <span py:if="not flight.pilot and not flight.co_pilot" py:strip="True">
                  [${flight.owner}]
                </span>
              </td>
              <td class="numeric">
                <span py:if="flight.olc_classic_distance is not None">
                  <span py:content="flight.olc_classic_distance / 1000">500</span> km
                </span>
              </td>
              <td py:if="not club and not pilot">
                <a py:if="flight.club" py:content="flight.club" href="/flights/club/${flight.club_id}">
                  Club Name
                </a>
              </td>
              <td>
                <span py:if="flight.takeoff_time and flight.landing_time" py:strip="True">
                  <span py:replace="flight.takeoff_time.strftime('%H:%M')">10:00</span>-<span py:replace="flight.landing_time.strftime('%H:%M')">15:00</span>
                </span>
              </td>
              <td nowrap="nowrap">
                <a href="/flights/id/${flight.id}/">Show</a>
                <span class="pin" style="visibility: hidden;" rel="tooltip" title="Activate this to show the flight on top of other flights on the map">${flight.id}</span>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
  </body>
</html>

{'fraction_non_alphanumeric': 0.19500312304809495, 'fraction_numerical': 0.008744534665833853, 'mean_word_length': 1.979344994417566, 'pattern_counts': {'":': 34, '<': 267, '<?xml version=': 0, '>': 273, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 6}, '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': '5308040', 'n_tokens_mistral': 5246, 'n_tokens_neox': 4911, 'n_words': 781}