Commits

Arnaud Grausem committed fe705e2

Adding footer on all pages
Adding the flatpages module in default configuration
Adding a static page -> Privacy

  • Participants
  • Parent commits 208b3c0

Comments (0)

Files changed (9)

File media/css/style.css

     border: none;
 }
 
-#module 
+#module, #footer
 {
     width: 924px;
     padding: 10px;
     margin: 0 auto;
 }
 
+#footer
+{
+    border-top: solid 2px #777777;
+    margin: 50px auto;
+    padding: 0;
+}
+
+#footer ul
+{
+    font-size: 12px;
+    height: 20px;
+    margin: 10px 0;
+}
+
+#footer span.pipe
+{
+    margin: 0 5px;
+}
+
+#footer a
+{
+    padding: 0;
+    display: inline;
+    font-weight: bold;
+}
+
+#footer a:hover
+{
+    text-decoration: underline;
+}
+
+#footer #versions
+{
+    font-size: 10px;
+    color: #777777;
+}
+
+#footer #versions a
+{
+    color: #777777;
+}
+
 #view
 {
     position: relative;

File templates/base.html

+{% load i18n %}
+
 <html>
     <head>
-        <title>Thot</title>
+        <title>Thot{% block title %}{% endblock %}</title>
     	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <link type="text/css" href="/static/css/style.css" rel="stylesheet">
         {% block css %}{% endblock %}
 	<div id="container">
         {% block body %}
         {% endblock %}
+	    <div id="footer">
+		<ul>
+		{% spaceless %}
+		    <li>Copyright © 2010 Arnaud Grausem<span class="pipe">|</span></li>
+		    <li><a href="/information/privacy" alt="{% trans "Privacy" %}">{% trans "Privacy" %}</a></li>
+		{% endspaceless %}	
+		</ul>
+		<div id="versions">
+		{% spaceless %}
+	    	    {% trans "We run" %}&nbsp;
+			<a href="http://www.python.org" alt="Python programming language">Python {{ python }}</a>
+			<span class="pipe">/</span>
+			<a href="http://www.djangoproject.com" alt="A framework for perfectionnist">Django {{ django }}</a>
+			<span class="pipe">/</span>
+			<a href="http://www.dajaxproject.com" alt="Ajax in Django apps">Dajaxice {{ dajaxice }}</a>
+			<span class="pipe">|</span>
+			<a href="http://bitbucket.org/agrausem/thot">Thot {{ thot }}</a>
+		{% endspaceless %}
+		</div>
+	    </div>
 	</div>
     </body>
 </html>

File templates/flatpages/privacy.html

+{% extends "index.html" %}
+
+{% block title %}
+&nbsp;|&nbsp;{{ flatpage.title }}
+{% endblock %}
+{% block module %}
+{{ flatpage.content }}
+{% endblock %}

File thot/__init__.py

     The Thot web application project
 
 """
+import sys
 
+import django
+import dajaxice
 
 VERSION = (0, 6, 0, 'alpha')
+
+def _display_version(version):
+    """Displays version in a human readable form
+    """
+    return '.'.join('{0}'.format(item) for item in version[:3])
+
+def get_versions():
+    """Returns the most important module versions that runs Thot web
+    application"""
+    return {
+        'python': _display_version(sys.version_info),
+        'django': _display_version(django.VERSION),
+        'dajaxice': _display_version(dajaxice.VERSION),
+        'thot': _display_version(VERSION)
+    }
+
+def version():
+    """Returns a readable version of the Thot Web Application
+    """
+    return _display_version(VERSION)

File thot/context_processors.py

+# -*- coding: utf-8 -*-
+
+#-------------------------------------------------------------------------------
+# Copyright (C) 2010 Grausem Arnaud <arnaud.grausem@gmail.com>
+# Licence CeCILL v2: see LICENSE for details
+#
+# This file is part of thot
+#
+# This software is governed by the CeCILL license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# "http://www.cecill.info".
+#
+# As a counterpart to the access to the source code and rights to copy, modify
+# and redistribute granted by the license, users are provided only with a
+# limited warranty and the software's author, the holder of the economic
+# rights, and the successive licensors have only limited liability.
+#
+# In this respect, the user's attention is drawn to the risks associated with
+# loading, using, modifying and/or developing or reproducing the software by
+# the user in light of its specific status of free software, that may mean
+# that it is complicated to manipulate, and that also therefore means that it
+# is reserved for developers and experienced professionals having in-depth
+# computer knowledge. Users are therefore encouraged to load and test the
+# software's suitability as regards their requirements in conditions enabling
+# the security of their systems and/or data to be ensured and, more generally,
+# to use and operate it in the same conditions as regards security.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL license and that you accept its terms.
+#-------------------------------------------------------------------------------
+
+"""
+
+    thot.context_processors
+    ~~~~~~~~~~~~~~~~~~~~~~~
+
+    Main context processors of the Thot project
+
+"""
+
+from . import get_versions
+
+def versions(request):
+    """Allows you to pass global informations about the project
+    """
+    return get_versions()

File thot/local_settings.py.dev

 # Make this unique, and don't share it with anybody.
 SECRET_KEY = 'h@3$n3z4aq+jeqcbhc!)--ot=^&das@@cre&4-7h!t4=ub=w2y'
 
-TEMPLATE_CONTEXT_PROCESSORS = (
-    'django.core.context_processors.auth',
-    'django.core.context_processors.debug',
-    'django.core.context_processors.i18n',
-    'django.core.context_processors.media',
-    'thot.registration.context_processors.user',
-)
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
-    'django.template.loaders.eggs.load_template_source',
-)
 
 # To enable the CAS authentication, uncomment the line below
 # Make sure the django_cas library is installed
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     #'django_cas.middleware.CASMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
     'django.middleware.doc.XViewMiddleware',
 )
 

File thot/local_settings.py.prod

 # Make this unique, and don't share it with anybody.
 SECRET_KEY = 'h@3$n3z4aq+jeqcbhc!)--ot=^&das@@cre&4-7h!t4=ub=w2y'
 
-TEMPLATE_CONTEXT_PROCESSORS = (
-    'django.core.context_processors.auth',
-    'django.core.context_processors.debug',
-    'django.core.context_processors.i18n',
-    'django.core.context_processors.media',
-    'thot.registration.context_processors.user',
-)
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
-    'django.template.loaders.eggs.load_template_source',
-)
-
 # To enable the CAS authentication, uncomment the line below
 # Make sure the django_cas library is installed
 MIDDLEWARE_CLASSES = (
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     #'django_cas.middleware.CASMiddleware',
     'django.middleware.csrf.CsrfMiddleware',
+    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
     'django.middleware.doc.XViewMiddleware',
 )
 

File thot/registration/context_processors.py

-# -*- coding: utf-8 -*-
-
-#-------------------------------------------------------------------------------
-# Copyright (C) 2010 Grausem Arnaud <arnaud.grausem@gmail.com>
-# Licence CeCILL v2: see LICENSE for details
-#
-# This file is part of thot
-#
-# This software is governed by the CeCILL license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# "http://www.cecill.info".
-#
-# As a counterpart to the access to the source code and rights to copy, modify
-# and redistribute granted by the license, users are provided only with a
-# limited warranty and the software's author, the holder of the economic
-# rights, and the successive licensors have only limited liability.
-#
-# In this respect, the user's attention is drawn to the risks associated with
-# loading, using, modifying and/or developing or reproducing the software by
-# the user in light of its specific status of free software, that may mean
-# that it is complicated to manipulate, and that also therefore means that it
-# is reserved for developers and experienced professionals having in-depth
-# computer knowledge. Users are therefore encouraged to load and test the
-# software's suitability as regards their requirements in conditions enabling
-# the security of their systems and/or data to be ensured and, more generally,
-# to use and operate it in the same conditions as regards security.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL license and that you accept its terms.
-#-------------------------------------------------------------------------------
-
-"""
-
-    thot.registration.context_processors
-    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-    The context processors of the registration application
-
-"""
-
-def user(request):
-    """Allows you to pass the user object in every template 
-    of the application.
-    """
-    return {
-        'user': request.user
-    }

File thot/settings.py

     'django.core.context_processors.debug',
     'django.core.context_processors.i18n',
     'django.core.context_processors.media',
-    'thot.registration.context_processors.user',
+    'thot.context_processors.versions'
 )
 
 ROOT_URLCONF = 'thot.urls'
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.admin',
+    'django.contrib.flatpages',
     'django_extensions',
     'dajaxice',
     'dajax',