diff --git a/.gitignore b/.gitignore index ea4dad6..8db636a 100644 --- a/.gitignore +++ b/.gitignore @@ -101,3 +101,6 @@ $RECYCLE.BIN/ *.lnk tpathtxt test.py + +# Migrations +monstage/migrations/ \ No newline at end of file diff --git a/experiENS/settings.py b/experiENS/settings.py index d3155e7..9b18e5b 100644 --- a/experiENS/settings.py +++ b/experiENS/settings.py @@ -64,9 +64,12 @@ WSGI_APPLICATION = 'experiENS.wsgi.application' CAS_SERVER_URL = "https://cas.eleves.ens.fr/" #SPI CAS CAS_VERIFY_URL = "https://cas.eleves.ens.fr/" CAS_IGNORE_REFERER = True -CAS_REDIRECT_URL = '/profil/' +CAS_REDIRECT_URL = '/home/' CAS_EMAIL_FORMAT = "%s@clipper.ens.fr" +LOGIN_URL = '/login/' +LOGOUT_URL = '/logout/' + # Database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases diff --git a/experiENS/urls.py b/experiENS/urls.py index e999bd8..d43a155 100644 --- a/experiENS/urls.py +++ b/experiENS/urls.py @@ -3,7 +3,7 @@ from django.contrib import admin urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), - url(r'^login/$', 'django_cas.views.login', name = "cas_login_view"), - url(r'^logout/$', 'django_cas.views.logout'), + url(r'^login/$', 'django_cas.views.login', name = "login"), + url(r'^logout/$', 'django_cas.views.logout', name = "logout"), url(r'^', include('monstage.urls', namespace="monstage")), ) diff --git a/monstage/static/style.css b/monstage/static/style.css index 5208891..5752861 100644 --- a/monstage/static/style.css +++ b/monstage/static/style.css @@ -30,10 +30,13 @@ header { padding:10px; margin:0; overflow:hidden; + color:#fff; } header li { display:inline-block; + text-align:center; + vertical-align:middle; } header h1 { @@ -41,10 +44,20 @@ header h1 { color:#fff; } +header h1 a { + color:#fff; + text-decoration:none; +} + header li a { display:inline-block; - padding:20px 10px; - margin:0 15px; + padding:20px 20px; + margin:0 5px; +} + +header li a:hover { + background:#4FB088; + color:#166142; } header ul { @@ -53,6 +66,11 @@ header ul { margin:0; } +header .username { + color:#fff; + font-weight:normal; +} + #content { width:80%; max-width:700px; diff --git a/monstage/templates/monstage/forbidden.html b/monstage/templates/monstage/forbidden.html index 1278970..87f8ba4 100644 --- a/monstage/templates/monstage/forbidden.html +++ b/monstage/templates/monstage/forbidden.html @@ -10,5 +10,6 @@ {% if unpublished %}

Le stage n'est pas encore publié

{% elif notowned %}

Ce stage ne vous appartient pas, vous ne pouvez pas le modifier

{% else %}

L'accès à ce contenu est interdit

+ {% endif %} {% endblock %} diff --git a/monstage/templates/skeleton.html b/monstage/templates/skeleton.html index b33d567..ce4c4a5 100644 --- a/monstage/templates/skeleton.html +++ b/monstage/templates/skeleton.html @@ -10,13 +10,20 @@
-

ExperiENSbeta

+

ExperiENSbeta

diff --git a/monstage/views.py b/monstage/views.py index 1e0de06..e957eaa 100644 --- a/monstage/views.py +++ b/monstage/views.py @@ -279,7 +279,7 @@ class SearchForm(forms.Form): tolerance = forms.DecimalField(label='Dans un rayon de (en km) :', initial=100, required=False) lieu = forms.CharField(label=u'A proximité de :', required=False) - +@login_required def search(request): stages = None if request.GET: @@ -288,7 +288,7 @@ def search(request): lon = form.cleaned_data['longitude'] lat = form.cleaned_data['latitude'] lieu = form.cleaned_data['lieu'] - stages = Stage.objects + stages = Stage.objects.filter(published=True) if lat and lon and lieu: coords = GEOSGeometry('POINT(%f %f)' % (lon, lat), srid=4326) distance = {'km': form.cleaned_data['tolerance']}