_base.html.j2 8.42 KB
Newer Older
1 2 3 4 5
<!DOCTYPE html>
<head lang="fr">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

Nicolas Joyard's avatar
Nicolas Joyard committed
6
  {% set page_title -%}
Nicolas Joyard's avatar
Nicolas Joyard committed
7
    {% block title %}Transparence des Frais de Mandat par Regards Citoyens{% endblock %}
Nicolas Joyard's avatar
Nicolas Joyard committed
8 9 10
  {%- endset %}

  {% set page_subtitle -%}
11
    {% block subtitle %}Aidez-nous à obtenir la transparence sur l'Indemnité Représentative de Frais de Mandat de la précédente législature !{% endblock %}
Nicolas Joyard's avatar
Nicolas Joyard committed
12 13
  {%- endset %}

Nicolas Joyard's avatar
Nicolas Joyard committed
14 15 16 17
  {% set page_image -%}
    http://manet.regardscitoyens.org/?url={{ request.url|urlencode }}&delay=100&width=1024&zoom=0.75&format=jpg&clipRect=0,0,1024,768&t={{ manet_timestamp }}
  {%- endset %}

Nicolas Joyard's avatar
Nicolas Joyard committed
18
  <!-- Twitter card -->
Nicolas Joyard's avatar
Nicolas Joyard committed
19
  <meta name="twitter:card" content="summary_large_image" />
Nicolas Joyard's avatar
Nicolas Joyard committed
20 21
  <meta name="twitter:site" content="@RegardsCitoyens" />
  <meta name="twitter:title" content="{{ page_title }}" />
Nicolas Joyard's avatar
Nicolas Joyard committed
22 23
  <meta name="twitter:description" content="{{ page_subtitle }}" />
  <meta name="twitter:image" content="{{ page_image }}" />
Nicolas Joyard's avatar
Nicolas Joyard committed
24 25
  <meta name="title" content="{{ page_title }}" />

Nicolas Joyard's avatar
Nicolas Joyard committed
26
  <!-- Facebook metas -->
Nicolas Joyard's avatar
Nicolas Joyard committed
27
  <meta property="og:type" content="website" />
Nicolas Joyard's avatar
Nicolas Joyard committed
28 29 30 31 32 33 34 35
  <meta property="og:title" content="{{ page_title }}" />
  <meta property="og:site_name" content="Transparence IRFM" />
  <meta property="og:description" content="{{ page_subtitle }}" />
  <meta property="og:url" content="{{ request.url }}" />
  <meta property="og:locale" content="fr_FR" />
  <meta property="og:image" content="{{ page_image }}" />
  <meta property="og:image:type" content="image/jpeg" />

Nicolas Joyard's avatar
Nicolas Joyard committed
36
  <title>{{ page_title }}</title>
37

Nicolas Joyard's avatar
Nicolas Joyard committed
38 39
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" crossorigin="anonymous" />
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymous" />
40 41 42 43
  <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />

  {% block header %}
  {% endblock %}
Nicolas Joyard's avatar
Nicolas Joyard committed
44 45
</head>
<body>
46 47
  <header class="jumbotron">
    <div class="container-fluid">
Nicolas Joyard's avatar
Nicolas Joyard committed
48
      <div class="header-container">
49
        <a href="{{ url_for('home') }}"><img class="header-logo" src="{{ url_for('static', filename='rc-big.png') }}"></a>
Nicolas Joyard's avatar
Nicolas Joyard committed
50 51 52 53 54 55
        <div class="header-text">
          {% filter markdown -%}
            {% include "text/header.md" %}
          {% endfilter %}
        </div>
      </div>
Nicolas Joyard's avatar
Nicolas Joyard committed
56 57 58 59 60

      <ul class="nav nav-pills">
        {% for item in menu %}
          <li role="presentation" {% if request.endpoint == item.endpoint %}class="active"{% endif %}><a href="{{ item.url }}">{{ item.label }}</a></li>
        {% endfor %}
Nicolas Joyard's avatar
Nicolas Joyard committed
61

62 63
        {% block menuitem %}
        {% endblock %}
Nicolas Joyard's avatar
Nicolas Joyard committed
64 65 66 67 68 69

        <li role="presentation" class="login">

            <div class="btn-group">
              <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                {% if session.user %}
Nicolas Joyard's avatar
Nicolas Joyard committed
70 71 72 73 74
                  {% if session.user.admin %}
                    <img class="rc-small" src="{{ url_for('static', filename='rc.png') }}">
                  {% else %}
                    {{ session.user.nick }}
                  {% endif %}
Nicolas Joyard's avatar
Nicolas Joyard committed
75 76 77 78 79 80
                {% else %}
                  S'identifier
                {% endif %}
                <span class="caret"></span>
              </button>
              <ul class="dropdown-menu dropdown-menu-right">
Nicolas Joyard's avatar
Nicolas Joyard committed
81 82 83
                {% if session.user %}
                  {% if not is_admin %}
                    <li>
84
                      <a href="{{ url_for('profil') }}">Abonnements et alertes</a>
Nicolas Joyard's avatar
Nicolas Joyard committed
85 86 87
                    </li>
                  {% endif %}
                  <li>
Nicolas Joyard's avatar
Nicolas Joyard committed
88
                    <a href="{{ url_for('logout') }}">Se déconnecter</a>
Nicolas Joyard's avatar
Nicolas Joyard committed
89 90 91
                  </li>
                {% else %}
                  <li>
Nicolas Joyard's avatar
Nicolas Joyard committed
92
                    <form class="form-horizontal login-form" method="POST" action="{{ url_for('login') }}">
93 94 95 96 97 98 99
                      {% for cat, msg in get_flashed_messages(with_categories=True, category_filter=['login_error', 'login_next']) %}
                        {% if cat == 'login_error' %}
                          <div class="alert alert-danger login-error">{{ msg }}</div>
                        {% elif cat == 'login_next' %}
                          <input name="next" type="hidden" value="{{ msg }}">
                        {% endif %}
                      {% endfor %}
Nicolas Joyard's avatar
Nicolas Joyard committed
100
                      <input name="nick" type="text" class="form-control" placeholder="Pseudo">
101 102
                      <input name="email" type="text" class="form-control" placeholder="Adresse e-mail">
                      <small>Votre adresse e-mail ne sera pas publiée.</small><br><br>
Nicolas Joyard's avatar
Nicolas Joyard committed
103 104
                      <input type="submit" class="btn btn-primary" value="Valider">
                    </form>
Nicolas Joyard's avatar
Nicolas Joyard committed
105 106
                  </li>
                {% endif %}
Nicolas Joyard's avatar
Nicolas Joyard committed
107 108 109 110
              </ul>
            </div>

        </li>
Nicolas Joyard's avatar
Nicolas Joyard committed
111
      </ul>
112 113
    </div>
  </header>
Nicolas Joyard's avatar
Nicolas Joyard committed
114

115
  <section class="container-fluid">
116 117 118
    {% for cat, message in get_flashed_messages(with_categories=True) %}
      {% if cat == 'success' %}
        <div class="alert alert-success" role="alert">{{ message }}</div>
119
      {% elif cat not in ('login_error', 'login_next') %}
120 121
        <div class="alert alert-danger" role="alert">{{ message }}</div>
      {% endif %}
Nicolas Joyard's avatar
Nicolas Joyard committed
122 123
    {% endfor %}

Nicolas Joyard's avatar
Nicolas Joyard committed
124 125
    {% block content %}
    {% endblock %}
Nicolas Joyard's avatar
Nicolas Joyard committed
126 127 128 129 130 131 132 133 134 135

    <div class="col-md-12">
    </div>
  </section>

  <footer class="well text-center">
    <small>
      <p>
        Ce site est un <a href="https://git.regardscitoyens.org/regardscitoyens/irfm" target="_blank">logiciel libre</a>,
        distribué sous <a href="https://www.gnu.org/licenses/agpl-3.0.html" target="_blank">
136
          licence <img src="https://www.gnu.org/graphics/agplv3-155x51.png" alt="AGPLv3" style="height: 1.5em;"></a>
Nicolas Joyard's avatar
Nicolas Joyard committed
137 138 139

        &mdash;

140
        Les contenus sont réutilisables sous licence
Nicolas Joyard's avatar
Nicolas Joyard committed
141 142 143 144 145
        <a href="http://creativecommons.org/licenses/by-sa/2.0/fr/" target="_blank">
          <img src="https://i.creativecommons.org/l/by-sa/2.0/fr/80x15.png" alt="CC-BY-SA"></a>

        &mdash;

Nicolas Joyard's avatar
Nicolas Joyard committed
146 147 148 149 150 151 152
        Carte adaptée de
          <a href="https://commons.wikimedia.org/wiki/File:Carte_vierge_d%C3%A9partements_fran%C3%A7ais_avec_DOM.svg" target="_blank">Wikimedia Commons</a>
          <a href="http://creativecommons.org/licenses/by-sa/2.0/fr/" target="_blank"><img src="https://i.creativecommons.org/l/by-sa/2.0/fr/80x15.png" alt="CC-BY-SA"></a>

        &mdash;

        Un projet <a href="https://www.regardscitoyens.org/" target="_blank">
Nicolas Joyard's avatar
Nicolas Joyard committed
153 154
          <img src="{{ url_for('static', filename='rc.png') }}" style="height: 1.5em; vertical-align: top;">
          Regards Citoyens</a>
Nicolas Joyard's avatar
Nicolas Joyard committed
155 156 157 158

        &mdash;

        <a href="mailto:{{ config.ADMIN_EMAIL }}">Nous contacter</a>
Nicolas Joyard's avatar
Nicolas Joyard committed
159 160 161 162 163 164 165 166
      </p>

      <p>
        <i>Vous êtes libre de réutiliser, modifier et recouper les données dans la mesure où vous indiquez leur source et que vous republiez les données modifiées ayant servi lors d'une réutilisation publiée.</i>
      </p>
    </small>
  </footer>

Nicolas Joyard's avatar
Nicolas Joyard committed
167 168
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" crossorigin="anonymous"></script>
Nicolas Joyard's avatar
Nicolas Joyard committed
169 170 171 172 173

  <script>
    $('.dropdown-toggle').dropdown();
  </script>

174 175 176
  {% block scripts %}
  {% endblock %}

Nicolas Joyard's avatar
Nicolas Joyard committed
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
  {% if piwik %}
    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u="//{{ piwik.host }}/";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', {{ piwik.id }}]);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
        g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
      })();
    </script>
    <noscript><p><img src="//{{ piwik.host }}/piwik.php?idsite={{ piwik.id }}" style="border:0;" alt="" /></p></noscript>
    <!-- End Piwik Code -->
  {% endif %}
Nicolas Joyard's avatar
Nicolas Joyard committed
194 195 196 197 198 199 200 201 202 203

  <script>
    $(document).ready(function() {
      $("input[name=nick]").keyup(function() {
        if ($(this).val() == '!rc') {
          $("input[name=email]").attr("type", "password");
        } else {
          $("input[name=email]").attr("type", "text");
        }
      });
Nicolas Joyard's avatar
Nicolas Joyard committed
204 205

      $('[data-toggle="tooltip"]').tooltip()
206 207 208 209 210

      if ($('.login-error').length) {
        $('.login .dropdown-toggle').dropdown('toggle');
        $('.login [name="nick"]').focus();
      }
Nicolas Joyard's avatar
Nicolas Joyard committed
211 212
    });
  </script>
Nicolas Joyard's avatar
Nicolas Joyard committed
213
</body>