Bugs et ergonomie
This commit is contained in:
parent
dbcf4056b7
commit
dd30ef0c66
7 changed files with 40 additions and 8 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -101,3 +101,6 @@ $RECYCLE.BIN/
|
||||||
*.lnk
|
*.lnk
|
||||||
tpathtxt
|
tpathtxt
|
||||||
test.py
|
test.py
|
||||||
|
|
||||||
|
# Migrations
|
||||||
|
monstage/migrations/
|
|
@ -64,9 +64,12 @@ WSGI_APPLICATION = 'experiENS.wsgi.application'
|
||||||
CAS_SERVER_URL = "https://cas.eleves.ens.fr/" #SPI CAS
|
CAS_SERVER_URL = "https://cas.eleves.ens.fr/" #SPI CAS
|
||||||
CAS_VERIFY_URL = "https://cas.eleves.ens.fr/"
|
CAS_VERIFY_URL = "https://cas.eleves.ens.fr/"
|
||||||
CAS_IGNORE_REFERER = True
|
CAS_IGNORE_REFERER = True
|
||||||
CAS_REDIRECT_URL = '/profil/'
|
CAS_REDIRECT_URL = '/home/'
|
||||||
CAS_EMAIL_FORMAT = "%s@clipper.ens.fr"
|
CAS_EMAIL_FORMAT = "%s@clipper.ens.fr"
|
||||||
|
|
||||||
|
LOGIN_URL = '/login/'
|
||||||
|
LOGOUT_URL = '/logout/'
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
|
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ from django.contrib import admin
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
url(r'^admin/', include(admin.site.urls)),
|
url(r'^admin/', include(admin.site.urls)),
|
||||||
url(r'^login/$', 'django_cas.views.login', name = "cas_login_view"),
|
url(r'^login/$', 'django_cas.views.login', name = "login"),
|
||||||
url(r'^logout/$', 'django_cas.views.logout'),
|
url(r'^logout/$', 'django_cas.views.logout', name = "logout"),
|
||||||
url(r'^', include('monstage.urls', namespace="monstage")),
|
url(r'^', include('monstage.urls', namespace="monstage")),
|
||||||
)
|
)
|
||||||
|
|
|
@ -30,10 +30,13 @@ header {
|
||||||
padding:10px;
|
padding:10px;
|
||||||
margin:0;
|
margin:0;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
|
color:#fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
header li {
|
header li {
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
|
text-align:center;
|
||||||
|
vertical-align:middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
header h1 {
|
header h1 {
|
||||||
|
@ -41,10 +44,20 @@ header h1 {
|
||||||
color:#fff;
|
color:#fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header h1 a {
|
||||||
|
color:#fff;
|
||||||
|
text-decoration:none;
|
||||||
|
}
|
||||||
|
|
||||||
header li a {
|
header li a {
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
padding:20px 10px;
|
padding:20px 20px;
|
||||||
margin:0 15px;
|
margin:0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header li a:hover {
|
||||||
|
background:#4FB088;
|
||||||
|
color:#166142;
|
||||||
}
|
}
|
||||||
|
|
||||||
header ul {
|
header ul {
|
||||||
|
@ -53,6 +66,11 @@ header ul {
|
||||||
margin:0;
|
margin:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header .username {
|
||||||
|
color:#fff;
|
||||||
|
font-weight:normal;
|
||||||
|
}
|
||||||
|
|
||||||
#content {
|
#content {
|
||||||
width:80%;
|
width:80%;
|
||||||
max-width:700px;
|
max-width:700px;
|
||||||
|
|
|
@ -10,5 +10,6 @@
|
||||||
{% if unpublished %}<p>Le stage n'est pas encore publié</p>
|
{% if unpublished %}<p>Le stage n'est pas encore publié</p>
|
||||||
{% elif notowned %}<p>Ce stage ne vous appartient pas, vous ne pouvez pas le modifier</p>
|
{% elif notowned %}<p>Ce stage ne vous appartient pas, vous ne pouvez pas le modifier</p>
|
||||||
{% else %}<p>L'accès à ce contenu est interdit</p>
|
{% else %}<p>L'accès à ce contenu est interdit</p>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -10,13 +10,20 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<h1>ExperiENS<span class='beta'>beta</span></h1>
|
<h1><a href="{% url 'monstage:index' %}">ExperiENS<span class='beta'>beta</span></a></h1>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<ul id="menu">
|
<ul id="menu">
|
||||||
<li><a href="{% url 'monstage:index' %}">Accueil</a></li>
|
<li><a href="{% url 'monstage:index' %}">Accueil</a></li>
|
||||||
|
{% if user.username %}
|
||||||
<li><a href="{% url 'monstage:home' %}">Mon expérience</a></li>
|
<li><a href="{% url 'monstage:home' %}">Mon expérience</a></li>
|
||||||
<li><a href="{% url 'monstage:search' %}">Recherche</a></li>
|
<li><a href="{% url 'monstage:search' %}">Recherche</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if user.is_staff %}
|
||||||
|
<li><a href="{% url 'admin:index' %}">Administration</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if user.username %}<li><a href="{% url 'logout' %}"><span class="username">{{ user.username }}</span><br/> Déconnexion</a></li>
|
||||||
|
{% else %}<li><a href="{% url 'login' %}">Connexion</a></li>{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -279,7 +279,7 @@ class SearchForm(forms.Form):
|
||||||
tolerance = forms.DecimalField(label='Dans un rayon de (en km) :', initial=100, required=False)
|
tolerance = forms.DecimalField(label='Dans un rayon de (en km) :', initial=100, required=False)
|
||||||
lieu = forms.CharField(label=u'A proximité de :', required=False)
|
lieu = forms.CharField(label=u'A proximité de :', required=False)
|
||||||
|
|
||||||
|
@login_required
|
||||||
def search(request):
|
def search(request):
|
||||||
stages = None
|
stages = None
|
||||||
if request.GET:
|
if request.GET:
|
||||||
|
@ -288,7 +288,7 @@ def search(request):
|
||||||
lon = form.cleaned_data['longitude']
|
lon = form.cleaned_data['longitude']
|
||||||
lat = form.cleaned_data['latitude']
|
lat = form.cleaned_data['latitude']
|
||||||
lieu = form.cleaned_data['lieu']
|
lieu = form.cleaned_data['lieu']
|
||||||
stages = Stage.objects
|
stages = Stage.objects.filter(published=True)
|
||||||
if lat and lon and lieu:
|
if lat and lon and lieu:
|
||||||
coords = GEOSGeometry('POINT(%f %f)' % (lon, lat), srid=4326)
|
coords = GEOSGeometry('POINT(%f %f)' % (lon, lat), srid=4326)
|
||||||
distance = {'km': form.cleaned_data['tolerance']}
|
distance = {'km': form.cleaned_data['tolerance']}
|
||||||
|
|
Loading…
Reference in a new issue