Début des templates
This commit is contained in:
parent
a0df71fcc4
commit
1cd72e4afb
15 changed files with 486 additions and 10 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -108,4 +108,5 @@ migrations/
|
|||
*~
|
||||
\#*
|
||||
.#*
|
||||
*.sqlite3
|
||||
*.sqlite3
|
||||
.sass-cache
|
25
avisstage/config.rb
Normal file
25
avisstage/config.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
require 'compass/import-once/activate'
|
||||
# Require any additional compass plugins here.
|
||||
|
||||
# Set this to the root of your project when deployed:
|
||||
http_path = "/"
|
||||
css_dir = "static/css"
|
||||
sass_dir = "sass"
|
||||
images_dir = "static/images"
|
||||
javascripts_dir = "static/js"
|
||||
|
||||
# You can select your preferred output style here (can be overridden via the command line):
|
||||
# output_style = :expanded or :nested or :compact or :compressed
|
||||
|
||||
# To enable relative paths to assets via compass helper functions. Uncomment:
|
||||
# relative_assets = true
|
||||
|
||||
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
||||
# line_comments = false
|
||||
|
||||
|
||||
# If you prefer the indented syntax, you might want to regenerate this
|
||||
# project again passing --syntax sass, or you can uncomment this:
|
||||
# preferred_syntax = :sass
|
||||
# and then run:
|
||||
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
|
|
@ -50,8 +50,10 @@ def create_user_profile(sender, instance, created, **kwargs):
|
|||
l.set_option( ldap.OPT_DEBUG_LEVEL, 255 )
|
||||
info = l.search_s('dc=spi,dc=ens,dc=fr',
|
||||
ldap.SCOPE_SUBTREE,
|
||||
'(uid=%s)' % (instance.username,),
|
||||
['cn','mailRoutingAddress', 'homeDirectory'])
|
||||
('(uid=%s)' % (instance.username,)),
|
||||
[str("cn"),
|
||||
str("mailRoutingAddress"),
|
||||
str("homeDirectory")])
|
||||
if len(info) > 0:
|
||||
infos = info[0][1]
|
||||
profil.nom = infos.get('cn', [''])[0]
|
||||
|
|
102
avisstage/sass/screen.scss
Normal file
102
avisstage/sass/screen.scss
Normal file
|
@ -0,0 +1,102 @@
|
|||
@import "compass/reset";
|
||||
|
||||
@import url('https://fonts.googleapis.com/css?family=Dosis:300,500,700|Podkova:700');
|
||||
|
||||
$fond: #E80051;
|
||||
$barre: $fond * 0.7;
|
||||
|
||||
body {
|
||||
background: $fond;
|
||||
font-family: 'Dosis', sans-serif;
|
||||
line-height: 1.4;
|
||||
font-size: 19px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4 {
|
||||
font-family: Podkova;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.beta {
|
||||
opacity: 0.5;
|
||||
font-size: 0.7em;
|
||||
display: inline-block;
|
||||
transform: translate(-1em, 0.6em) rotate(-15deg);
|
||||
}
|
||||
|
||||
a {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
header {
|
||||
background: $barre;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
nav ul {
|
||||
display: inline-flex;
|
||||
|
||||
li {
|
||||
display: inline-table;
|
||||
|
||||
a {
|
||||
text-align: center;
|
||||
display: table-cell;
|
||||
padding: 0 20px;
|
||||
height: 90px;
|
||||
vertical-align: middle;
|
||||
|
||||
&:hover {
|
||||
background: $barre * 0.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
padding: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
|
||||
}
|
||||
|
||||
.content {
|
||||
background: #efefef;
|
||||
max-width: 900px;
|
||||
padding: 30px;
|
||||
margin: 15px auto;
|
||||
|
||||
p {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Index
|
||||
|
||||
.homeh1 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 1.2em;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 3px solid #000;
|
||||
margin-bottom: 15px;
|
||||
|
||||
& > * {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
}
|
161
avisstage/static/css/screen.css
Normal file
161
avisstage/static/css/screen.css
Normal file
|
@ -0,0 +1,161 @@
|
|||
@import url("https://fonts.googleapis.com/css?family=Dosis:300,500,700|Podkova:700");
|
||||
/* line 5, ../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td,
|
||||
article, aside, canvas, details, embed,
|
||||
figure, figcaption, footer, header, hgroup,
|
||||
menu, nav, output, ruby, section, summary,
|
||||
time, mark, audio, video {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font: inherit;
|
||||
font-size: 100%;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/* line 22, ../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
|
||||
html {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* line 24, ../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
/* line 26, ../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
/* line 28, ../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
|
||||
caption, th, td {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* line 30, ../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
|
||||
q, blockquote {
|
||||
quotes: none;
|
||||
}
|
||||
/* line 103, ../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
|
||||
q:before, q:after, blockquote:before, blockquote:after {
|
||||
content: "";
|
||||
content: none;
|
||||
}
|
||||
|
||||
/* line 32, ../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
|
||||
a img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* line 116, ../../../../../../../var/lib/gems/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
|
||||
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* line 8, ../../sass/screen.scss */
|
||||
body {
|
||||
background: #E80051;
|
||||
font-family: 'Dosis', sans-serif;
|
||||
line-height: 1.4;
|
||||
font-size: 19px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
/* line 16, ../../sass/screen.scss */
|
||||
h1, h2, h3, h4 {
|
||||
font-family: Podkova;
|
||||
}
|
||||
|
||||
/* line 20, ../../sass/screen.scss */
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
/* line 24, ../../sass/screen.scss */
|
||||
.beta {
|
||||
opacity: 0.5;
|
||||
font-size: 0.7em;
|
||||
display: inline-block;
|
||||
transform: translate(-1em, 0.6em) rotate(-15deg);
|
||||
}
|
||||
|
||||
/* line 31, ../../sass/screen.scss */
|
||||
a {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* line 35, ../../sass/screen.scss */
|
||||
header {
|
||||
background: #a20039;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
/* line 41, ../../sass/screen.scss */
|
||||
header nav ul {
|
||||
display: inline-flex;
|
||||
}
|
||||
/* line 44, ../../sass/screen.scss */
|
||||
header nav ul li {
|
||||
display: inline-table;
|
||||
}
|
||||
/* line 47, ../../sass/screen.scss */
|
||||
header nav ul li a {
|
||||
text-align: center;
|
||||
display: table-cell;
|
||||
padding: 0 20px;
|
||||
height: 90px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
/* line 54, ../../sass/screen.scss */
|
||||
header nav ul li a:hover {
|
||||
background: #610022;
|
||||
}
|
||||
/* line 61, ../../sass/screen.scss */
|
||||
header a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
/* line 66, ../../sass/screen.scss */
|
||||
header h1 {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
/* line 75, ../../sass/screen.scss */
|
||||
.content {
|
||||
background: #efefef;
|
||||
max-width: 900px;
|
||||
padding: 30px;
|
||||
margin: 15px auto;
|
||||
}
|
||||
/* line 81, ../../sass/screen.scss */
|
||||
.content p {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
/* line 89, ../../sass/screen.scss */
|
||||
.homeh1 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 1.2em;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 3px solid #000;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
/* line 98, ../../sass/screen.scss */
|
||||
.homeh1 > * {
|
||||
display: inline-block;
|
||||
}
|
BIN
avisstage/static/images/home1.jpg
Normal file
BIN
avisstage/static/images/home1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
BIN
avisstage/static/images/home2.jpg
Normal file
BIN
avisstage/static/images/home2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
73
avisstage/templates/avisstage/base.html
Normal file
73
avisstage/templates/avisstage/base.html
Normal file
|
@ -0,0 +1,73 @@
|
|||
{% load staticfiles %}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>{% block title %}ExperiENS{% endblock %}</title>
|
||||
<link type="text/css" rel="stylesheet" href="{% static 'css/screen.css' %}" />
|
||||
{% if request.user.is_authenticated %}
|
||||
<script type="text/javascript">
|
||||
function showFeedback(show){document.getElementById("feedback_win").style.display=show?"table":"none";}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
{% block extra_head %}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1><a href="{% url 'avisstage:index' %}">ExperiENS <span class='beta'>beta</span></a></h1>
|
||||
|
||||
<nav>
|
||||
<ul id="menu">
|
||||
<li><a href="{% url 'avisstage:index' %}">Accueil</a></li>
|
||||
{% if user.username %}
|
||||
<li><a href="{% url 'avisstage:perso' %}">Mes stages</a></li>
|
||||
<li><a href="{% url 'avisstage:recherche' %}">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>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
{# BLOCK FEEDBACK #}
|
||||
{% if request.user.is_authenticated %}
|
||||
<div id="feedback_win" class="win_bg">
|
||||
<div class="win_centrer">
|
||||
<div class="win_content">
|
||||
<h2>Envoyer un avis sur le site<a class="win_close" href="javascript:showFeedback(false)">X</a></h2>
|
||||
<form method="POST" action="{% url 'avisstage: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 %}
|
||||
{# ENDBLOCK FEEDBACK #}
|
||||
|
||||
|
||||
<section class="content">
|
||||
{% if messages %}
|
||||
<ul class="messages">
|
||||
{% for message in messages %}
|
||||
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% block content %}{% endblock %}
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
33
avisstage/templates/avisstage/index.html
Normal file
33
avisstage/templates/avisstage/index.html
Normal file
|
@ -0,0 +1,33 @@
|
|||
{% extends "avisstage/base.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% 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 request.user.is_authenticated %}
|
||||
<div class="entrer">
|
||||
<p><a href="{% url 'login' %}">Connexion</a></p>
|
||||
<p class="helptext">Connexion via le serveur central d'authentification ENS (identifiants clipper)</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<article class="promo">
|
||||
<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 !
|
||||
{% if request.user.is_authenticated %}<br /><a href="{% url 'avisstage: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 !
|
||||
{% if request.user.is_authenticated %}<br /><a href="{% url 'monstage:home' %}" class="btn">Partager ses stages</a>{% endif %}</p>
|
||||
</div>
|
||||
</article>
|
||||
{% endblock %}
|
25
avisstage/templates/avisstage/perso.html
Normal file
25
avisstage/templates/avisstage/perso.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
{% extends "avisstage/base.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Mon espace personnel</h1>
|
||||
<p>{{ user.nom }} <a href="{% monstage:profil_edit %}">Modifier mes infos</a></p>
|
||||
|
||||
<article>
|
||||
<h2>Mes stages</h2>
|
||||
<ul class="stagelist">
|
||||
{% for stage in user.profil.stages %}
|
||||
<li class="stage-{{ stage.published|yesno:"publie,brouillon" }}">
|
||||
<a href="{% url "avisstage:stage" stage.id %}">
|
||||
{{ stage.sujet }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li class="stage-ajout">
|
||||
<a href="{% url "avisstage:stage_ajout" stage.id %}">
|
||||
Ajouter un stage
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</article>
|
||||
{% endblock %}
|
10
avisstage/urls.py
Normal file
10
avisstage/urls.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
from django.conf.urls import include, url
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.index, name='index'),
|
||||
url(r'^perso/$', views.perso, name='perso'),
|
||||
url(r'^profil/show/(?P<profil_id>\w+)/$', views.profil, name='profil'),
|
||||
url(r'^recherche/$', views.recherche, name='recherche'),
|
||||
url(r'^feedback/$', views.feedback, name='feedback'),
|
||||
]
|
|
@ -1,3 +1,16 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
def index(request):
|
||||
return render(request, 'avisstage/index.html')
|
||||
|
||||
def perso(request):
|
||||
return render(request, 'avisstage/perso.html')
|
||||
|
||||
def profil(request, profil_id):
|
||||
return render(request, 'avisstage/profil.html')
|
||||
|
||||
def recherche(request):
|
||||
return render(request, 'avisstage/recherche.html')
|
||||
|
||||
def feedback(request):
|
||||
return render(request, 'avisstage/feedback.html')
|
||||
|
|
|
@ -28,6 +28,7 @@ INSTALLED_APPS = (
|
|||
'django.contrib.staticfiles',
|
||||
'django.contrib.gis',
|
||||
|
||||
'django_cas_ng',
|
||||
'djrichtextfield',
|
||||
'taggit',
|
||||
'avisstage'
|
||||
|
@ -43,6 +44,27 @@ MIDDLEWARE_CLASSES = (
|
|||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
)
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [
|
||||
# insert your TEMPLATE_DIRS here
|
||||
],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.template.context_processors.debug',
|
||||
'django.template.context_processors.i18n',
|
||||
'django.template.context_processors.media',
|
||||
'django.template.context_processors.static',
|
||||
'django.template.context_processors.tz',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'experiENS.urls'
|
||||
|
||||
WSGI_APPLICATION = 'experiENS.wsgi.application'
|
||||
|
@ -80,3 +102,10 @@ DJRICHTEXTFIELD_CONFIG = {
|
|||
'width': 700
|
||||
}
|
||||
}
|
||||
|
||||
AUTHENTICATION_BACKENDS = (
|
||||
'django.contrib.auth.backends.ModelBackend',
|
||||
'django_cas_ng.backends.CASBackend',
|
||||
)
|
||||
|
||||
CAS_SERVER_URL = "https://cas.eleves.ens.fr/"
|
||||
|
|
|
@ -4,11 +4,9 @@ from secrets import SECRET_KEY
|
|||
|
||||
DEBUG = True
|
||||
|
||||
TEMPLATE_DEBUG = True
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'ENGINE': 'django.contrib.gis.db.backends.spatialite',
|
||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||
}
|
||||
}
|
||||
|
@ -20,3 +18,5 @@ INSTALLED_APPS += (
|
|||
MIDDLEWARE_CLASSES += (
|
||||
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||
)
|
||||
|
||||
SPATIALITE_LIBRARY_PATH = 'mod_spatialite'
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
from django.conf.urls import include, url
|
||||
from django.contrib import admin
|
||||
|
||||
from django_cas_ng import views as django_cas_views
|
||||
|
||||
urlpatterns = [
|
||||
# Examples:
|
||||
# url(r'^$', 'experiENS.views.home', name='home'),
|
||||
# url(r'^blog/', include('blog.urls')),
|
||||
url(r'^', include('avisstage.urls', namespace='avisstage')),
|
||||
|
||||
url(r'^login/$', django_cas_views.login, name = "login"),
|
||||
url(r'^logout/$', django_cas_views.logout, name = "logout"),
|
||||
url(r'^djrichtextfield/', include('djrichtextfield.urls')),
|
||||
url(r'^admin/', include(admin.site.urls)),
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue