diff --git a/avisstage/api.py b/avisstage/api.py index 8a47666..9c8e833 100644 --- a/avisstage/api.py +++ b/avisstage/api.py @@ -8,6 +8,8 @@ from tastypie.authentication import SessionAuthentication from django.contrib.gis import geos from tastypie import fields, utils +from django.urls import reverse + class LieuResource(ModelResource): stages = fields.ToManyField("avisstage.api.StageResource", "stages", use_in="detail", full=True) @@ -76,6 +78,7 @@ class StageResource(ModelResource): bundle.data['auteur'] = obj.auteur.nom bundle.data['thematiques'] = list(obj.thematiques.all().values_list("name", flat=True)) bundle.data['matieres'] = list(obj.matieres.all().values_list("nom", flat=True)) + bundle.data['url'] = reverse("avisstage:stage", kwargs={"pk": obj.id}); return bundle class AuteurResource(ModelResource): diff --git a/avisstage/sass/screen.scss b/avisstage/sass/screen.scss index cfc1ebb..35597f9 100644 --- a/avisstage/sass/screen.scss +++ b/avisstage/sass/screen.scss @@ -381,7 +381,8 @@ input[type='text'], input[type='password'], input[type='email'], textarea, selec } } -input[type="submit"] { +input[type="submit"], +.btn { background-color: $fond; color: #fff; border: 1px solid $fond * 0.7; @@ -392,7 +393,8 @@ input[type="submit"] { margin-right: 0; } -p input[type="submit"] { +p input[type="submit"], +p .btn { display:inline-block; } @@ -627,3 +629,37 @@ a.lieu-change { transform: rotateZ(90deg); transform-origin: bottom left; } + + +.betacadre { + background: lighten($rouge, 20%); + padding: 10px; +} + +.entrer { + background: #fff; + max-width: 500px; + padding: 15px; + text-align: center; + margin: 15px auto; +} + +article.promo { + display:block; + font-size: 1.1em; + + .explications { + display:table; + + + & > div { + display:table-cell; + vertical-align: middle; + text-align: center; + + p { + margin: 15px 15px; + } + } + } +} diff --git a/avisstage/static/css/screen.css b/avisstage/static/css/screen.css index 3b14d21..58b9361 100644 --- a/avisstage/static/css/screen.css +++ b/avisstage/static/css/screen.css @@ -448,7 +448,8 @@ input[type='text']:focus, input[type='password']:focus, input[type='email']:focu } /* line 384, ../../sass/screen.scss */ -input[type="submit"] { +input[type="submit"], +.btn { background-color: #8fcc33; color: #fff; border: 1px solid #648f24; @@ -459,12 +460,13 @@ input[type="submit"] { margin-right: 0; } -/* line 395, ../../sass/screen.scss */ -p input[type="submit"] { +/* line 396, ../../sass/screen.scss */ +p input[type="submit"], +p .btn { display: inline-block; } -/* line 400, ../../sass/screen.scss */ +/* line 402, ../../sass/screen.scss */ select { -moz-appearance: none; appearance: none; @@ -473,7 +475,7 @@ select { cursor: pointer; } -/* line 408, ../../sass/screen.scss */ +/* line 410, ../../sass/screen.scss */ textarea, div.tinymce { border: none; border-left: 1px solid #8fcc33; @@ -482,26 +484,26 @@ textarea, div.tinymce { transition: border 1s ease-out, background 1s ease-out; } -/* line 416, ../../sass/screen.scss */ +/* line 418, ../../sass/screen.scss */ div.tinymce.mce-edit-focus { background-color: white; outline: none; } -/* line 421, ../../sass/screen.scss */ +/* line 423, ../../sass/screen.scss */ textarea { height: 200px; resize: vertical; } -/* line 427, ../../sass/screen.scss */ +/* line 429, ../../sass/screen.scss */ form .field { margin: 5px 0; display: flex; background: #fff; padding: 10px; } -/* line 433, ../../sass/screen.scss */ +/* line 435, ../../sass/screen.scss */ form .field label, form .field .label { display: inline-block; width: 250px; @@ -510,33 +512,33 @@ form .field label, form .field .label { padding-top: 5px; flex-shrink: 0; } -/* line 441, ../../sass/screen.scss */ +/* line 443, ../../sass/screen.scss */ form .field label { font-family: Podkova, serif; font-weight: bold; } -/* line 445, ../../sass/screen.scss */ +/* line 447, ../../sass/screen.scss */ form .field .help_text { font-style: italic; font-size: 0.9em; } -/* line 449, ../../sass/screen.scss */ +/* line 451, ../../sass/screen.scss */ form .field .input { display: inline-block; flex-grow: 1; margin-right: 10px; } -/* line 458, ../../sass/screen.scss */ +/* line 460, ../../sass/screen.scss */ ul.as-selections { display: flex; flex-wrap: wrap; } -/* line 462, ../../sass/screen.scss */ +/* line 464, ../../sass/screen.scss */ ul.as-selections li { display: inline-block; } -/* line 466, ../../sass/screen.scss */ +/* line 468, ../../sass/screen.scss */ ul.as-selections .as-selection-item { padding: 0 5px; background: #f99b20; @@ -545,57 +547,57 @@ ul.as-selections .as-selection-item { border-radius: 2px; font-weight: 500; } -/* line 474, ../../sass/screen.scss */ +/* line 476, ../../sass/screen.scss */ ul.as-selections .as-selection-item a.as-close { color: #fff; -webkit-cursor: pointer; cursor: pointer; margin-right: 5px; } -/* line 481, ../../sass/screen.scss */ +/* line 483, ../../sass/screen.scss */ ul.as-selections .as-selection-item.selected { background: #8fcc33; } -/* line 486, ../../sass/screen.scss */ +/* line 488, ../../sass/screen.scss */ ul.as-selections .as-original { flex-grow: 1; min-width: 200px; } -/* line 490, ../../sass/screen.scss */ +/* line 492, ../../sass/screen.scss */ ul.as-selections .as-original input { width: 100%; } -/* line 496, ../../sass/screen.scss */ +/* line 498, ../../sass/screen.scss */ div.as-results { position: relative; } -/* line 498, ../../sass/screen.scss */ +/* line 500, ../../sass/screen.scss */ div.as-results ul { position: absolute; width: 100%; background: #fff; border: 1px solid #d2ebad; } -/* line 505, ../../sass/screen.scss */ +/* line 507, ../../sass/screen.scss */ div.as-results ul li { padding: 3px 5px; } -/* line 511, ../../sass/screen.scss */ +/* line 513, ../../sass/screen.scss */ div.as-results ul li.as-result-item.active { background: white; } -/* line 516, ../../sass/screen.scss */ +/* line 518, ../../sass/screen.scss */ div.as-results ul li.as-message { font-style: italic; } -/* line 523, ../../sass/screen.scss */ +/* line 525, ../../sass/screen.scss */ #map_addlieu { height: 500px; } -/* line 527, ../../sass/screen.scss */ +/* line 529, ../../sass/screen.scss */ .window { display: none; position: fixed; @@ -606,11 +608,11 @@ div.as-results ul li.as-message { left: 0; z-index: 10; } -/* line 537, ../../sass/screen.scss */ +/* line 539, ../../sass/screen.scss */ .window.visible { display: block; } -/* line 541, ../../sass/screen.scss */ +/* line 543, ../../sass/screen.scss */ .window .window-bg { background: #000; opacity: 0.7; @@ -621,7 +623,7 @@ div.as-results ul li.as-message { top: 0; z-index: -1; } -/* line 552, ../../sass/screen.scss */ +/* line 554, ../../sass/screen.scss */ .window .window-content { position: relative; margin: 0 auto; @@ -635,7 +637,7 @@ div.as-results ul li.as-message { max-height: 100%; overflow: auto; } -/* line 567, ../../sass/screen.scss */ +/* line 569, ../../sass/screen.scss */ .window .window-closer { position: absolute; top: 0; @@ -643,31 +645,31 @@ div.as-results ul li.as-message { padding: 12px; z-index: 3; } -/* line 573, ../../sass/screen.scss */ +/* line 575, ../../sass/screen.scss */ .window .window-closer:after { content: "×"; } -/* line 580, ../../sass/screen.scss */ +/* line 582, ../../sass/screen.scss */ .lieu-ui .map { height: 400px; width: 100%; } -/* line 584, ../../sass/screen.scss */ +/* line 586, ../../sass/screen.scss */ .lieu-ui .hidden { display: none; } -/* line 587, ../../sass/screen.scss */ +/* line 589, ../../sass/screen.scss */ .lieu-ui .masked { visibility: hidden; } -/* line 592, ../../sass/screen.scss */ +/* line 594, ../../sass/screen.scss */ #avis_lieu_vide { display: none; } -/* line 596, ../../sass/screen.scss */ +/* line 598, ../../sass/screen.scss */ a.lieu-change { color: #fff; background: #f99b20; @@ -680,19 +682,19 @@ a.lieu-change { border-radius: 5px; margin-right: 7px; } -/* line 608, ../../sass/screen.scss */ +/* line 610, ../../sass/screen.scss */ a.lieu-change.ajout:before { content: "+"; margin-right: 5px; } -/* line 614, ../../sass/screen.scss */ +/* line 616, ../../sass/screen.scss */ #stages-map { width: 100%; height: 600px; } -/* line 619, ../../sass/screen.scss */ +/* line 621, ../../sass/screen.scss */ #feedback-button { position: fixed; left: 0; @@ -704,3 +706,38 @@ a.lieu-change.ajout:before { transform: rotateZ(90deg); transform-origin: bottom left; } + +/* line 634, ../../sass/screen.scss */ +.betacadre { + background: #fa6cae; + padding: 10px; +} + +/* line 639, ../../sass/screen.scss */ +.entrer { + background: #fff; + max-width: 500px; + padding: 15px; + text-align: center; + margin: 15px auto; +} + +/* line 647, ../../sass/screen.scss */ +article.promo { + display: block; + font-size: 1.1em; +} +/* line 651, ../../sass/screen.scss */ +article.promo .explications { + display: table; +} +/* line 655, ../../sass/screen.scss */ +article.promo .explications > div { + display: table-cell; + vertical-align: middle; + text-align: center; +} +/* line 660, ../../sass/screen.scss */ +article.promo .explications > div p { + margin: 15px 15px; +} diff --git a/avisstage/templates/avisstage/index.html b/avisstage/templates/avisstage/index.html index b8c7865..42aee65 100644 --- a/avisstage/templates/avisstage/index.html +++ b/avisstage/templates/avisstage/index.html @@ -13,7 +13,7 @@ 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". - {% if not request.user.is_authenticated %} + {% if not user.is_authenticated %}

Connexion

Connexion via le serveur central d'authentification ENS (identifiants clipper)

@@ -22,14 +22,22 @@
-

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 %}
Rechercher des stages{% endif %}

- +
+

Ne partez plus en stage en terre inconnue : nourrissez-vous de l'expérience des stages effectués par la communauté normalienne, repérez les bons plans, et ne faites pas les mêmes erreurs !

+ {% if user.is_authenticated %}

Rechercher des stages

{% endif %} +
+
+ +
- -

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 %}
Partager ses stages{% endif %}

+
+ +
+
+

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.is_authenticated %}

Partager ses stages

{% endif %} +
{% endblock %} diff --git a/avisstage/templates/avisstage/recherche.html b/avisstage/templates/avisstage/recherche.html index 5f91c6e..56b33d4 100644 --- a/avisstage/templates/avisstage/recherche.html +++ b/avisstage/templates/avisstage/recherche.html @@ -14,6 +14,7 @@ {% endblock %}