src/ldt/ldt/templates/base.html
author grandjoncl
Wed, 28 Nov 2012 12:27:08 +0100
changeset 995 94f9d36371f6
parent 119 07c64d93dce5
child 1187 73403060f297
permissions -rw-r--r--
new template tag absstatic to have absolute url for static file and avoid using LDT_MEDIA_PREFIX new absurl template tag can be used instead of template tag url to have absolute url replacement of all LDT_MEDIA_PREFIX in different templates and views
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
995
94f9d36371f6 new template tag absstatic to have absolute url for static file and avoid using LDT_MEDIA_PREFIX
grandjoncl
parents: 119
diff changeset
     1
{% load absstatic %}
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     3
{% block html_declare %}
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     4
<html lang="en">
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     5
{% endblock %}
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     6
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     7
<head>
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
     8
    <title>{% if user.is_authenticated %}Hello {{ user }}{% else %}Please login{% endif %}</title>
995
94f9d36371f6 new template tag absstatic to have absolute url for static file and avoid using LDT_MEDIA_PREFIX
grandjoncl
parents: 119
diff changeset
     9
    <link rel="stylesheet" type="text/css" media="screen"  href='{% absstatic "ldt/css/socialauth.css" %}' />
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    10
    {% block extra_head %}
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    11
    {% endblock %}
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    12
</head>
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    13
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    14
<body>
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    15
    <h1>social-auth</h1>
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    16
        {% if FACEBOOK_APP_ID %}
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    17
          <div id="fb-root"></div>
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    18
          <script>
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    19
          window.fbAsyncInit = function() {
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    20
            FB.init({appId: '{{ FACEBOOK_APP_ID }}', status: true, cookie: true, xfbml: true});
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    21
            FB.Event.subscribe('auth.sessionChange', function(response) {
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    22
              if (response.session) {
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    23
                  window.location = '{% url socialauth_facebook_login_done %}';
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    24
              } else {
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    25
                  //window.location = '{% url socialauth_social_logout %}';
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    26
              }
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    27
            });
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    28
          };
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    29
          (function() {
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    30
            var e = document.createElement('script');
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    31
            e.type = 'text/javascript';
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    32
            e.src = document.location.protocol +
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    33
              '//connect.facebook.net/en_US/all.js';
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    34
            e.async = true;
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    35
            document.getElementById('fb-root').appendChild(e);
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    36
          }());
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    37
          </script>    
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    38
        {% endif %}    
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    39
    {% block extra_body %}
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    40
    {% endblock %}
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    41
    
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    42
    {% block main_content %}
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    43
    {% endblock %}
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    44
    
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    45
    {% block content %}
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    46
    {% endblock %}
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    47
    <!-- Insert your content here -->
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    48
</body>
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 28
diff changeset
    49
</html>