]> git.parisson.com Git - teleforma.git/commitdiff
only 1 message contact (settings.ADMIN_USERNAME), fix menus, add tel
authoryomguy <yomguy@parisson.com>
Wed, 2 Jan 2013 14:03:43 +0000 (15:03 +0100)
committeryomguy <yomguy@parisson.com>
Wed, 2 Jan 2013 14:03:43 +0000 (15:03 +0100)
example/settings.py
example/urls.py
teleforma/templates/postman/base.html
teleforma/templates/postman/base_write.html
teleforma/templates/postman/view.html
teleforma/templates/telemeta/base.html
teleforma/templatetags/teleforma_tags.py

index 81fb7cc38693e28186383a330168643da20e5c17..7c0d501774369f0431c04cb09af663b1da0c8f0c 100644 (file)
-# -*- coding: utf-8 -*-
-# Django settings for sandbox project.
 
-import os
-import sys
-from django.core.urlresolvers import reverse_lazy
-
-sys.dont_write_bytecode = True
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
+######################
+# MEZZANINE SETTINGS #
+######################
+
+# The following settings are already defined with default values in
+# the ``defaults.py`` module within each of Mezzanine's apps, but are
+# common enough to be put here, commented out, for convenient
+# overriding. Please consult the settings documentation for a full list
+# of settings Mezzanine implements:
+# http://mezzanine.jupo.org/docs/configuration.html#default-settings
+
+# Controls the ordering and grouping of the admin menu.
+#
+ADMIN_MENU_ORDER = (
+    ("Content", ("pages.Page", "blog.BlogPost",
+       "generic.ThreadedComment", ("Media Library", "fb_browse"),)),
+    ("Site", ("sites.Site", "redirects.Redirect", "conf.Setting")),
+    ("Users", ("auth.User", "auth.Group",)),
+)
 
+# A three item sequence, each containing a sequence of template tags
+# used to render the admin dashboard.
+#
+# DASHBOARD_TAGS = (
+#     ("blog_tags.quick_blog", "mezzanine_tags.app_list"),
+#     ("comment_tags.recent_comments",),
+#     ("mezzanine_tags.recent_actions",),
+# )
+
+# A sequence of templates used by the ``page_menu`` template tag. Each
+# item in the sequence is a three item sequence, containing a unique ID
+# for the template, a label for the template, and the template path.
+# These templates are then available for selection when editing which
+# menus a page should appear in. Note that if a menu template is used
+# that doesn't appear in this setting, all pages will appear in it.
+
+# PAGE_MENU_TEMPLATES = (
+#     (1, "Top navigation bar", "pages/menus/dropdown.html"),
+#     (2, "Left-hand tree", "pages/menus/tree.html"),
+#     (3, "Footer", "pages/menus/footer.html"),
+# )
+
+# A sequence of fields that will be injected into Mezzanine's (or any
+# library's) models. Each item in the sequence is a four item sequence.
+# The first two items are the dotted path to the model and its field
+# name to be added, and the dotted path to the field class to use for
+# the field. The third and fourth items are a sequence of positional
+# args and a dictionary of keyword args, to use when creating the
+# field instance. When specifying the field class, the path
+# ``django.models.db.`` can be omitted for regular Django model fields.
+#
+# EXTRA_MODEL_FIELDS = (
+#     (
+#         # Dotted path to field.
+#         "mezzanine.blog.models.BlogPost.image",
+#         # Dotted path to field class.
+#         "somelib.fields.ImageField",
+#         # Positional args for field class.
+#         ("Image",),
+#         # Keyword args for field class.
+#         {"blank": True, "upload_to": "blog"},
+#     ),
+#     # Example of adding a field to *all* of Mezzanine's content types:
+#     (
+#         "mezzanine.pages.models.Page.another_field",
+#         "IntegerField", # 'django.db.models.' is implied if path is omitted.
+#         ("Another name",),
+#         {"blank": True, "default": 1},
+#     ),
+# )
+
+# Setting to turn on featured images for blog posts. Defaults to False.
+#
+# BLOG_USE_FEATURED_IMAGE = True
+
+# If ``True``, users will be automatically redirected to HTTPS
+# for the URLs specified by the ``SSL_FORCE_URL_PREFIXES`` setting.
+#
+# SSL_ENABLED = True
+
+# Host name that the site should always be accessed via that matches
+# the SSL certificate.
+#
+# SSL_FORCE_HOST = "www.example.com"
+
+# Sequence of URL prefixes that will be forced to run over
+# SSL when ``SSL_ENABLED`` is ``True``. i.e.
+# ('/admin', '/example') would force all URLs beginning with
+# /admin or /example to run over SSL. Defaults to:
+#
+# SSL_FORCE_URL_PREFIXES = ("/admin", "/account")
+
+# If True, the south application will be automatically added to the
+# INSTALLED_APPS setting.
+USE_SOUTH = True
+
+
+########################
+# MAIN DJANGO SETTINGS #
+########################
+
+# People who get code error notifications.
+# In the format (('Full Name', 'email@example.com'),
+#                ('Full Name', 'anotheremail@example.com'))
 ADMINS = (
-    ('Guillaume Pellerin', 'webmaster@parisson.com'),
-    ('Lists', 'lists@parisson.com'),
+    ('Guillaume Pellerin', 'pellerin@parisson.com'),
 )
-
 MANAGERS = ADMINS
 
-# DATABASES = {
-#     'default': {
-#         'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-#         'NAME': 'teleforma',                      # Or path to database file if using sqlite3.
-#         'USER': 'teleforma',                      # Not used with sqlite3.
-#         'PASSWORD': 'HMYsrZLEtYeBrvER',                  # Not used with sqlite3.
-#         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
-#         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
-#     }
-# }
-
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': 'teleforma_test',                      # Or path to database file if using sqlite3.
-        'USER': 'teleforma',                      # Not used with sqlite3.
-        'PASSWORD': 'teleforma',                  # Not used with sqlite3.
-        'HOST': 'localhost',                      # Set to empty string for localhost. Not used with sqlite3.
-        'PORT': '5432',                      # Set to empty string for default. Not used with sqlite3.
-    }
-}
-
 # Local time zone for this installation. Choices can be found here:
 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
 # although not all choices may be available on all operating systems.
@@ -48,151 +117,301 @@ DATABASES = {
 # system time zone.
 TIME_ZONE = 'Europe/Paris'
 
+# If you set this to True, Django will use timezone-aware datetimes.
+USE_TZ = True
+
 # Language code for this installation. All choices can be found here:
 # http://www.i18nguy.com/unicode/language-identifiers.html
-#LANGUAGE_CODE = 'fr_FR'
-LANGUAGES = [ ('fr', 'French'),
-              ('en', 'English'),
-]
-
-SITE_ID = 1
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
-USE_I18N = True
+LANGUAGE_CODE = "fr"
 
 # If you set this to False, Django will not format dates, numbers and
 # calendars according to the current locale
 USE_L10N = True
 
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media/')
+# A boolean that turns on/off debug mode. When set to ``True``, stack traces
+# are displayed for error pages. Should always be set to ``False`` in
+# production. Best set to ``True`` in local_settings.py
+DEBUG = True
 
-if not os.path.exists(MEDIA_ROOT):
-       os.mkdir(MEDIA_ROOT)
+# Whether a user's session cookie expires when the Web browser is closed.
+SESSION_EXPIRE_AT_BROWSER_CLOSE = True
 
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = 'http://localhost:8040/'
+SITE_ID = 1
 
-# Absolute path to the directory static files should be collected to.
-# Don't put anything in this directory yourself; store your static files
-# in apps' "static/" subdirectories and in STATICFILES_DIRS.
-# Example: "/home/media/media.lawrence.com/static/"
-STATIC_ROOT = '/var/www/static/'
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
 
-ADMIN_MEDIA_PREFIX = '/static/'
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = "2c5a26bd-716c-4a51-bcaa-5f840ba4dfe68c7361eb-3e19-48d8-8ba1-fa141aee861fcebe6451-6ac7-407f-a6b2-63f2f3d157e5"
 
-# URL prefix for static files.
-# Example: "http://media.lawrence.com/static/"
-STATIC_URL = '/static/'
+# Tuple of IP addresses, as strings, that:
+#   * See debug comments, when DEBUG is true
+#   * Receive x-headers
+INTERNAL_IPS = ("127.0.0.1",)
 
-# Additional locations of static files
-STATICFILES_DIRS = (
-    # Put strings here, like "/home/html/static" or "C:/www/django/static".
-    # Always use forward slashes, even on Windows.
-    # Don't forget to use absolute paths, not relative paths.
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+    "django.template.loaders.filesystem.Loader",
+    "django.template.loaders.app_directories.Loader",
 )
 
+AUTHENTICATION_BACKENDS = ("mezzanine.core.auth_backends.MezzanineBackend",)
+
 # List of finder classes that know how to find static files in
 # various locations.
 STATICFILES_FINDERS = (
-    'django.contrib.staticfiles.finders.FileSystemFinder',
-    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
-#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
+    "django.contrib.staticfiles.finders.FileSystemFinder",
+    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
+    'django.contrib.staticfiles.finders.DefaultStorageFinder',
 )
 
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = 'a8l7%06wr2k+3=%#*#@#rvop2mmzko)44%7k(zx%lls^ihm9^5'
 
-# List of callables that know how to import templates from various sources.
-#TEMPLATE_LOADERS = (
-#    ('django.template.loaders.cached.Loader', (
-#        'django.template.loaders.filesystem.Loader',
-#        'django.template.loaders.app_directories.Loader',
-#    )),
-#)
+#############
+# DATABASES #
+#############
+
+DATABASES = {
+    "default": {
+        # Add "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
+        "ENGINE": "django.db.backends.postgresql_psycopg2",
+        # DB name or path to database file if using sqlite3.
+        "NAME": "teleforma_pro",
+        # Not used with sqlite3.
+        "USER": "teleforma",
+        # Not used with sqlite3.
+        "PASSWORD": "teleforma",
+        # Set to empty string for localhost. Not used with sqlite3.
+        "HOST": "localhost",
+        # Set to empty string for default. Not used with sqlite3.
+        "PORT": "5432",
+    }
+}
 
 
-MIDDLEWARE_CLASSES = (
-    'django.middleware.common.CommonMiddleware',
-    'django.contrib.sessions.middleware.SessionMiddleware',
-    'django.middleware.csrf.CsrfViewMiddleware',
-    'django.contrib.auth.middleware.AuthenticationMiddleware',
-    'django.contrib.messages.middleware.MessageMiddleware',
-    'django.middleware.locale.LocaleMiddleware',
-    'pagination.middleware.PaginationMiddleware',
+#########
+# PATHS #
+#########
 
-    "mezzanine.core.request.CurrentRequestMiddleware",
-    "mezzanine.core.middleware.TemplateForDeviceMiddleware",
-    "mezzanine.core.middleware.TemplateForHostMiddleware",
-    "mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware",
-    "mezzanine.pages.middleware.PageMiddleware",
-    "mezzanine.core.middleware.FetchFromCacheMiddleware",
+import os, sys
+from django.core.urlresolvers import reverse_lazy
+sys.dont_write_bytecode = True
 
-)
 
-ROOT_URLCONF = 'urls'
+# Full filesystem path to the project.
+PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
 
-TEMPLATE_DIRS = (
-    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
-    # Always use forward slashes, even on Windows.
-    # Don't forget to use absolute paths, not relative paths.
-    '/home/momo/dev/teleforma/teleforma/teleforma/templates/',
-)
+# Name of the directory for the project.
+PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1]
+
+# Every cache key will get prefixed with this value - here we set it to
+# the name of the directory the project is in to try and use something
+# project specific.
+CACHE_MIDDLEWARE_KEY_PREFIX = PROJECT_DIRNAME
+
+# URL prefix for static files.
+# Example: "http://media.lawrence.com/static/"
+STATIC_URL = "/static/"
+
+# Absolute path to the directory static files should be collected to.
+# Don't put anything in this directory yourself; store your static files
+# in apps' "static/" subdirectories and in STATICFILES_DIRS.
+# Example: "/home/media/media.lawrence.com/static/"
+STATIC_ROOT = '/var/www/static/'
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash.
+# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
+MEDIA_URL = "http://localhost:8040/"
+
+# Absolute filesystem path to the directory that will hold user-uploaded files.
+# Example: "/home/media/media.lawrence.com/media/"
+MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media/')
+
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# trailing slash.
+# Examples: "http://foo.com/media/", "/media/".
+ADMIN_MEDIA_PREFIX = STATIC_URL + "grappelli/"
+
+# Package/module name to import the root urlpatterns from for the project.
+ROOT_URLCONF = "%s.urls" % PROJECT_DIRNAME
+
+# Put strings here, like "/home/html/django_templates"
+# or "C:/www/django/templates".
+# Always use forward slashes, even on Windows.
+# Don't forget to use absolute paths, not relative paths.
+TEMPLATE_DIRS = (os.path.join(PROJECT_ROOT, "templates"),)
+
+
+################
+# APPLICATIONS #
+################
 
 INSTALLED_APPS = (
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    'django.contrib.sites',
+    "django.contrib.admin",
+    "django.contrib.auth",
+    "django.contrib.contenttypes",
+    "django.contrib.redirects",
+    "django.contrib.sessions",
+    "django.contrib.sites",
+    "django.contrib.sitemaps",
+    "django.contrib.staticfiles",
     'django.contrib.messages',
-    'django.contrib.staticfiles',
-    'django.contrib.admin',
-    'django.contrib.comments',
-    'telemeta',
+    "mezzanine.boot",
+    "mezzanine.conf",
+    "mezzanine.core",
+    "mezzanine.generic",
+    # "mezzanine.blog",
+    # "mezzanine.forms",
+    "mezzanine.pages",
+    "mezzanine.galleries",
+    "mezzanine.twitter",
+    #"mezzanine.accounts",
+    #"mezzanine.mobile",
     'jsonrpc',
     'south',
-    'teleforma',
     'sorl.thumbnail',
     'django_extensions',
     'pagination',
     'postman',
-#    'private_files',
     'markup_mixin',
     'notes',
-#    'jquery',
     'timezones',
-    'jqchat',
-#    'follow',
     'googletools',
-    # 'telecaster',
+    'jqchat',
     'tinymce',
-    'mezzanine',
-    "mezzanine.boot",
-    "mezzanine.conf",
-    "mezzanine.core",
-    "mezzanine.generic",
-    "mezzanine.blog",
-    "mezzanine.forms",
-    "mezzanine.pages",
-    "mezzanine.blog",
+    'telemeta',
+    'teleforma',
+    # 'telecaster',
+    'forms_builder.forms',
 
 )
 
+# List of processors used by RequestContext to populate the context.
+# Each one should be a callable that takes the request object as its
+# only parameter and returns a dictionary to add to the context.
 TEMPLATE_CONTEXT_PROCESSORS = (
-    'django.core.context_processors.request',
-    'django.contrib.auth.context_processors.auth',
-    'postman.context_processors.inbox',
+    "django.contrib.auth.context_processors.auth",
+    "django.contrib.messages.context_processors.messages",
+    "django.core.context_processors.debug",
     "django.core.context_processors.i18n",
+    "django.core.context_processors.static",
     "django.core.context_processors.media",
-    'django.core.context_processors.static',
-    'mezzanine.conf.context_processors.settings',
+    "django.core.context_processors.request",
+    "django.core.context_processors.tz",
+    "mezzanine.conf.context_processors.settings",
+    "teleforma.context_processors.all_seminars",
+    "teleforma.context_processors.total_progress",
+    'postman.context_processors.inbox',
+)
+
+TEMPLATE_DIRS = (
+    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+    # Always use forward slashes, even on Windows.
+    # Don't forget to use absolute paths, not relative paths.
+    '/home/momo/dev/teleforma/teleforma/teleforma/templates/',
 )
 
-TELEMETA_ORGANIZATION = 'Pre-Barreau - CRFPA'
+# List of middleware classes to use. Order is important; in the request phase,
+# these middleware classes will be applied in the order given, and in the
+# response phase the middleware will be applied in reverse order.
+MIDDLEWARE_CLASSES = (
+    "mezzanine.core.middleware.UpdateCacheMiddleware",
+    "django.contrib.sessions.middleware.SessionMiddleware",
+    "django.contrib.auth.middleware.AuthenticationMiddleware",
+    "django.contrib.redirects.middleware.RedirectFallbackMiddleware",
+    "django.middleware.common.CommonMiddleware",
+    "django.middleware.csrf.CsrfViewMiddleware",
+    "django.contrib.messages.middleware.MessageMiddleware",
+    "mezzanine.core.request.CurrentRequestMiddleware",
+    "mezzanine.core.middleware.TemplateForDeviceMiddleware",
+    "mezzanine.core.middleware.TemplateForHostMiddleware",
+    "mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware",
+    # Uncomment the following if using any of the SSL settings:
+    # "mezzanine.core.middleware.SSLRedirectMiddleware",
+    "mezzanine.pages.middleware.PageMiddleware",
+    "mezzanine.core.middleware.FetchFromCacheMiddleware",
+    'django.middleware.transaction.TransactionMiddleware',
+    'pagination.middleware.PaginationMiddleware',
+)
+
+# Store these package names here as they may change in the future since
+# at the moment we are using custom forks of them.
+PACKAGE_NAME_FILEBROWSER = "filebrowser_safe"
+PACKAGE_NAME_GRAPPELLI = "grappelli_safe"
+
+
+#########################
+# OPTIONAL APPLICATIONS #
+#########################
+
+# These will be added to ``INSTALLED_APPS``, only if available.
+OPTIONAL_APPS = (
+    "debug_toolbar",
+    "django_extensions",
+    "compressor",
+    PACKAGE_NAME_FILEBROWSER,
+    # PACKAGE_NAME_GRAPPELLI,
+)
+
+DEBUG_TOOLBAR_CONFIG = {"INTERCEPT_REDIRECTS": False}
+
+###################
+# DEPLOY SETTINGS #
+###################
+
+# These settings are used by the default fabfile.py provided.
+# Check fabfile.py for defaults.
+
+# FABRIC = {
+#     "SSH_USER": "", # SSH username
+#     "SSH_PASS":  "", # SSH password (consider key-based authentication)
+#     "SSH_KEY_PATH":  "", # Local path to SSH key file, for key-based auth
+#     "HOSTS": [], # List of hosts to deploy to
+#     "VIRTUALENV_HOME":  "", # Absolute remote path for virtualenvs
+#     "PROJECT_NAME": "", # Unique identifier for project
+#     "REQUIREMENTS_PATH": "", # Path to pip requirements, relative to project
+#     "GUNICORN_PORT": 8000, # Port gunicorn will listen on
+#     "LOCALE": "en_US.UTF-8", # Should end with ".UTF-8"
+#     "LIVE_HOSTNAME": "www.example.com", # Host for public site.
+#     "REPO_URL": "", # Git or Mercurial remote repo URL for the project
+#     "DB_PASS": "", # Live database password
+#     "ADMIN_PASS": "", # Live admin user password
+# }
+
+
+##################
+# LOCAL SETTINGS #
+##################
+
+# Allow any settings to be defined in local_settings.py which should be
+# ignored in your version control system allowing for settings to be
+# defined per machine.
+try:
+    from local_settings import *
+except ImportError:
+    pass
+
+
+####################
+# DYNAMIC SETTINGS #
+####################
+
+# set_dynamic_settings() will rewrite globals based on what has been
+# defined so far, in order to provide some better defaults where
+# applicable. We also allow this settings module to be imported
+# without Mezzanine installed, as the case may be when using the
+# fabfile, where setting the dynamic settings below isn't strictly
+# required.
+try:
+    from mezzanine.utils.conf import set_dynamic_settings
+except ImportError:
+    pass
+else:
+    set_dynamic_settings(globals())
+
+
+TELEMETA_ORGANIZATION = 'Pro-Barreau'
 TELEMETA_SUBJECTS = ('test', 'telemeta', 'sandbox')
 TELEMETA_DESCRIPTION = "Telemeta TEST sandbox"
 TELEMETA_GMAP_KEY = 'ABQIAAAArg7eSfnfTkBRma8glnGrlxRVbMrhnNNvToCbZQtWdaMbZTA_3RRGObu5PDoiBImgalVnnLU2yN4RMA'
@@ -202,7 +421,7 @@ TELEMETA_DATA_CACHE_DIR = TELEMETA_CACHE_DIR + "/data"
 
 TELEMETA_DOWNLOAD_ENABLED = True
 TELEMETA_STREAMING_FORMATS = ('mp3', 'webm')
-TELEMETA_DOWNLOAD_FORMATS = ('wav', 'mp3', 'webm')
+TELEMETA_DOWNLOAD_FORMATS = ('wav', 'ogg', 'webm')
 TELEMETA_PUBLIC_ACCESS_PERIOD = 51
 TELEMETA_DEFAULT_GRAPHER_SIZES = ['360x130', '640x130']
 TELEMETA_DEFAULT_GRAPHER_ID = 'waveform_contour_wh'
@@ -212,9 +431,10 @@ LOGIN_URL = '/login/'
 LOGIN_REDIRECT_URL = reverse_lazy('teleforma-desk')
 SESSION_EXPIRE_AT_BROWSER_CLOSE = False
 
-EMAIL_HOST = 'smtp.numericable.fr'
+EMAIL_HOST = 'localhost'
 DEFAULT_FROM_EMAIL = 'webmaster@parisson.com'
 SERVER_EMAIL = 'webmaster@parisson.com'
+ADMIN_USERNAME = 'admin'
 EMAIL_SUBJECT_PREFIX = '[' + TELEMETA_ORGANIZATION.decode('utf8') + '] '
 
 POSTMAN_AUTO_MODERATE_AS = True
@@ -235,26 +455,6 @@ TINYMCE_DEFAULT_CONFIG = {
     'custom_undo_redo_levels': 10,
 }
 
-#############
-# MEZZANINE #
-#############
-
-PACKAGE_NAME_FILEBROWSER = 'filebrowser_safe'
-
-####################
-# DYNAMIC SETTINGS #
-####################
-
-# set_dynamic_settings() will rewrite globals based on what has been
-# defined so far, in order to provide some better defaults where
-# applicable. We also allow this settings module to be imported
-# without Mezzanine installed, as the case may be when using the
-# fabfile, where setting the dynamic settings below isn't strictly
-# required.
-try:
-    from mezzanine.utils.conf import set_dynamic_settings
-except ImportError:
-    pass
-else:
-    set_dynamic_settings(globals())
-
+FORMS_LABEL_MAX_LENGTH = 1024
+FORMS_FIELD_MAX_LENGTH = 255
+FORMS_BUILDER_USE_SITES = False
\ No newline at end of file
index 8bacff02afee8de78cbbb8c62f6efe946c062c13..9421876a30521e35303cf502b6f9b20b0f554d5b 100644 (file)
-# -*- coding: utf-8 -*-
-from django.conf.urls.defaults import *
 
-# Uncomment the next two lines to enable the admin:
+from django.conf.urls.defaults import patterns, include, url
 from django.contrib import admin
-admin.autodiscover()
+
+from mezzanine.core.views import direct_to_template
 
 js_info_dict = {
-    'packages': ('telemeta','telecaster'),
+    'packages': ('telemeta', 'teleforma'),
 }
 
-urlpatterns = patterns('',
-    # Example:
-    # (r'^sandbox/', include('sandbox.foo.urls')),
 
-    # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
-    # to INSTALLED_APPS to enable admin documentation:
-    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
-    url(r'^admin/django/', include(admin.site.urls)),
+admin.autodiscover()
+
+# Add the urlpatterns for any custom Django applications here.
+# You can also change the ``home`` view to add your own functionality
+# to the project's homepage.
+
+urlpatterns = patterns("",
+
+    # Change the admin prefix here to use an alternate URL for the
+    # admin interface, which would be marginally more secure.
+    ("^admin/django/", include(admin.site.urls)),
+
+    # We don't want to presume how your homepage works, so here are a
+    # few patterns you can use to set it up.
+
+    # HOMEPAGE AS STATIC TEMPLATE
+    # ---------------------------
+    # This pattern simply loads the index.html template. It isn't
+    # commented out like the others, so it's the default. You only need
+    # one homepage pattern, so if you use a different one, comment this
+    # one out.
+
+    # url("^$", direct_to_template, {"template": "index.html"}, name="home"),
 
-    # TeleForma
-    (r'^', include('teleforma.urls')),
-    (r'^telecaster/', include('telecaster.urls')),
+    # HOMEPAGE AS AN EDITABLE PAGE IN THE PAGE TREE
+    # ---------------------------------------------
+    # This pattern gives us a normal ``Page`` object, so that your
+    # homepage can be managed via the page tree in the admin. If you
+    # use this pattern, you'll need to create a page in the page tree,
+    # and specify its URL (in the Meta Data section) as "/", which
+    # is the value used below in the ``{"slug": "/"}`` part. Make
+    # sure to uncheck "show in navigation" when you create the page,
+    # since the link to the homepage is always hard-coded into all the
+    # page menus that display navigation on the site. Also note that
+    # the normal rule of adding a custom template per page with the
+    # template name using the page's slug doesn't apply here, since
+    # we can't have a template called "/.html" - so for this case, the
+    # template "pages/index.html" can be used.
+
+    # url("^$", "mezzanine.pages.views.page", {"slug": "/"}, name="home"),
+
+    # HOMEPAGE FOR A BLOG-ONLY SITE
+    # -----------------------------
+    # This pattern points the homepage to the blog post listing page,
+    # and is useful for sites that are primarily blogs. If you use this
+    # pattern, you'll also need to set BLOG_SLUG = "" in your
+    # ``settings.py`` module, and delete the blog page object from the
+    # page tree in the admin if it was installed.
+
+    # url("^$", "mezzanine.blog.views.blog_post_list", name="home"),
+
+    # MEZZANINE'S URLS
+    # ----------------
+    # ADD YOUR OWN URLPATTERNS *ABOVE* THE LINE BELOW.
+    # ``mezzanine.urls`` INCLUDES A *CATCH ALL* PATTERN
+    # FOR PAGES, SO URLPATTERNS ADDED BELOW ``mezzanine.urls``
+    # WILL NEVER BE MATCHED!
+
+    # If you'd like more granular control over the patterns in
+    # ``mezzanine.urls``, go right ahead and take the parts you want
+    # from it, and use them directly below instead of using
+    # ``mezzanine.urls``.
+    ("^mezzanine/", include("mezzanine.urls")),
+
+    # MOUNTING MEZZANINE UNDER A PREFIX
+    # ---------------------------------
+    # You can also mount all of Mezzanine's urlpatterns under a
+    # URL prefix if desired. When doing this, you need to define the
+    # ``SITE_PREFIX`` setting, which will contain the prefix. Eg:
+    # SITE_PREFIX = "my/site/prefix"
+    # For convenience, and to avoid repeating the prefix, use the
+    # commented out pattern below (commenting out the one above of course)
+    # which will make use of the ``SITE_PREFIX`` setting. Make sure to
+    # add the import ``from django.conf import settings`` to the top
+    # of this file as well.
+    # Note that for any of the various homepage patterns above, you'll
+    # need to use the ``SITE_PREFIX`` setting as well.
+
+    # ("^%s/" % settings.SITE_PREFIX, include("mezzanine.urls"))
+
+    ('^', include('teleforma.urls')),
 
     # Languages
     (r'^i18n/', include('django.conf.urls.i18n')),
     (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
 
 )
+
+# Adds ``STATIC_URL`` to the context of error pages, so that error
+# pages can use JS, CSS and images.
+handler500 = "mezzanine.core.views.server_error"
index d762a903db958178c7afaf9d184126e062588859..bda0e25aefdb79067985b851e97934613514c49b 100644 (file)
@@ -6,8 +6,19 @@
 
 <div id="module-set-left" style="width: 20%;">
 
+
+<div class="module">
+<h3><img src="{{ STATIC_URL }}telemeta/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% trans "Telephone" %}</h3>
+
+<div style="background: white;">
+<ul>
+<li><b>+33 [0]1 44 35 71 20</b></li>
+</ul>
+</div>
+</div>
+
 <div class="module">
-<h3><img src="{{ STATIC_URL }}telemeta/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% trans "Folders" %}</h3>
+<h3><img src="{{ STATIC_URL }}telemeta/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% trans "Messaging" %}</h3>
 
 <div style="background: white;">
 {% postman_unread as unread_count %}
@@ -22,6 +33,7 @@
 <div class="module_action">
 <a href="{% url postman_write %}" class="component_icon button" id="action_orange">{% trans "New message" %}</a>
 </div>
+
 </div>
 
 {% endblock postman_menu %}
\ No newline at end of file
index ea08e5c493baf5ca7961f6dc2c780bee3b5bbe20..f4d7bfafa3f23b92984666ea6df98e0411e6c832 100644 (file)
@@ -6,28 +6,6 @@
 <div id="postman" class="desk_messages">
 <h1>{% block pm_write_title %}{% endblock %}</h1>
 
-{% if user.student.all or user.is_staff %}
-<div style="padding-top: 0.5em;">
-
-<select id="_adminSelect" name="admins" onchange="update_recipients();">
-<option value="">{% trans "to an administrator" %}</option>
-{% get_all_admins as admins %}
-{% for a in admins %}
-<option value="{{ a.username }}">{{a.first_name}} {{a.last_name}}</option>
-{% endfor %}
-</select>
-
-<select id="_professorSelect" name="professors" onchange="update_recipients();">
-<option value="">{% trans "to a professor" %}</option>
-{% get_all_professors as professors %}
-{% for p in professors %}
-<option value="{{ p.user.username }}">{{p.user.first_name}} {{p.user.last_name}}</option>
-{% endfor %}
-</select>
-
-</div>
-{% endif %}
-
 <div class="write_content">
 <form id="_messageForm" action="{% if next_url %}?next={{ next_url|urlencode }}{% endif %}" method="post">{% csrf_token %}
 <table>
 </div>
 <script type="text/javascript">document.getElementById("id_subject").focus();</script>
 <script type="text/javascript">
-function update_recipients() {
-$("#_professorSelect").click(function () {
-      var htmlStr = $(this).val();
-      $("#id_recipients").val(htmlStr);
-    });
-$("#_adminSelect").click(function () {
-      var htmlStr = $(this).val();
-      $("#id_recipients").val(htmlStr);
+
+$(window).ready(function(){
+      var recipient = '{% admin_username %}';
+      $("#id_recipients").val(recipient);
     });
-}
 
 $('#send_button').click(function() {
   $('#_messageForm').submit();
index 4626eda4a68ee3e4e28378ccc90f2b81462db6d6..d8a600708f665dc3f1d149e8d42fb3696d27fd27 100644 (file)
@@ -45,6 +45,9 @@
 {% endblock %}
 
 {% if reply_to_pk %}<a class="component_icon button icon_next" href="{% url postman_reply reply_to_pk %}?next={{ next_url|urlencode }}">{% trans "Reply" %}</a>{% endif %}
+
+<br /><br />
+
 </form>
 {% if reply_to_pk %}<hr />
 <h2>{% trans 'Reply' %}</h2>
index 881e9d6306d7c3f0b608d8d4c07be8b96d24f392..fb23c2ff4641b338051b085bb79a3e0d984123ba 100644 (file)
@@ -2,6 +2,7 @@
 {% load i18n %}
 {% load telemeta_utils %}
 {% load teleforma_tags %}
+{% load postman_tags %}
 {% get_googletools as googletools %}
 {%  if googletools %}
 {% load googletools %}
@@ -100,7 +101,7 @@ alt="logo" />
 
  {% if user.is_authenticated %}
 
- <li><a href="{% url postman_inbox %}m/" class="orange">{% trans "Messaging" %}{% if postman_unread_count %} ({{ postman_unread_count }}){% endif %}</a></li>
+ <li><a href="{% url postman_inbox %}m/" class="orange">{% trans "Contact us" %}{% if postman_unread_count %} ({{ postman_unread_count }}){% endif %}</a></li>
 
  {% if user.is_staff %}
  <li><a href="{% url teleforma-users %}" class="yellow">{% trans "Users" %}</a></li>
@@ -123,7 +124,6 @@ alt="logo" />
     <ul>
     <li><a href="{% url teleforma-profile-detail user.username %}" class="yellow">{% trans "Profile" %}</a></li>
     {% if user.is_staff %}
-    <li><a href="{% url telemeta-desk-lists %}">{% trans "Lists" %}</a></li>
     <li><a href="{% url teleforma-help %}">{% trans "Help" %}</a></li>
     {% endif %}
     <li><a href="{% url telemeta-logout %}">{% trans "Sign out" %}</a></li>
index 8a170bd2676852c587cfb72eec2e78b057347142..3019bd4c47e3cce660f7a032edafae5e2cf2ec9e 100644 (file)
@@ -268,3 +268,7 @@ def free_first(qs):
         else:
             medias.append(media)
     return medias
+
+@register.simple_tag
+def admin_username():
+    return settings.ADMIN_USERNAME