Page d'accueil + bouton feedback
This commit is contained in:
parent
ea619696dd
commit
3d437624ca
6 changed files with 169 additions and 6 deletions
|
@ -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;
|
||||
|
@ -29,3 +39,24 @@
|
|||
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;
|
||||
}
|
|
@ -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%;
|
||||
}
|
||||
|
@ -257,3 +269,69 @@ 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;
|
||||
}
|
|
@ -6,19 +6,29 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="homeh1">
|
||||
<h1>ExperiENS<span class="beta">beta</span></h1>
|
||||
<p>Partagez vos expériences de stages !</p>
|
||||
</div>
|
||||
<div class="betacadre">
|
||||
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".
|
||||
</div>
|
||||
{% if not user.username %}
|
||||
<div class="entrer">
|
||||
<p><a href="{% url 'monstage:home' %}">Partagez VOTRE expérience</a></p>
|
||||
<p><a href="{% url 'login' %}">Connexion</a></p>
|
||||
<p class="helptext">Connexion via le serveur central d'authentification ENS (identifiants clipper)</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="explications">
|
||||
<p>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 !</p>
|
||||
<p>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 %}<br /><a href="{% url 'monstage:search' %}" class="btn">Rechercher des stages</a>{% endif %}</p>
|
||||
<img src="{% static 'home2.jpg' %}" width="350"/>
|
||||
</div>
|
||||
<div class="explications">
|
||||
<img src="{% static 'home1.jpg' %}" width="350"/>
|
||||
<p>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 !</p>
|
||||
<p>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 %}<br /><a href="{% url 'monstage:home' %}" class="btn">Partager ses stages</a>{% endif %}</p>
|
||||
</div>
|
||||
<div class="footer">Propulsé par Django, <a href="http://evarin.fr" target="_blank">Evarin</a> et Damien</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<title>{% block title %}ExperiENS{% endblock %}</title>
|
||||
<link type="text/css" rel="stylesheet" href="{% static 'style.css' %}" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<script type="text/javascript">function showFeedback(show){document.getElementById("feedback_bg").style.display=show?"table":"none";}</script>
|
||||
{% block extra_head %}{% endblock %}
|
||||
</head>
|
||||
|
||||
|
@ -27,7 +28,29 @@
|
|||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
{% if user.username %}
|
||||
<div id="feedback_bg">
|
||||
<div id="feedback_centrer">
|
||||
<div id="feedback_win">
|
||||
<h2>Envoyer un avis sur le site<a id="feedback_close" href="javascript:showFeedback(false)">X</a></h2>
|
||||
<form method="POST" action="{% url 'monstage:send_feedback' %}?next={{ request.path|urlencode }}">
|
||||
{% csrf_token %}
|
||||
<p>Connecté en tant que {{ user.profil }}</p>
|
||||
<p><label for="id_feedback-message">Commentaire :</label><textarea name="feedback-message" id="id_feedback-message"></textarea></p>
|
||||
<input type="submit" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a id="feedback_btn" href="javascript:showFeedback(true)">
|
||||
Feedback
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<div id="content">
|
||||
{% if request.GET.feedback_sent %}<p class="success">Merci pour votre message !</p>{% endif %}
|
||||
{% if request.GET.feedback_error %}<p class="failure">Erreur lors de l'envoi du message.</p>{% endif %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -15,4 +15,5 @@ urlpatterns = patterns('',
|
|||
url(r'^stage/(?P<stage_id>\d+)/edit/avis/$', views.stage_edit_feedback, name='stage_edit_feedback'),
|
||||
url(r'^stage/(?P<stage_id>\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'),
|
||||
)
|
|
@ -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)
|
Loading…
Reference in a new issue