templates/base.html.twig line 1

Open in your IDE?
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4.     <!-- Required meta tags -->
  5.     <meta charset="utf-8">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1">
  7.     <!-- Bootstrap CSS -->
  8.     <link rel="preconnect" href="https://fonts.googleapis.com">
  9.     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  10.     <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;700&display=swap" rel="stylesheet">
  11.     <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
  12.           integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
  13.     <title>{% block title %}Welcome!{% endblock %}</title>
  14.     <style>
  15.         * { box-sizing: border-box; }
  16.         a { color: #218BC3; }
  17.         a:hover { color: #1a678f; }
  18.         html, body { font-family: Roboto, helvetica, arial, sans-serif; font-weight: 300; }
  19.         header { text-align: right; width: 100%; padding: 0.3rem 0.5rem; }
  20.         header h1 { font-size: 1rem; font-weight: normal; float: left; }
  21.         body.photoview { color: white; background-color: black; }
  22.         body.photoview header { font-size: 0.9rem; position: absolute; background-image: -moz-linear-gradient(0deg,rgba(0,0,0,0),rgba(0,0,0,0.4));
  23.             background-image: linear-gradient(0deg,rgba(0,0,0,0),rgba(0,0,0,0.4));
  24.             -moz-box-shadow: none; }
  25.         .divider { color: #333; }
  26.         .date { color: gray; }
  27.     </style>
  28.     {# Run `composer require symfony/webpack-encore-bundle`
  29.            and uncomment the following Encore helpers to start using Symfony UX #}
  30.     {% block stylesheets %}
  31.         {# {{ encore_entry_link_tags('app') }} #}
  32.     {% endblock %}
  33. </head>
  34. <body class="{% block body_class %}{% endblock %}">{% apply spaceless %}
  35. <header>
  36.     <h1>{% block top_title %}{% endblock %}</h1>
  37.     <span class="top-menu">
  38.     {% block top_menu %}{% endblock %}
  39.     {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  40.         <a href="{{ path('user') }}">profile</a> <span class="divider"> / </span> <a href="{{ path('app_logout') }}">sign out</a>
  41.     {% else %}
  42.         <a href="{{ path('app_login') }}">sign in</a><!-- <span class="divider">/</span> <a href="{{ path('app_register') }}">register</a>-->
  43.     {% endif %}
  44.     </span>
  45. </header>
  46. {% block maxbody %}
  47. <div class="container">
  48.     {% block body %}{% endblock %}
  49. </div>
  50. {% endblock %}
  51. <script>
  52.     function localizeDates() {
  53.         var spans = document.querySelectorAll('[data-timestamp]'), i;
  54.         for (i = 0; i < spans.length; ++i) {
  55.             spans[i].innerHTML = timestampToDate(spans[i].getAttribute('data-timestamp'));
  56.         }
  57.     }
  58.     function timestampToDate(timestamp) {
  59.         var date = new Date(timestamp * 1000);
  60.         var year = date.getFullYear();
  61.         var month = ('0' + (date.getMonth() + 1)).slice(-2);
  62.         var day = ('0' + date.getDate()).slice(-2);
  63.         var hours = date.getHours();
  64.         var minutes = ("0" + date.getMinutes()).substr(-2);
  65.         //var seconds = ("0" + date.getSeconds()).substr(-2);
  66.         return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes;
  67.     }
  68.     localizeDates();
  69. </script>
  70. {% block javascripts %}{% endblock %}
  71. {% endapply %}</body>
  72. </html>