diff --git a/monstage/static/index.css b/monstage/static/index.css index 6b51f11..0fa9c9c 100644 --- a/monstage/static/index.css +++ b/monstage/static/index.css @@ -4,7 +4,7 @@ text-align:center; } -.entrer a { +.entrer a, a.btn { display:inline-block; background:#FFA41E; color:#fff; @@ -13,6 +13,16 @@ border-radius:5px; } + a.btn { + display:inline-block; + background:#FFA41E; + color:#fff; + font-size:1.2em; + padding:10px; + margin-top:12px; + border-radius:5px; +} + .explications { background:#348d68; display:table-row; @@ -28,4 +38,25 @@ padding:20px; font-size:1.1em; text-align:center; +} + +.homeh1 p { + float:right; +} + +.homeh1 h1 { + display:inline-block; + margin-bottom:3px; +} + +.homeh1 { + border-bottom:1px solid #888; + overflow:hidden; + margin-bottom:15px; +} + +.betacadre { + background:#bbb; + padding:20px; + margin:20px 0; } \ No newline at end of file diff --git a/monstage/static/style.css b/monstage/static/style.css index 63566f9..9fe6b48 100644 --- a/monstage/static/style.css +++ b/monstage/static/style.css @@ -72,6 +72,14 @@ header .username { font-weight:normal; } +.footer { + clear:both; + font-size:14px; + color:#555; + text-align:right; + margin-top:25px; +} + #content { width:80%; max-width:700px; @@ -112,6 +120,10 @@ form textarea, form input, form select { float:right; } +form textarea { + resize:vertical; +} + form textarea { width:90%; } @@ -256,4 +268,70 @@ ul.bigger li:hover{ .changestage { color:#B8741A; +} + +/* feedback */ + +#feedback_bg { + display:none; + position:fixed; + width:100%; + height:100%; + background:rgba(0,0,0,0.6); + z-index:300; + top:0; + left:0; +} + +#feedback_centrer { + display:table-cell; + vertical-align:middle; + text-align:center; + overflow-y:auto; +} + +#feedback_close { + float:right; +} + +#feedback_win { + text-align:left; + display:inline-block; + padding:0; + max-width:500px; + background:#fff; +} + +#feedback_win h2 { + background:#000; + color:#fff; + padding:20px; + margin-top:0; +} + +#feedback_win textarea { + min-height:150px; +} + +#feedback_btn { + position:fixed; + top:65%; + left:0; + z-index:40; + background:#000; + color:#fff; + padding:20px; + transform:rotate(-90deg); + font-weight:bold; + transform-origin:top left; +} + +.success { + background:#9f9; + padding:5px; +} + +.failure { + padding:5px; + background:#f99; } \ No newline at end of file diff --git a/monstage/templates/monstage/index.html b/monstage/templates/monstage/index.html index 225ab66..bb281d9 100644 --- a/monstage/templates/monstage/index.html +++ b/monstage/templates/monstage/index.html @@ -6,19 +6,29 @@ {% endblock %} {% block content %} -

ExperiENSbeta

-

Partagez vos expériences de stages !

+
+

ExperiENSbeta

+

Partagez vos expériences de stages !

+
+
+ Ce site est en cours de développement, et fait l'objet de mises à jours régulières. N'hésitez pas cependant à remplir une fiche pour vos stages, utiliser la recherche, et donner votre avis en utilisant le bouton "feedback". +
+ {% if not user.username %}
-

Partagez VOTRE expérience

+

Connexion

Connexion via le serveur central d'authentification ENS (identifiants clipper)

+ {% endif %}
-

Ne partez plus en stage en terre inconnue : nourrissez-vous de l'expérience de {{ stats.num_stages }} stages effectués par la communauté normalienne, repérez les bons plans, et ne faites pas les mêmes erreurs !

+

Ne partez plus en stage en terre inconnue : nourrissez-vous de l'expérience de {{ stats.num_stages }} stages effectués par la communauté normalienne, repérez les bons plans, et ne faites pas les mêmes erreurs ! + {% if user.username %}
Rechercher des stages{% endif %}

-

Vous revenez du bout du monde (ou de la rue d'à côté) ? N'attendez plus, rédigez un avis sur votre stage pour que votre expérience profite à d'autres !

+

Vous revenez du bout du monde (ou de la rue d'à côté) ? N'attendez plus, rédigez un avis sur votre stage pour que votre expérience profite à d'autres ! + {% if user.username %}
Partager ses stages{% endif %}

+ {% endblock %} diff --git a/monstage/templates/skeleton.html b/monstage/templates/skeleton.html index ce4c4a5..29c09b1 100644 --- a/monstage/templates/skeleton.html +++ b/monstage/templates/skeleton.html @@ -5,6 +5,7 @@ {% block title %}ExperiENS{% endblock %} + {% block extra_head %}{% endblock %} @@ -27,7 +28,29 @@ + + {% if user.username %} +
+
+
+

Envoyer un avis sur le siteX

+
+ {% csrf_token %} +

Connecté en tant que {{ user.profil }}

+

+ +
+
+
+
+ + Feedback + + {% endif %} +
+ {% if request.GET.feedback_sent %}

Merci pour votre message !

{% endif %} + {% if request.GET.feedback_error %}

Erreur lors de l'envoi du message.

{% endif %} {% block content %}{% endblock %}
diff --git a/monstage/urls.py b/monstage/urls.py index cbfd73f..c4fcfaa 100644 --- a/monstage/urls.py +++ b/monstage/urls.py @@ -15,4 +15,5 @@ urlpatterns = patterns('', url(r'^stage/(?P\d+)/edit/avis/$', views.stage_edit_feedback, name='stage_edit_feedback'), url(r'^stage/(?P\d+)/edit/publish/$', views.stage_publish, name='stage_publish'), url(r'^recherche/$', views.search, name='search'), + url(r'^feedback/send/$', views.send_feedback, name='send_feedback'), ) \ No newline at end of file diff --git a/monstage/views.py b/monstage/views.py index 3d85069..970ae06 100644 --- a/monstage/views.py +++ b/monstage/views.py @@ -5,9 +5,11 @@ from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect, HttpResponse, HttpResponseForbidden, HttpResponseNotFound from django.core.urlresolvers import reverse from django import forms +from django.conf import settings from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis import measure from django.forms.widgets import HiddenInput +from django.core.mail import send_mail from monstage.models import * @@ -317,3 +319,21 @@ def search(request): form = SearchForm() return render(request, 'monstage/search.html', {'form':form, 'resultats':stages}) +# +# Feedback +# + +class FeedbackForm(forms.Form): + message = forms.CharField(label='Commentaire') + +@login_required +def send_feedback(request): + redirection = request.GET.get('next', reverse('monstage:index')) if request.GET else reverse('monstage:index') + if request.POST: + form = FeedbackForm(request.POST, prefix="feedback") + if form.is_valid(): + dests = [ mail for (nom, mail) in settings.ADMINS ] + send_mail('Commentaire à propos d\'experiENS', form.cleaned_data["message"], ("%s@clipper.ens.fr" % (request.user.username,)), dests) + return HttpResponseRedirect(redirection+"?feedback_sent=1") + return HttpResponseRedirect(redirection+"?feedback_error=1") + return HttpResponseRedirect(redirection) \ No newline at end of file