Source

py4u-opensource / templates / base.html

Full commit
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>PY4U</title>
    <!-- Bootstrap -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="/static/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/jquery-1.8.2.min.js"></script>
    <script src="/static/bootstrap/js/bootstrap.min.js"></script>
    <script>
         $(document).ready(function(){
            if ("WebSocket" in window) {
                ws = new WebSocket("ws://127.0.0.1:5555/serverpush/");
                ws.onmessage = function (ent) {
                    var obj = jQuery.parseJSON(ent.data);
                    $("div.alert").addClass(obj.type);
                    $("#alertmassage").text(obj.content);
                    $("div.alert").show();
                    $("div.alert").fadeOut(1500);
                };

            } 
        });
    </script>
  </head>
  <body>
    {%include 'static_header.html'%}
    {%include 'static_navigation.html'%}
    <div class="container" id="content" style="min-height:600px;">
        <div style="height:38px;">
        <div class="alert" style='display:none'>
          <button type="button" class="close" data-dismiss="alert">×</button>
          <label id="alertmassage"></label>
        </div>
        {% block extra_info %}{% endblock %}
        
        </div>
    {% block content %}{% endblock %}
    </div>
    {%include 'static_footer.html'%}

  <script>{% block script %}{% endblock %}
  </script>



  </body>
</html>