Skip to content

Commit c1fbe11

Browse files
author
Julien Pivotto
committed
initial commit
0 parents  commit c1fbe11

19 files changed

+437
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pyc

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "media/uni-form"]
2+
path = media/uni-form
3+
url = https://github.com/draganbabic/uni-form.git

askforabooth/__init__.py

Whitespace-only changes.
1.84 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# French translation of the "ask for a booth" app
2+
# Copyright (C) 2013 roidelapluie
3+
# This file is distributed under the same license as the rmll-booth package.
4+
# Julien Pivotto <[email protected]>, 2013.
5+
#
6+
msgid ""
7+
msgstr ""
8+
"Project-Id-Version: 1\n"
9+
"Report-Msgid-Bugs-To: \n"
10+
"POT-Creation-Date: 2013-05-27 17:18-0500\n"
11+
"PO-Revision-Date: 2013-05-27 23:40+0200\n"
12+
"Last-Translator: Julien Pivotto <[email protected]>\n"
13+
"Language: fr\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
18+
19+
#: models.py:7
20+
msgid "Name of the association/group/community"
21+
msgstr "Nom de l'association / groupe / communauté"
22+
23+
#: models.py:8
24+
msgid "Start year of the association/group/community"
25+
msgstr "Année de démarrage de l'association / groupe / communauté"
26+
27+
#: models.py:9
28+
msgid "Objectives and action fields"
29+
msgstr "Objectif(s) et champs d'action"
30+
31+
#: models.py:10
32+
msgid "Number of members"
33+
msgstr "Effectif / Nombre de membres"
34+
35+
#: models.py:11
36+
msgid "City/state"
37+
msgstr "Ville / Région"
38+
39+
#: models.py:12
40+
msgid "Country"
41+
msgstr "Pays"
42+
43+
#: models.py:13
44+
msgid "Email address"
45+
msgstr "Adresse e-mail"
46+
47+
#: models.py:14
48+
msgid "Website"
49+
msgstr "Site internet"
50+
51+
#: models.py:15
52+
msgid "What will you show at the LSM village?"
53+
msgstr "Qu'allez-vous présenter ?"
54+
55+
#: models.py:16
56+
msgid "Which size do you need for yout boost?"
57+
msgstr "Taille du stand souhaitée"
58+
59+
#: models.py:16
60+
msgid "We just want an estimation"
61+
msgstr "Nous voulons juste une estimation"
62+
63+
#: models.py:17
64+
msgid "What will you sell?"
65+
msgstr "Allez-vous vendre des articles ? Si oui, quels types d'articles ? "
66+
67+
#: models.py:17
68+
msgid "GNU/Linux CD-ROM, t-shirts, books, stickers..."
69+
msgstr "T-shirts, livres, CDs de GNU/LInux, ..."
70+
71+
#: models.py:18
72+
msgid "Specific needs"
73+
msgstr "Besoins spéciaux "
74+
75+
#: models.py:18
76+
msgid "You will have WiFi, 220V, table and chairs"
77+
msgstr "Déjà fourni: WiFi, 220V, table et chaises."
78+
79+
#: templates/askforabooth/base.html:7 templates/askforabooth/base.html:31
80+
msgid "Libre Village 2013"
81+
msgstr "Village du Libre 2013"
82+
83+
#: templates/askforabooth/base.html:32
84+
msgid "Apply for a booth"
85+
msgstr "Requête de stand"
86+
87+
#: templates/askforabooth/boothdemand_form.html:9
88+
msgid "Submit"
89+
msgstr "Envoyer"
90+
91+
#: templates/askforabooth/success.html:5
92+
msgid "Thank you"
93+
msgstr "Merci"
94+
95+
#: templates/askforabooth/success.html:6
96+
msgid "We will contact you as soon as possible."
97+
msgstr "Nous vous contacterons aussi vite que possible."
98+
99+
#~ msgid "French"
100+
#~ msgstr "Français"
101+
102+
#~ msgid "English"
103+
#~ msgstr "Anglais"

askforabooth/models.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from django.db import models
2+
from django.utils.translation import ugettext as _
3+
4+
# Create your models here.
5+
6+
class boothDemand(models.Model):
7+
name = models.CharField(_(u'Name of the association/group/community'), max_length=64)
8+
start_date = models.IntegerField(_(u'Start year of the association/group/community'))
9+
objectives = models.TextField(_(u'Objectives and action fields'))
10+
members = models.IntegerField(_(u'Number of members'))
11+
city = models.CharField(_(u'City/state'), max_length=32)
12+
country = models.CharField(_(u'Country'), max_length=32)
13+
mail = models.EmailField(_(u'Email address'))
14+
internet = models.CharField(_(u'Website'), max_length=128)
15+
whattoshow = models.TextField(_(u'What will you show at the LSM village?'))
16+
sizeoftheboost = models.CharField(_(u'Which size do you need for yout boost?'), blank=True, help_text=_('We just want an estimation'), max_length=128)
17+
whattosell = models.TextField(_(u'What will you sell?'), help_text=_('GNU/Linux CD-ROM, t-shirts, books, stickers...'), blank=True)
18+
specific_needs = models.TextField(_(u'Specific needs'), help_text=_('You will have WiFi, 220V, table and chairs'), blank=True)
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{% load i18n %}
2+
<!doctype html>
3+
<html>
4+
<head>
5+
<meta charset="utf-8">
6+
7+
<title>{% trans "Libre Village 2013" %}</title>
8+
9+
<link href="{{MEDIA_URL}}uni-form/css/uni-form.css" media="all" rel="stylesheet"/>
10+
11+
<link href="{{MEDIA_URL}}uni-form/css/default.uni-form.css" media="all" rel="stylesheet"/>
12+
13+
14+
15+
<!-- Script -->
16+
<link rel="stylesheet" href="{{MEDIA_URL}}style.css" type="text/css">
17+
18+
</head>
19+
<body>
20+
21+
<div id="container">
22+
23+
<h1>{% trans "Libre Village 2013" %}</h1>
24+
<h2>{% trans "Apply for a booth" %}</h1>
25+
{% block content %}
26+
{% endblock %}
27+
</div>
28+
</body>
29+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{% extends "askforabooth/base.html" %}
2+
{% load i18n %}
3+
{% load crispy_forms_tags %}
4+
{% block content %}
5+
<form method="post" class="uniForm">
6+
{{ form|crispy }}
7+
<div class="buttonHolder">
8+
<input class="primaryAction" type="submit" value="{% trans "Submit" %}" />
9+
</div>
10+
{% csrf_token %}
11+
</form>
12+
{% endblock %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% extends "askforabooth/base.html" %}
2+
{% load i18n%}
3+
{% load crispy_forms_tags %}
4+
{% block content %}
5+
<h1>{% trans "Thank you" %}</h1>
6+
<p>{%trans "We will contact you as soon as possible." %}</p>
7+
{% endblock %}

askforabooth/tests.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
This file demonstrates writing tests using the unittest module. These will pass
3+
when you run "manage.py test".
4+
5+
Replace this with more appropriate tests for your application.
6+
"""
7+
8+
from django.test import TestCase
9+
10+
11+
class SimpleTest(TestCase):
12+
def test_basic_addition(self):
13+
"""
14+
Tests that 1 + 1 always equals 2.
15+
"""
16+
self.assertEqual(1 + 1, 2)

askforabooth/views.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Create your views here.

booths/__init__.py

Whitespace-only changes.

booths/settings.py

+175
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Django settings for booths project.
2+
3+
DEBUG = True
4+
TEMPLATE_DEBUG = DEBUG
5+
6+
ADMINS = (
7+
# ('Your Name', '[email protected]'),
8+
)
9+
10+
MANAGERS = ADMINS
11+
12+
DATABASES = {
13+
'default': {
14+
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
15+
'NAME': '/tmp/booths.db', # Or path to database file if using sqlite3.
16+
# The following settings are not used with sqlite3:
17+
'USER': '',
18+
'PASSWORD': '',
19+
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
20+
'PORT': '', # Set to empty string for default.
21+
}
22+
}
23+
24+
ugettext = lambda s: s
25+
26+
LANGUAGES = (
27+
('fr', ugettext('French')),
28+
('en', ugettext('English')),
29+
)
30+
31+
# Hosts/domain names that are valid for this site; required if DEBUG is False
32+
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
33+
ALLOWED_HOSTS = []
34+
35+
# Local time zone for this installation. Choices can be found here:
36+
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
37+
# although not all choices may be available on all operating systems.
38+
# In a Windows environment this must be set to your system time zone.
39+
TIME_ZONE = 'America/Chicago'
40+
41+
# Language code for this installation. All choices can be found here:
42+
# http://www.i18nguy.com/unicode/language-identifiers.html
43+
LANGUAGE_CODE = 'en-us'
44+
45+
SITE_ID = 1
46+
47+
# If you set this to False, Django will make some optimizations so as not
48+
# to load the internationalization machinery.
49+
USE_I18N = True
50+
51+
# If you set this to False, Django will not format dates, numbers and
52+
# calendars according to the current locale.
53+
USE_L10N = True
54+
55+
# If you set this to False, Django will not use timezone-aware datetimes.
56+
USE_TZ = True
57+
58+
# Absolute filesystem path to the directory that will hold user-uploaded files.
59+
# Example: "/var/www/example.com/media/"
60+
MEDIA_ROOT = ''
61+
62+
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
63+
# trailing slash.
64+
# Examples: "http://example.com/media/", "http://media.example.com/"
65+
MEDIA_URL = ''
66+
67+
# Absolute path to the directory static files should be collected to.
68+
# Don't put anything in this directory yourself; store your static files
69+
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
70+
# Example: "/var/www/example.com/static/"
71+
STATIC_ROOT = ''
72+
73+
# URL prefix for static files.
74+
# Example: "http://example.com/static/", "http://static.example.com/"
75+
STATIC_URL = '/static/'
76+
77+
# Additional locations of static files
78+
STATICFILES_DIRS = (
79+
# Put strings here, like "/home/html/static" or "C:/www/django/static".
80+
# Always use forward slashes, even on Windows.
81+
# Don't forget to use absolute paths, not relative paths.
82+
)
83+
84+
# List of finder classes that know how to find static files in
85+
# various locations.
86+
STATICFILES_FINDERS = (
87+
'django.contrib.staticfiles.finders.FileSystemFinder',
88+
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
89+
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
90+
)
91+
92+
# Make this unique, and don't share it with anybody.
93+
SECRET_KEY = '3dr3i-h_c-x*2(t8yrco-$bxlg4nz4ey%rgn)_(v5yhm(^4py8'
94+
95+
# List of callables that know how to import templates from various sources.
96+
TEMPLATE_LOADERS = (
97+
'django.template.loaders.filesystem.Loader',
98+
'django.template.loaders.app_directories.Loader',
99+
# 'django.template.loaders.eggs.Loader',
100+
)
101+
102+
MIDDLEWARE_CLASSES = (
103+
'django.middleware.common.CommonMiddleware',
104+
'django.contrib.sessions.middleware.SessionMiddleware',
105+
'django.middleware.locale.LocaleMiddleware',
106+
'django.middleware.csrf.CsrfViewMiddleware',
107+
'django.contrib.auth.middleware.AuthenticationMiddleware',
108+
'django.contrib.messages.middleware.MessageMiddleware',
109+
# Uncomment the next line for simple clickjacking protection:
110+
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
111+
)
112+
113+
114+
115+
ROOT_URLCONF = 'booths.urls'
116+
117+
# Python dotted path to the WSGI application used by Django's runserver.
118+
WSGI_APPLICATION = 'booths.wsgi.application'
119+
120+
TEMPLATE_DIRS = (
121+
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
122+
# Always use forward slashes, even on Windows.
123+
# Don't forget to use absolute paths, not relative paths.
124+
)
125+
126+
INSTALLED_APPS = (
127+
'django.contrib.auth',
128+
'django.contrib.contenttypes',
129+
'django.contrib.sessions',
130+
'django.contrib.sites',
131+
'django.contrib.messages',
132+
'django.contrib.staticfiles',
133+
# Uncomment the next line to enable the admin:
134+
'django.contrib.admin',
135+
# Uncomment the next line to enable admin documentation:
136+
# 'django.contrib.admindocs',
137+
'crispy_forms',
138+
'askforabooth',
139+
)
140+
141+
CRISPY_TEMPLATE_PACK = 'uni_form'
142+
CRISPY_CLASS_CONVERTERS = {'dateinput': "textinput textInput"}
143+
# A sample logging configuration. The only tangible logging
144+
# performed by this configuration is to send an email to
145+
# the site admins on every HTTP 500 error when DEBUG=False.
146+
# See http://docs.djangoproject.com/en/dev/topics/logging for
147+
# more details on how to customize your logging configuration.
148+
LOGGING = {
149+
'version': 1,
150+
'disable_existing_loggers': False,
151+
'filters': {
152+
'require_debug_false': {
153+
'()': 'django.utils.log.RequireDebugFalse'
154+
}
155+
},
156+
'handlers': {
157+
'mail_admins': {
158+
'level': 'ERROR',
159+
'filters': ['require_debug_false'],
160+
'class': 'django.utils.log.AdminEmailHandler'
161+
}
162+
},
163+
'loggers': {
164+
'django.request': {
165+
'handlers': ['mail_admins'],
166+
'level': 'ERROR',
167+
'propagate': True,
168+
},
169+
}
170+
}
171+
172+
try:
173+
from settings_local import *
174+
except ImportError:
175+
pass

booths/urls.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from django.conf.urls import patterns, include, url
2+
from django.core.urlresolvers import reverse
3+
from django.views.generic.edit import CreateView
4+
from django.views.generic import TemplateView
5+
from askforabooth.models import boothDemand
6+
import settings
7+
from django.utils.functional import lazy
8+
reverse_lazy = lambda name=None, *args : lazy(reverse, str)(name, args=args)
9+
# Uncomment the next two lines to enable the admin:
10+
from django.contrib import admin
11+
admin.autodiscover()
12+
13+
urlpatterns = patterns('',
14+
# Examples:
15+
# url(r'^$', 'booths.views.home', name='home'),
16+
url(r'^success$', TemplateView.as_view(template_name="askforabooth/success.html"), name='success'),
17+
url(r'^$', CreateView.as_view(model=boothDemand, success_url=reverse_lazy('success'))),
18+
url(r'^admin/', include(admin.site.urls)),
19+
(r'^i18n/', include('django.conf.urls.i18n')),
20+
(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
21+
)

0 commit comments

Comments
 (0)