Une page d'accueil
This commit is contained in:
parent
f9fb3561dd
commit
0d043cc28c
8 changed files with 123 additions and 16 deletions
14
monstage/static/index.css
Normal file
14
monstage/static/index.css
Normal file
|
@ -0,0 +1,14 @@
|
|||
@charset "utf-8";
|
||||
|
||||
.entrer {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.entrer a {
|
||||
display:inline-block;
|
||||
background:#4FB088;
|
||||
color:#fff;
|
||||
font-size:1.5em;
|
||||
padding:8px;
|
||||
border-radius:5px;
|
||||
}
|
|
@ -4,6 +4,8 @@
|
|||
body {
|
||||
font: 18px 'Lato', sans-serif;
|
||||
background:#4FB088;
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
a {
|
||||
|
@ -16,11 +18,46 @@ h1 {
|
|||
margin-top:0;
|
||||
}
|
||||
|
||||
.beta {
|
||||
font-size:0.5em;
|
||||
display:inline-block;
|
||||
transform:rotate(-20deg);
|
||||
color:#aaa;
|
||||
}
|
||||
|
||||
header {
|
||||
background:#166142;
|
||||
padding:10px;
|
||||
margin:0;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
header li {
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
float:left;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
header li a {
|
||||
display:inline-block;
|
||||
padding:20px 10px;
|
||||
margin:0 15px;
|
||||
}
|
||||
|
||||
header ul {
|
||||
float:right;
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
#content {
|
||||
width:80%;
|
||||
max-width:700px;
|
||||
padding:30px;
|
||||
margin:0 auto;
|
||||
margin:20px auto;
|
||||
background:#eee;
|
||||
}
|
||||
|
||||
|
|
15
monstage/templates/monstage/home.html
Normal file
15
monstage/templates/monstage/home.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{% extends "skeleton.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Bonjour {{ user.first_name }} !</h1>
|
||||
<p><a href="{% url 'monstage:profil_edit' %}">Modifier mon profil</a></p>
|
||||
<h2>Mes stages</h2>
|
||||
<ul>
|
||||
{% for stage in stages %}
|
||||
<li><a href="{% url 'monstage:stage' stage.id %}">{{ stage.sujet }}</a></li>
|
||||
{% endfor %}
|
||||
<li><a href="{% url 'monstage:stage_add' %}">Ajouter un stage</a></li>
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -1,15 +1,22 @@
|
|||
{% extends "skeleton.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Bonjour {{ user.first_name }} !</h1>
|
||||
<p><a href="{% url 'monstage:profil_edit' %}">Modifier mon profil</a></p>
|
||||
<h2>Mes stages</h2>
|
||||
<ul>
|
||||
{% for stage in stages %}
|
||||
<li><a href="{% url 'monstage:stage' stage.id %}">{{ stage.sujet }}</a></li>
|
||||
{% endfor %}
|
||||
<li><a href="{% url 'monstage:stage_add' %}">Ajouter un stage</a></li>
|
||||
</ul>
|
||||
|
||||
{% block extra_head %}
|
||||
<link type="text/css" href="{% static 'index.css' %}" rel="stylesheet" />
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>ExperiENS<span class="beta">beta</span></h1>
|
||||
<p>Partagez vos expériences de stages !</p>
|
||||
<div class="entrer">
|
||||
<p><a href="{% url 'monstage:home' %}">Partagez VOTRE expérience</a></p>
|
||||
<p class="helptext">Connexion via le serveur central d'authentification ENS (identifiants clipper)</p>
|
||||
</div>
|
||||
<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 et ne faites pas les mêmes erreurs !</p>
|
||||
</div>
|
||||
<div class="explications">
|
||||
<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 nourrir que votre expérience profite à d'autres !</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
9
monstage/templates/monstage/search.html
Normal file
9
monstage/templates/monstage/search.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% extends "skeleton.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<p><a href="{% url 'monstage:index' %}">Retour</a></p>
|
||||
<h1>Recherche</h1>
|
||||
<p>La recherche de stage n'est pas encore disponible. Elle devrait l'être à la rentrée 2015 !</p>
|
||||
{% endblock %}
|
||||
|
|
@ -9,6 +9,17 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1>ExperiENS<span class='beta'>beta</span></h1>
|
||||
|
||||
<nav>
|
||||
<ul id="menu">
|
||||
<li><a href="{% url 'monstage:index' %}">Accueil</a></li>
|
||||
<li><a href="{% url 'monstage:home' %}">Mon expérience</a></li>
|
||||
<li><a href="{% url 'monstage:search' %}">Recherche</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<div id="content">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,7 @@ from monstage import views
|
|||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^$', views.index, name='index'),
|
||||
url(r'^home/$', views.home, name='home'),
|
||||
url(r'^profil/show/(?P<profil_id>\w+)/$', views.profil, name='profil'),
|
||||
url(r'^profil/edit/$', views.profil_edit, name='profil_edit'),
|
||||
url(r'^api/lieux/candidats/$', views.lieux_candidats, name='lieux_candidats'),
|
||||
|
@ -12,4 +13,5 @@ urlpatterns = patterns('',
|
|||
url(r'^stage/(?P<stage_id>\d+)/edit/description/$', views.stage_edit_desc, name='stage_edit_desc'),
|
||||
url(r'^stage/(?P<stage_id>\d+)/edit/lieu/$', views.stage_edit_lieu, name='stage_edit_lieu'),
|
||||
url(r'^stage/(?P<stage_id>\d+)/edit/avis/$', views.stage_edit_feedback, name='stage_edit_feedback'),
|
||||
url(r'^recherche/$', views.search, name='search'),
|
||||
)
|
|
@ -15,10 +15,14 @@ def addslashes(s):
|
|||
d = {'"':'\\"', "'":"\\'", "\0":"\\\0", "\\":"\\\\", '\n':'\\n'}
|
||||
return ''.join(d.get(c, c) for c in s)
|
||||
|
||||
@login_required
|
||||
def index(request):
|
||||
stages = Stage.objects.filter( profil_user = request.user.profil )
|
||||
return render(request, 'monstage/index.html', {"stages" : stages})
|
||||
stats = { 'num_stages': Stage.objects.count() }
|
||||
return render(request, 'monstage/index.html', {'stats': stats})
|
||||
|
||||
@login_required
|
||||
def home(request):
|
||||
stages = request.user.profil.stages.all()
|
||||
return render(request, 'monstage/home.html', {"stages" : stages})
|
||||
|
||||
#
|
||||
# Utilisateurs et profils
|
||||
|
@ -238,4 +242,12 @@ def stage_edit_feedback(request, stage_id):
|
|||
|
||||
def detail(request, question_id):
|
||||
question = get_object_or_404(Question, pk=question_id)
|
||||
return render(request, 'monstage/detail.html', {'question': question})
|
||||
return render(request, 'monstage/detail.html', {'question': question})
|
||||
|
||||
|
||||
#
|
||||
# Recherche de stages
|
||||
#
|
||||
|
||||
def search(request):
|
||||
return render(request, 'monstage/search.html')
|
Loading…
Reference in a new issue