diff --git a/.gitignore b/.gitignore index 1fabe2f..d584ab1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,12 @@ 1y1b/views.py 1y1b/views.py 1y1b/views.py + +bin/* +django/* +include/* +lib/* +build/* +local/* + +*.sql \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..4516a76 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +Requirements +=== +Python >= 2.7.6 +Django 1.5.2 + + +Comment installer le portail sur votre ordinateur +=== + +* Installer pip +* Installer git +* Installer Virtualenv (*pip install virtualenv*) +* Aller dans le dossier où vous voulez installer le portail +* Créer un virtual (virtualenv env/) +* Se mettre sur le virtualenv en question (source env/bin/activate) + +* Une fois tout cela fait, se créer un compte sur github.com +* Forker le portail (https://github.com/ensmp/portail) +* Cloner le dépôt (git clone https://github.com/ensmp/portail) + +* Installer les requirements (pip install -r requirements.txt) +* Ajouter toutes les autres dépendances (MysqlDb, Pillow, etc.) \ No newline at end of file diff --git a/machines/views.py b/machines/views.py index 9d1c675..50516f3 100644 --- a/machines/views.py +++ b/machines/views.py @@ -11,7 +11,13 @@ from urllib import urlretrieve import subprocess import vobject -import Image +try: + import Image +except ImportError: + try: + from PIL import Image + except ImportError: + raise ImportError("The Python Imaging Library was not found.") import json import os from machines.models import MachineProfile diff --git a/public/static/css/trombi.css b/public/static/css/trombi.css index 4c6dd4f..a5dcc0e 100644 --- a/public/static/css/trombi.css +++ b/public/static/css/trombi.css @@ -70,4 +70,25 @@ li.portrait img { h1.promo { font-size:30pt; text-align:center; +} + +p#fleches_profils { + display:block; + width:100%; + margin-bottom:0px; + height:55px; +} + +.fleche_gauche { + float:left; + display:block; +} + +.fleche_droite { + float:right; + display:block; +} + +.fleche_minimisee { + height:50px; } \ No newline at end of file diff --git a/public/static/img/left_arrow.png b/public/static/img/left_arrow.png new file mode 100644 index 0000000..28dc31b Binary files /dev/null and b/public/static/img/left_arrow.png differ diff --git a/public/static/img/right_arrow.png b/public/static/img/right_arrow.png new file mode 100644 index 0000000..1c1992c Binary files /dev/null and b/public/static/img/right_arrow.png differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..4239363 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,11 @@ +Django==1.5.2 +MySQL-python==1.2.5 +Pillow==3.1.1 +argparse==1.2.1 +beautifulsoup4==4.4.1 +bs4==0.0.1 +pycrypto==2.6.1 +python-dateutil==2.5.0 +six==1.10.0 +vobject==0.9.1 +wsgiref==0.1.2 diff --git a/templates/trombi/detail.html b/templates/trombi/detail.html index dcf49b2..ee0725d 100644 --- a/templates/trombi/detail.html +++ b/templates/trombi/detail.html @@ -7,6 +7,11 @@ {% block content %} {% load avatar_tags %} +

+ + +

+
@@ -110,4 +115,17 @@

{{ mineur.get_profile.first_name }} {% if mineur.get_profile.surnom %}"{{ mi {% endif %} + + {% endblock %} diff --git a/trombi/views.py b/trombi/views.py index ada1f8b..f9a0b64 100644 --- a/trombi/views.py +++ b/trombi/views.py @@ -16,7 +16,13 @@ from django.views.generic import CreateView, UpdateView, DeleteView import subprocess import vobject -import Image +try: + import Image +except ImportError: + try: + from PIL import Image + except ImportError: + raise ImportError("The Python Imaging Library was not found.") import json import os from settings import SECRET_KEY_UPDATE @@ -47,12 +53,17 @@ def trombi_json(request): def detail(request, mineur_login): """Page de profil d'un élève""" mineur = get_object_or_404(UserProfile, user__username = mineur_login) + + mineurs_promo = UserProfile.objects.filter(promo=mineur.promo) + mineur_apres = mineurs_promo.filter(user__username__gt=mineur_login)[0] + mineur_avant = mineurs_promo.filter(user__username__lt=mineur_login).order_by('-user__username')[0] + assoces = Adhesion.objects.filter(eleve = mineur) if request.user.get_profile().en_premiere_annee(): assoces = assoces.exclude(association__is_hidden_1A = True) liste_questions = Question.objects.all() liste_reponses = mineur.reponses.all() - return render_to_response('trombi/detail.html', {'mineur': mineur.user, 'assoces': assoces, 'liste_questions': liste_questions, 'liste_reponses': liste_reponses},context_instance=RequestContext(request)) + return render_to_response('trombi/detail.html', {'mineur': mineur.user, 'assoces': assoces, 'liste_questions': liste_questions, 'liste_reponses': liste_reponses, 'mineur_apres': mineur_apres, 'mineur_avant': mineur_avant},context_instance=RequestContext(request)) @login_required def detail_json(request, mineur_login): diff --git a/trombiassos/views.py b/trombiassos/views.py index cf6e69c..a0b908c 100644 --- a/trombiassos/views.py +++ b/trombiassos/views.py @@ -17,7 +17,13 @@ from django.views.generic import CreateView, UpdateView, DeleteView import subprocess import vobject -import Image +try: + import Image +except ImportError: + try: + from PIL import Image + except ImportError: + raise ImportError("The Python Imaging Library was not found.") import json import os from settings import SECRET_KEY_UPDATE