random.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {% extends "base_template.html" %}
  2. {% block head %}
  3. <!-- Latest compiled and minified CSS -->
  4. <!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> -->
  5. <!-- Optional theme -->
  6. <!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous"> -->
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
  8. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
  9. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
  10. <!-- my css -->
  11. <link rel="stylesheet" type="text/css" href="/static/stops.css">
  12. {% endblock %}
  13. {% block body %}
  14. <div class="container">
  15. <h1>Random Stop!</h1>
  16. <br/>
  17. {% if town.visits %}
  18. <a name="{{town.id}}">
  19. <p class="day-links">Day {{town.day}} thru Day {{town.day + town.visits}} -- {{town.date_}} until {{town.final_date}}</p>
  20. </a>
  21. {% else %}
  22. <a name="{{town.id}}">
  23. <p class="day-links">Day {{town.day}} -- {{town.date_}}</p>
  24. </a>
  25. {% endif %}
  26. <div class="town">
  27. {% if town.visits %}
  28. <h1>{{town.city}}. x{{town.visits + 1}}</h1>
  29. {% else %}
  30. <h1>{{town.city}}.</h1>
  31. {% endif %}
  32. {% if town.photos %}
  33. {% if town.photos|length == 1 %}
  34. <img src="/static/photos/{{ town.photos[0].filename }}" class="townphoto solophoto">
  35. {% else %}
  36. <div id="{{town.id}}-carousel" class="carousel slide" data-ride="carousel" data-interval="false">
  37. <!-- Indicators -->
  38. <ol class="carousel-indicators">
  39. {% for i in range(town.photos|length) %}
  40. {% if i == 0 %}
  41. <li data-target="#{{town.id}}-carousel" data-slide-to="{{i}}" class="active"></li>
  42. {% else %}
  43. <li data-target="#{{town.id}}-carousel" data-slide-to="{{i}}"></li>
  44. {% endif %}
  45. {% endfor %}
  46. </ol>
  47. <div class="carousel-inner">
  48. {% for i in range(town.photos|length) %}
  49. {% if i == 0 %}
  50. <div class="item active">
  51. <img src="/static/photos/{{town.photos[i].filename }}" class="townphoto">
  52. {% if town.photos[i].comments %}
  53. <div class="carousel-caption d-none d-md-block">
  54. <p>{{ town.photos[i].comments }}</p>
  55. </div>
  56. {% endif %}
  57. </div>
  58. {% else %}
  59. <div class="item">
  60. <img src="/static/photos/{{town.photos[i].filename }}" class="townphoto" >
  61. {% if town.photos[i].comments %}
  62. <div class="carousel-caption d-none d-md-block">
  63. <p>{{ town.photos[i].comments }}</p>
  64. </div>
  65. {% endif %}
  66. </div>
  67. {% endif %}
  68. {% endfor %}
  69. </div>
  70. <a class="left carousel-control" href="#{{town.id}}-carousel" data-slide="prev">
  71. <span class="glyphicon glyphicon-chevron-left"></span>
  72. <span class="sr-only">Previous</span>
  73. </a>
  74. <a class="right carousel-control" href="#{{town.id}}-carousel" data-slide="next">
  75. <span class="glyphicon glyphicon-chevron-right"></span>
  76. <span class="sr-only">Next</span>
  77. </a>
  78. </div>
  79. {% endif %}
  80. {% endif %}
  81. {% set city_html = 'stops/' + town.id + '.html' %}
  82. {% include city_html ignore missing %}
  83. </div>
  84. </div>
  85. {% endblock %}