From 1dbe2aeb0e4dba1daa26d960cc4208eedbe2a703 Mon Sep 17 00:00:00 2001 From: Evarin Date: Thu, 27 Apr 2017 02:38:08 +0200 Subject: [PATCH] =?UTF-8?q?Debug=20maps=20HTTPS=20+=20diff=C3=A9rents=20d?= =?UTF-8?q?=C3=A9tails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- avisstage/forms.py | 7 +- avisstage/models.py | 7 +- avisstage/sass/screen.scss | 24 +- avisstage/static/css/screen.css | 242 ++++++++------- avisstage/static/images/edit-blanc.svg | 89 ++++++ avisstage/static/images/edit.svg | 88 ++++++ avisstage/static/js/select_lieu.js | 1 + avisstage/static/js/tile.stamen.js | 293 ++++++++++++++++++ avisstage/statics.py | 12 +- .../templates/avisstage/detail/profil.html | 5 +- .../templates/avisstage/detail/stage.html | 4 +- avisstage/templates/avisstage/perso.html | 2 +- avisstage/templates/avisstage/recherche.html | 2 +- avisstage/views.py | 4 + experiENS/auth.py | 5 + experiENS/settings_base.py | 2 +- experiENS/settings_dev.py | 2 + 17 files changed, 657 insertions(+), 132 deletions(-) create mode 100644 avisstage/static/images/edit-blanc.svg create mode 100644 avisstage/static/images/edit.svg create mode 100644 avisstage/static/js/tile.stamen.js create mode 100644 experiENS/auth.py diff --git a/avisstage/forms.py b/avisstage/forms.py index aca828f..0fa83b8 100644 --- a/avisstage/forms.py +++ b/avisstage/forms.py @@ -48,15 +48,16 @@ class AvisLieuForm(HTMLTrimmerForm): } class StageForm(forms.ModelForm): - date_widget = forms.DateInput(attrs={"class":"datepicker"}) + date_widget = forms.DateInput(attrs={"class":"datepicker", "placeholder":"JJ/MM/AAAA"}) date_debut = forms.DateField(label=u"Date de début", input_formats=["%d/%m/%Y"], widget=date_widget) date_fin = forms.DateField(label=u"Date de fin", input_formats=["%d/%m/%Y"], widget=date_widget) class Meta: model = Stage - fields = ['sujet', 'date_debut', 'date_fin', 'type_stage', 'thematiques', 'matieres', 'encadrants'] + fields = ['sujet', 'date_debut', 'date_fin', 'type_stage', 'thematiques', 'matieres', 'structure', 'encadrants'] help_texts = { - "thematiques": u"Mettez une virgule pour valider votre thématique si la suggestion ne correspond pas ou si elle n'existe pas encore" + "thematiques": u"Mettez une virgule pour valider votre thématique si la suggestion ne correspond pas ou si elle n'existe pas encore", + "structure": u"Nom de l'équipe, de la startup..." } labels = { "date_debut": u"Date de début", diff --git a/avisstage/models.py b/avisstage/models.py index 7f44d61..344a6e9 100644 --- a/avisstage/models.py +++ b/avisstage/models.py @@ -67,10 +67,12 @@ def create_user_profile(sender, instance, created, **kwargs): if dirs[1] == 'users': annee = dirs[2] dep = dirs[4] - dep = dict(DEPARTEMENTS_DEFAUT).get('dep') + dep = dict(DEPARTEMENTS_DEFAUT).get(dep.lower(), '') profil.promotion = u'%s %s' % (dep, annee) - profil.mail = infos.get('mailRoutingAddress', + pmail = infos.get('mailRoutingAddress', ['%s@clipper.ens.fr'%instance.username]) + if len(pmail) > 1: + profil.mail = pmail[0] profil.save() except ldap.LDAPError: pass @@ -150,6 +152,7 @@ class Stage(models.Model): thematiques = TaggableManager(u"Thématiques", blank=True) matieres = models.ManyToManyField(StageMatiere, verbose_name=u"Matière(s)", related_name="stages") encadrants = models.CharField(u"Encadrant⋅e⋅s", max_length=500, blank=True) + structure = models.CharField(u"Structure d'accueil", max_length=500, blank=True) # Avis lieux = models.ManyToManyField(Lieu, related_name="stages", diff --git a/avisstage/sass/screen.scss b/avisstage/sass/screen.scss index 53be8bc..a7d6eda 100644 --- a/avisstage/sass/screen.scss +++ b/avisstage/sass/screen.scss @@ -8,15 +8,18 @@ $compl: #f99b20; $jaune: #fff60a; $vert: #1a82dd;//09f7b0; $rouge: #f70978; +$staticurl: "/experiens/static/"; $textfont: 'Dosis', sans-serif; +$textfontsize: 19px; $headfont: Podkova, serif; + body { background: $fond; font-family: $textfont; line-height: 1.4; - font-size: 19px; + font-size: $textfontsize; font-weight: 300; } @@ -383,6 +386,7 @@ input[type='text'], input[type='password'], input[type='email'], textarea, selec input[type="submit"], .btn { + font: $textfontsize $textfont; background-color: $fond; color: #fff; border: 1px solid $fond * 0.7; @@ -394,7 +398,8 @@ input[type="submit"], } p input[type="submit"], -p .btn { +p .btn, +h1 .btn { display:inline-block; } @@ -667,3 +672,18 @@ article.promo { #id_stage-thematiques { display: none; } + +.edit-btn { + border-color:darken($jaune, 30%); + color: #000; + background: url($staticurl + "images/edit.svg") no-repeat right center; + background-color:lighten($jaune, 10%); + background-origin: content-box; + background-size: contain; + + &:after { + content:""; + width: 30px; + display: inline-block; + } +} diff --git a/avisstage/static/css/screen.css b/avisstage/static/css/screen.css index f39632d..368f09b 100644 --- a/avisstage/static/css/screen.css +++ b/avisstage/static/css/screen.css @@ -65,7 +65,7 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, display: block; } -/* line 15, ../../sass/screen.scss */ +/* line 18, ../../sass/screen.scss */ body { background: #8fcc33; font-family: "Dosis", sans-serif; @@ -74,32 +74,32 @@ body { font-weight: 300; } -/* line 23, ../../sass/screen.scss */ +/* line 26, ../../sass/screen.scss */ h1, h2, h3, h4 { font-family: Podkova, serif; } -/* line 27, ../../sass/screen.scss */ +/* line 30, ../../sass/screen.scss */ h1 { font-size: 2.3em; } -/* line 31, ../../sass/screen.scss */ +/* line 34, ../../sass/screen.scss */ h2 { font-size: 1.8em; } -/* line 35, ../../sass/screen.scss */ +/* line 38, ../../sass/screen.scss */ h3 { font-size: 1.4em; } -/* line 39, ../../sass/screen.scss */ +/* line 42, ../../sass/screen.scss */ b, strong, em { font-weight: bold; } -/* line 43, ../../sass/screen.scss */ +/* line 46, ../../sass/screen.scss */ .beta { opacity: 0.5; font-size: 0.7em; @@ -107,29 +107,29 @@ b, strong, em { transform: translate(-1em, 0.6em) rotate(-15deg); } -/* line 50, ../../sass/screen.scss */ +/* line 53, ../../sass/screen.scss */ a { font-weight: bold; color: #e08c1d; text-decoration: none; } -/* line 56, ../../sass/screen.scss */ +/* line 59, ../../sass/screen.scss */ header { background: #72a329; display: flex; justify-content: space-between; align-items: center; } -/* line 62, ../../sass/screen.scss */ +/* line 65, ../../sass/screen.scss */ header nav ul { display: inline-flex; } -/* line 65, ../../sass/screen.scss */ +/* line 68, ../../sass/screen.scss */ header nav ul li { display: inline-table; } -/* line 68, ../../sass/screen.scss */ +/* line 71, ../../sass/screen.scss */ header nav ul li a { text-align: center; display: table-cell; @@ -138,34 +138,34 @@ header nav ul li a { vertical-align: middle; color: #e9f5d6; } -/* line 76, ../../sass/screen.scss */ +/* line 79, ../../sass/screen.scss */ header nav ul li a:hover { background: #446219; } -/* line 83, ../../sass/screen.scss */ +/* line 86, ../../sass/screen.scss */ header a { color: #fff; text-decoration: none; } -/* line 88, ../../sass/screen.scss */ +/* line 91, ../../sass/screen.scss */ header h1 { padding: 15px; word-wrap: none; } -/* line 98, ../../sass/screen.scss */ +/* line 101, ../../sass/screen.scss */ .content { background: #efefef; max-width: 900px; padding: 30px; margin: 15px auto; } -/* line 104, ../../sass/screen.scss */ +/* line 107, ../../sass/screen.scss */ .content p { margin: 0.5em 0; } -/* line 111, ../../sass/screen.scss */ +/* line 114, ../../sass/screen.scss */ .homeh1 { display: flex; justify-content: space-between; @@ -175,33 +175,33 @@ header h1 { border-bottom: 3px solid #000; margin-bottom: 15px; } -/* line 120, ../../sass/screen.scss */ +/* line 123, ../../sass/screen.scss */ .homeh1 > * { display: inline-block; } -/* line 130, ../../sass/screen.scss */ +/* line 133, ../../sass/screen.scss */ .stagelist li { display: table; width: 100%; background: #fff; margin: 12px; } -/* line 137, ../../sass/screen.scss */ +/* line 140, ../../sass/screen.scss */ .stagelist li > *, .stagelist li:before { display: table-cell; vertical-align: middle; padding: 15px; } -/* line 142, ../../sass/screen.scss */ +/* line 145, ../../sass/screen.scss */ .stagelist li a { width: auto; } -/* line 144, ../../sass/screen.scss */ +/* line 147, ../../sass/screen.scss */ .stagelist li a:hover { background: #ccc; } -/* line 148, ../../sass/screen.scss */ +/* line 151, ../../sass/screen.scss */ .stagelist li:before { content: ""; text-align: right; @@ -209,27 +209,27 @@ header h1 { opacity: 0.8; color: #000; } -/* line 155, ../../sass/screen.scss */ +/* line 158, ../../sass/screen.scss */ .stagelist li.stage-brouillon:before { content: "Brouillon"; background: #f93a93; } -/* line 159, ../../sass/screen.scss */ +/* line 162, ../../sass/screen.scss */ .stagelist li.stage-publie:before { content: "Publié"; background: #419be9; } -/* line 163, ../../sass/screen.scss */ +/* line 166, ../../sass/screen.scss */ .stagelist li.stage-ajout:before { content: "+"; color: #000; } -/* line 172, ../../sass/screen.scss */ +/* line 175, ../../sass/screen.scss */ article.stage { font-weight: normal; } -/* line 175, ../../sass/screen.scss */ +/* line 178, ../../sass/screen.scss */ article.stage h2 { background: #ddda78; color: #fff; @@ -238,7 +238,7 @@ article.stage h2 { margin-bottom: 25px; text-shadow: -3px 3px 0 rgba(0, 0, 0, 0.3); } -/* line 183, ../../sass/screen.scss */ +/* line 186, ../../sass/screen.scss */ article.stage h3 { border-bottom: 2px solid #cb954e; margin-left: -25px; @@ -248,35 +248,35 @@ article.stage h3 { color: #000; text-shadow: -3px 3px 0 rgba(0, 0, 0, 0.1); } -/* line 194, ../../sass/screen.scss */ +/* line 197, ../../sass/screen.scss */ article.stage #stage-map { height: 300px; width: 100%; } -/* line 199, ../../sass/screen.scss */ +/* line 202, ../../sass/screen.scss */ article.stage section { background: #eee; padding: 14px; max-width: 600px; margin: 30px auto; } -/* line 205, ../../sass/screen.scss */ +/* line 208, ../../sass/screen.scss */ article.stage section:first-child { margin-top: 0; } -/* line 207, ../../sass/screen.scss */ +/* line 210, ../../sass/screen.scss */ article.stage section:first-child h3 { margin-top: 0; } -/* line 212, ../../sass/screen.scss */ +/* line 215, ../../sass/screen.scss */ article.stage section.misc { padding-top: 0; } -/* line 214, ../../sass/screen.scss */ +/* line 217, ../../sass/screen.scss */ article.stage section.misc ul.infos { margin: 0 -3px; } -/* line 217, ../../sass/screen.scss */ +/* line 220, ../../sass/screen.scss */ article.stage section.misc ul.infos li { display: inline-block; padding: 5px; @@ -286,42 +286,42 @@ article.stage section.misc ul.infos li { font-size: 0.9em; border-radius: 4px; } -/* line 226, ../../sass/screen.scss */ +/* line 229, ../../sass/screen.scss */ article.stage section.misc ul.infos li.thematique { background-color: #f99b20; } -/* line 229, ../../sass/screen.scss */ +/* line 232, ../../sass/screen.scss */ article.stage section.misc ul.infos li.matiere { background-color: #8fcc33; } -/* line 236, ../../sass/screen.scss */ +/* line 239, ../../sass/screen.scss */ article.stage section .chapo, article.stage section .avis-texte { margin-bottom: 15px; background: #fff; padding: 20px; } -/* line 241, ../../sass/screen.scss */ +/* line 244, ../../sass/screen.scss */ article.stage section .chapo { font-size: 1.1em; font-weight: 500; font-variant: small-caps; } -/* line 246, ../../sass/screen.scss */ +/* line 249, ../../sass/screen.scss */ article.stage section .avis-texte { border-left: 1px solid #ccc; padding-left: 15px; } -/* line 251, ../../sass/screen.scss */ +/* line 254, ../../sass/screen.scss */ article.stage section .plusmoins { max-width: 600px; margin: 15px auto; } -/* line 255, ../../sass/screen.scss */ +/* line 258, ../../sass/screen.scss */ article.stage section .plusmoins > div { display: table; width: 100%; } -/* line 259, ../../sass/screen.scss */ +/* line 262, ../../sass/screen.scss */ article.stage section .plusmoins > div:before { content: " "; width: 100px; @@ -330,101 +330,101 @@ article.stage section .plusmoins > div:before { text-align: right; padding-right: 12px; } -/* line 268, ../../sass/screen.scss */ +/* line 271, ../../sass/screen.scss */ article.stage section .plusmoins > div > *, article.stage section .plusmoins > div:before { display: table-cell; } -/* line 272, ../../sass/screen.scss */ +/* line 275, ../../sass/screen.scss */ article.stage section .plusmoins > div > div { padding: 15px; color: #fff; } -/* line 275, ../../sass/screen.scss */ +/* line 278, ../../sass/screen.scss */ article.stage section .plusmoins > div > div h4 { font-weight: normal; margin-left: -5px; font-size: 0.9em; opacity: 0.9; } -/* line 281, ../../sass/screen.scss */ +/* line 284, ../../sass/screen.scss */ article.stage section .plusmoins > div > div p { font-weight: bold; margin: 2px; } -/* line 289, ../../sass/screen.scss */ +/* line 292, ../../sass/screen.scss */ article.stage section .plusmoins .plus > div { background: #1775c6; } -/* line 292, ../../sass/screen.scss */ +/* line 295, ../../sass/screen.scss */ article.stage section .plusmoins .plus:before { content: "Les +"; vertical-align: bottom; color: #1567af; } -/* line 299, ../../sass/screen.scss */ +/* line 302, ../../sass/screen.scss */ article.stage section .plusmoins .moins > div { background: #df076c; } -/* line 302, ../../sass/screen.scss */ +/* line 305, ../../sass/screen.scss */ article.stage section .plusmoins .moins:before { content: "Les -"; vertical-align: top; color: #c70660; } -/* line 312, ../../sass/screen.scss */ +/* line 315, ../../sass/screen.scss */ .edit-box { background: #eee; margin: 10px; padding: 10px 20px; text-align: center; } -/* line 318, ../../sass/screen.scss */ +/* line 321, ../../sass/screen.scss */ .edit-box.public { background: #cae3f9; border: 1px solid #125b9b; } -/* line 323, ../../sass/screen.scss */ +/* line 326, ../../sass/screen.scss */ .edit-box.prive { background: #fdcfe4; border: 1px solid #ad0654; } -/* line 330, ../../sass/screen.scss */ +/* line 333, ../../sass/screen.scss */ .article-wrapper { display: table; } -/* line 332, ../../sass/screen.scss */ +/* line 335, ../../sass/screen.scss */ .article-wrapper .toc-wrapper, .article-wrapper article { display: table-cell; vertical-align: top; } -/* line 336, ../../sass/screen.scss */ +/* line 339, ../../sass/screen.scss */ .article-wrapper .toc-wrapper { max-width: 250px; width: 25%; } -/* line 340, ../../sass/screen.scss */ +/* line 343, ../../sass/screen.scss */ .article-wrapper .toc { position: -webkit-sticky; position: sticky; top: 0; } -/* line 344, ../../sass/screen.scss */ +/* line 347, ../../sass/screen.scss */ .article-wrapper .toc a { color: inherit; font-weight: normal; } -/* line 351, ../../sass/screen.scss */ +/* line 354, ../../sass/screen.scss */ .article-wrapper .toc .toc-h3 a { font-weight: 300; } -/* line 354, ../../sass/screen.scss */ +/* line 357, ../../sass/screen.scss */ .article-wrapper .toc .toc-active a { color: #8fcc33; } -/* line 363, ../../sass/screen.scss */ +/* line 366, ../../sass/screen.scss */ input, textarea, select, div.tinymce { background: #fff; font-size: 1em; @@ -434,7 +434,7 @@ input, textarea, select, div.tinymce { padding: 5px; } -/* line 372, ../../sass/screen.scss */ +/* line 375, ../../sass/screen.scss */ input[type='text'], input[type='password'], input[type='email'], textarea, select { border: none; border-bottom: 1px solid #8fcc33; @@ -442,14 +442,15 @@ input[type='text'], input[type='password'], input[type='email'], textarea, selec max-width: 100%; transition: border 1s ease-out, background 1s ease-out; } -/* line 379, ../../sass/screen.scss */ +/* line 382, ../../sass/screen.scss */ input[type='text']:focus, input[type='password']:focus, input[type='email']:focus, textarea:focus, select:focus { background-color: white; } -/* line 384, ../../sass/screen.scss */ +/* line 387, ../../sass/screen.scss */ input[type="submit"], .btn { + font: 19px "Dosis", sans-serif; background-color: #8fcc33; color: #fff; border: 1px solid #648f24; @@ -460,13 +461,14 @@ input[type="submit"], margin-right: 0; } -/* line 396, ../../sass/screen.scss */ +/* line 400, ../../sass/screen.scss */ p input[type="submit"], -p .btn { +p .btn, +h1 .btn { display: inline-block; } -/* line 402, ../../sass/screen.scss */ +/* line 407, ../../sass/screen.scss */ select { -moz-appearance: none; appearance: none; @@ -475,7 +477,7 @@ select { cursor: pointer; } -/* line 410, ../../sass/screen.scss */ +/* line 415, ../../sass/screen.scss */ textarea, div.tinymce { border: none; border-left: 1px solid #8fcc33; @@ -484,26 +486,26 @@ textarea, div.tinymce { transition: border 1s ease-out, background 1s ease-out; } -/* line 418, ../../sass/screen.scss */ +/* line 423, ../../sass/screen.scss */ div.tinymce.mce-edit-focus { background-color: white; outline: none; } -/* line 423, ../../sass/screen.scss */ +/* line 428, ../../sass/screen.scss */ textarea { height: 200px; resize: vertical; } -/* line 429, ../../sass/screen.scss */ +/* line 434, ../../sass/screen.scss */ form .field { margin: 5px 0; display: flex; background: #fff; padding: 10px; } -/* line 435, ../../sass/screen.scss */ +/* line 440, ../../sass/screen.scss */ form .field label, form .field .label { display: inline-block; width: 250px; @@ -512,33 +514,33 @@ form .field label, form .field .label { padding-top: 5px; flex-shrink: 0; } -/* line 443, ../../sass/screen.scss */ +/* line 448, ../../sass/screen.scss */ form .field label { font-family: Podkova, serif; font-weight: bold; } -/* line 447, ../../sass/screen.scss */ +/* line 452, ../../sass/screen.scss */ form .field .help_text { font-style: italic; font-size: 0.9em; } -/* line 451, ../../sass/screen.scss */ +/* line 456, ../../sass/screen.scss */ form .field .input { display: inline-block; flex-grow: 1; margin-right: 10px; } -/* line 460, ../../sass/screen.scss */ +/* line 465, ../../sass/screen.scss */ ul.as-selections { display: flex; flex-wrap: wrap; } -/* line 464, ../../sass/screen.scss */ +/* line 469, ../../sass/screen.scss */ ul.as-selections li { display: inline-block; } -/* line 468, ../../sass/screen.scss */ +/* line 473, ../../sass/screen.scss */ ul.as-selections .as-selection-item { padding: 0 5px; background: #f99b20; @@ -547,57 +549,57 @@ ul.as-selections .as-selection-item { border-radius: 2px; font-weight: 500; } -/* line 476, ../../sass/screen.scss */ +/* line 481, ../../sass/screen.scss */ ul.as-selections .as-selection-item a.as-close { color: #fff; -webkit-cursor: pointer; cursor: pointer; margin-right: 5px; } -/* line 483, ../../sass/screen.scss */ +/* line 488, ../../sass/screen.scss */ ul.as-selections .as-selection-item.selected { background: #8fcc33; } -/* line 488, ../../sass/screen.scss */ +/* line 493, ../../sass/screen.scss */ ul.as-selections .as-original { flex-grow: 1; min-width: 200px; } -/* line 492, ../../sass/screen.scss */ +/* line 497, ../../sass/screen.scss */ ul.as-selections .as-original input { width: 100%; } -/* line 498, ../../sass/screen.scss */ +/* line 503, ../../sass/screen.scss */ div.as-results { position: relative; } -/* line 500, ../../sass/screen.scss */ +/* line 505, ../../sass/screen.scss */ div.as-results ul { position: absolute; width: 100%; background: #fff; border: 1px solid #d2ebad; } -/* line 507, ../../sass/screen.scss */ +/* line 512, ../../sass/screen.scss */ div.as-results ul li { padding: 3px 5px; } -/* line 513, ../../sass/screen.scss */ +/* line 518, ../../sass/screen.scss */ div.as-results ul li.as-result-item.active { background: white; } -/* line 518, ../../sass/screen.scss */ +/* line 523, ../../sass/screen.scss */ div.as-results ul li.as-message { font-style: italic; } -/* line 525, ../../sass/screen.scss */ +/* line 530, ../../sass/screen.scss */ #map_addlieu { height: 500px; } -/* line 529, ../../sass/screen.scss */ +/* line 534, ../../sass/screen.scss */ .window { display: none; position: fixed; @@ -608,11 +610,11 @@ div.as-results ul li.as-message { left: 0; z-index: 10; } -/* line 539, ../../sass/screen.scss */ +/* line 544, ../../sass/screen.scss */ .window.visible { display: block; } -/* line 543, ../../sass/screen.scss */ +/* line 548, ../../sass/screen.scss */ .window .window-bg { background: #000; opacity: 0.7; @@ -623,7 +625,7 @@ div.as-results ul li.as-message { top: 0; z-index: -1; } -/* line 554, ../../sass/screen.scss */ +/* line 559, ../../sass/screen.scss */ .window .window-content { position: relative; margin: 0 auto; @@ -637,7 +639,7 @@ div.as-results ul li.as-message { max-height: 100%; overflow: auto; } -/* line 569, ../../sass/screen.scss */ +/* line 574, ../../sass/screen.scss */ .window .window-closer { position: absolute; top: 0; @@ -645,31 +647,31 @@ div.as-results ul li.as-message { padding: 12px; z-index: 3; } -/* line 575, ../../sass/screen.scss */ +/* line 580, ../../sass/screen.scss */ .window .window-closer:after { content: "×"; } -/* line 582, ../../sass/screen.scss */ +/* line 587, ../../sass/screen.scss */ .lieu-ui .map { height: 400px; width: 100%; } -/* line 586, ../../sass/screen.scss */ +/* line 591, ../../sass/screen.scss */ .lieu-ui .hidden { display: none; } -/* line 589, ../../sass/screen.scss */ +/* line 594, ../../sass/screen.scss */ .lieu-ui .masked { visibility: hidden; } -/* line 594, ../../sass/screen.scss */ +/* line 599, ../../sass/screen.scss */ #avis_lieu_vide { display: none; } -/* line 598, ../../sass/screen.scss */ +/* line 603, ../../sass/screen.scss */ a.lieu-change { color: #fff; background: #f99b20; @@ -682,19 +684,19 @@ a.lieu-change { border-radius: 5px; margin-right: 7px; } -/* line 610, ../../sass/screen.scss */ +/* line 615, ../../sass/screen.scss */ a.lieu-change.ajout:before { content: "+"; margin-right: 5px; } -/* line 616, ../../sass/screen.scss */ +/* line 621, ../../sass/screen.scss */ #stages-map { width: 100%; height: 600px; } -/* line 621, ../../sass/screen.scss */ +/* line 626, ../../sass/screen.scss */ #feedback-button { position: fixed; left: 0; @@ -707,13 +709,13 @@ a.lieu-change.ajout:before { transform-origin: bottom left; } -/* line 634, ../../sass/screen.scss */ +/* line 639, ../../sass/screen.scss */ .betacadre { background: #fa6cae; padding: 10px; } -/* line 639, ../../sass/screen.scss */ +/* line 644, ../../sass/screen.scss */ .entrer { background: #fff; max-width: 500px; @@ -722,27 +724,43 @@ a.lieu-change.ajout:before { margin: 15px auto; } -/* line 647, ../../sass/screen.scss */ +/* line 652, ../../sass/screen.scss */ article.promo { display: block; font-size: 1.1em; } -/* line 651, ../../sass/screen.scss */ +/* line 656, ../../sass/screen.scss */ article.promo .explications { display: table; } -/* line 655, ../../sass/screen.scss */ +/* line 660, ../../sass/screen.scss */ article.promo .explications > div { display: table-cell; vertical-align: middle; text-align: center; } -/* line 660, ../../sass/screen.scss */ +/* line 665, ../../sass/screen.scss */ article.promo .explications > div p { margin: 15px 15px; } -/* line 667, ../../sass/screen.scss */ +/* line 672, ../../sass/screen.scss */ #id_stage-thematiques { display: none; } + +/* line 676, ../../sass/screen.scss */ +.edit-btn { + border-color: #706c00; + color: #000; + background: url("/experiens/static/images/edit.svg") no-repeat right center; + background-color: #fff83d; + background-origin: content-box; + background-size: contain; +} +/* line 684, ../../sass/screen.scss */ +.edit-btn:after { + content: ""; + width: 30px; + display: inline-block; +} diff --git a/avisstage/static/images/edit-blanc.svg b/avisstage/static/images/edit-blanc.svg new file mode 100644 index 0000000..c934332 --- /dev/null +++ b/avisstage/static/images/edit-blanc.svg @@ -0,0 +1,89 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/avisstage/static/images/edit.svg b/avisstage/static/images/edit.svg new file mode 100644 index 0000000..b5dcc6a --- /dev/null +++ b/avisstage/static/images/edit.svg @@ -0,0 +1,88 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/avisstage/static/js/select_lieu.js b/avisstage/static/js/select_lieu.js index 45a627c..426ccec 100644 --- a/avisstage/static/js/select_lieu.js +++ b/avisstage/static/js/select_lieu.js @@ -243,6 +243,7 @@ function SelectLieuWidget(STATIC_ROOT, API_LIEU, target, callback) { content_el.append(form_el); } else { lieux_db.suggestion.id = data.id; + lieux_db.suggestion.nom = form_el.find("#id_nom").val(); callback(lieux_db.suggestion); } } diff --git a/avisstage/static/js/tile.stamen.js b/avisstage/static/js/tile.stamen.js new file mode 100644 index 0000000..a2f1768 --- /dev/null +++ b/avisstage/static/js/tile.stamen.js @@ -0,0 +1,293 @@ +(function(exports) { + +/* + * tile.stamen.js v1.3.0 + */ + +var SUBDOMAINS = "a. b. c. d.".split(" "), + MAKE_PROVIDER = function(layer, type, minZoom, maxZoom) { + return { + "url": ["//stamen-tiles-{s}a.ssl.fastly.net/", layer, "/{Z}/{X}/{Y}.", type].join(""), + "type": type, + "subdomains": SUBDOMAINS.slice(), + "minZoom": minZoom, + "maxZoom": maxZoom, + "attribution": [ + 'Map tiles by Stamen Design, ', + 'under CC BY 3.0. ', + 'Data by OpenStreetMap, ', + 'under CC BY SA.' + ].join("") + }; + }, + PROVIDERS = { + "toner": MAKE_PROVIDER("toner", "png", 0, 20), + "terrain": MAKE_PROVIDER("terrain", "png", 0, 18), + "terrain-classic": MAKE_PROVIDER("terrain-classic", "png", 0, 18), + "watercolor": MAKE_PROVIDER("watercolor", "jpg", 1, 18), + "trees-cabs-crime": { + "url": "http://{S}.tiles.mapbox.com/v3/stamen.trees-cabs-crime/{Z}/{X}/{Y}.png", + "type": "png", + "subdomains": "a b c d".split(" "), + "minZoom": 11, + "maxZoom": 18, + "extent": [ + {"lat": 37.853, "lon": -122.577}, + {"lat": 37.684, "lon": -122.313} + ], + "attribution": [ + 'Design by Shawn Allen at Stamen.', + 'Data courtesy of FuF,', + 'Yellow Cab', + '& SFPD.' + ].join(" ") + } + }; + +PROVIDERS["terrain-classic"].url = "//stamen-tiles-{s}a.ssl.fastly.net/terrain/{Z}/{X}/{Y}.png"; + +// set up toner and terrain flavors +setupFlavors("toner", ["hybrid", "labels", "lines", "background", "lite"]); +setupFlavors("terrain", ["background", "labels", "lines"]); + +// toner 2010 +deprecate("toner", ["2010"]); + +// toner 2011 flavors +deprecate("toner", ["2011", "2011-lines", "2011-labels", "2011-lite"]); + +var odbl = [ + "toner", + "toner-hybrid", + "toner-labels", + "toner-lines", + "toner-background", + "toner-lite", + "terrain", + "terrain-background", + "terrain-lines", + "terrain-labels", + "terrain-classic" +]; + +for (var i = 0; i < odbl.length; i++) { + var key = odbl[i]; + + PROVIDERS[key].retina = true; + PROVIDERS[key].attribution = [ + 'Map tiles by Stamen Design, ', + 'under CC BY 3.0. ', + 'Data by OpenStreetMap, ', + 'under ODbL.' + ].join(""); +} + +/* + * Export stamen.tile to the provided namespace. + */ +exports.stamen = exports.stamen || {}; +exports.stamen.tile = exports.stamen.tile || {}; +exports.stamen.tile.providers = PROVIDERS; +exports.stamen.tile.getProvider = getProvider; + +function deprecate(base, flavors) { + var provider = getProvider(base); + + for (var i = 0; i < flavors.length; i++) { + var flavor = [base, flavors[i]].join("-"); + PROVIDERS[flavor] = MAKE_PROVIDER(flavor, provider.type, provider.minZoom, provider.maxZoom); + PROVIDERS[flavor].deprecated = true; + } +}; + +/* + * A shortcut for specifying "flavors" of a style, which are assumed to have the + * same type and zoom range. + */ +function setupFlavors(base, flavors, type) { + var provider = getProvider(base); + for (var i = 0; i < flavors.length; i++) { + var flavor = [base, flavors[i]].join("-"); + PROVIDERS[flavor] = MAKE_PROVIDER(flavor, type || provider.type, provider.minZoom, provider.maxZoom); + } +} + +/* + * Get the named provider, or throw an exception if it doesn't exist. + */ +function getProvider(name) { + if (name in PROVIDERS) { + var provider = PROVIDERS[name]; + + if (provider.deprecated && console && console.warn) { + console.warn(name + " is a deprecated style; it will be redirected to its replacement. For performance improvements, please change your reference."); + } + + return provider; + } else { + throw 'No such provider (' + name + ')'; + } +} + +/* + * StamenTileLayer for modestmaps-js + * + * + * Works with both 1.x and 2.x by checking for the existence of MM.Template. + */ +if (typeof MM === "object") { + var ModestTemplate = (typeof MM.Template === "function") + ? MM.Template + : MM.TemplatedMapProvider; + MM.StamenTileLayer = function(name) { + var provider = getProvider(name); + this._provider = provider; + MM.Layer.call(this, new ModestTemplate(provider.url, provider.subdomains)); + this.provider.setZoomRange(provider.minZoom, provider.maxZoom); + this.attribution = provider.attribution; + }; + + MM.StamenTileLayer.prototype = { + setCoordLimits: function(map) { + var provider = this._provider; + if (provider.extent) { + map.coordLimits = [ + map.locationCoordinate(provider.extent[0]).zoomTo(provider.minZoom), + map.locationCoordinate(provider.extent[1]).zoomTo(provider.maxZoom) + ]; + return true; + } else { + return false; + } + } + }; + + MM.extend(MM.StamenTileLayer, MM.Layer); +} + +/* + * StamenTileLayer for Leaflet + * + * + * Tested with version 0.3 and 0.4, but should work on all 0.x releases. + */ +if (typeof L === "object") { + L.StamenTileLayer = L.TileLayer.extend({ + initialize: function(name, options) { + var provider = getProvider(name), + url = provider.url.replace(/({[A-Z]})/g, function(s) { + return s.toLowerCase(); + }), + opts = L.Util.extend({}, options, { + "minZoom": provider.minZoom, + "maxZoom": provider.maxZoom, + "subdomains": provider.subdomains, + "scheme": "xyz", + "attribution": provider.attribution, + sa_id: name + }); + L.TileLayer.prototype.initialize.call(this, url, opts); + } + }); + + /* + * Factory function for consistency with Leaflet conventions + */ + L.stamenTileLayer = function (options, source) { + return new L.StamenTileLayer(options, source); + }; +} + +/* + * StamenTileLayer for OpenLayers + * + * + * Tested with v2.1x. + */ +if (typeof OpenLayers === "object") { + // make a tile URL template OpenLayers-compatible + function openlayerize(url) { + return url.replace(/({.})/g, function(v) { + return "$" + v.toLowerCase(); + }); + } + + // based on http://www.bostongis.com/PrinterFriendly.aspx?content_name=using_custom_osm_tiles + OpenLayers.Layer.Stamen = OpenLayers.Class(OpenLayers.Layer.OSM, { + initialize: function(name, options) { + var provider = getProvider(name), + url = provider.url, + subdomains = provider.subdomains, + hosts = []; + if (url.indexOf("{S}") > -1) { + for (var i = 0; i < subdomains.length; i++) { + hosts.push(openlayerize(url.replace("{S}", subdomains[i]))); + } + } else { + hosts.push(openlayerize(url)); + } + options = OpenLayers.Util.extend({ + "numZoomLevels": provider.maxZoom, + "buffer": 0, + "transitionEffect": "resize", + // see: + // and: + "tileOptions": { + "crossOriginKeyword": null + }, + "attribution": provider.attribution + }, options); + return OpenLayers.Layer.OSM.prototype.initialize.call(this, name, hosts, options); + } + }); +} + +/* + * StamenMapType for Google Maps API V3 + * + */ +if (typeof google === "object" && typeof google.maps === "object") { + + // Extending Google class based on a post by Bogart Salzberg of Portland Webworks, + // http://www.portlandwebworks.com/blog/extending-googlemapsmap-object + google.maps.ImageMapType = (function(_constructor){ + var f = function() { + if (!arguments.length) { + return; + } + _constructor.apply(this, arguments); + } + f.prototype = _constructor.prototype; + return f; + })(google.maps.ImageMapType); + + + google.maps.StamenMapType = function(name) { + var provider = getProvider(name), + subdomains = provider.subdomains; + return google.maps.ImageMapType.call(this, { + "getTileUrl": function(coord, zoom) { + var numTiles = 1 << zoom, + wx = coord.x % numTiles, + x = (wx < 0) ? wx + numTiles : wx, + y = coord.y, + index = (zoom + x + y) % subdomains.length; + return provider.url + .replace("{S}", subdomains[index]) + .replace("{Z}", zoom) + .replace("{X}", x) + .replace("{Y}", y); + }, + "tileSize": new google.maps.Size(256, 256), + "name": name, + "minZoom": provider.minZoom, + "maxZoom": provider.maxZoom + }); + }; + + // FIXME: is there a better way to extend classes in Google land? + // Possibly fixed, see above ^^^ | SC + google.maps.StamenMapType.prototype = new google.maps.ImageMapType; +} + +})(typeof exports === "undefined" ? this : exports); diff --git a/avisstage/statics.py b/avisstage/statics.py index 0127fd1..012c457 100644 --- a/avisstage/statics.py +++ b/avisstage/statics.py @@ -1,13 +1,13 @@ # coding: utf-8 DEPARTEMENTS_DEFAUT = ( - ('phy', 'Physique'), - ('maths', 'Maths'), - ('bio', 'Biologie'), - ('chimie', 'Chimie'), + ('phy', u'Physique'), + ('maths', u'Maths'), + ('bio', u'Biologie'), + ('chimie', u'Chimie'), ('geol', u'Géosciences'), - ('dec', 'DEC'), - ('info', 'Informatique'), + ('dec', u'DEC'), + ('info', u'Informatique'), ('litt', u'Littéraire'), ('guests', u'Pensionnaires étrangers'), ('pei', u'PEI'), diff --git a/avisstage/templates/avisstage/detail/profil.html b/avisstage/templates/avisstage/detail/profil.html index b598c88..6e7025c 100644 --- a/avisstage/templates/avisstage/detail/profil.html +++ b/avisstage/templates/avisstage/detail/profil.html @@ -4,10 +4,11 @@ {% block title %}Profil de {{ object.nom }} - ExperiENS{% endblock %} {% block content %} -

Profil de {{ object.nom }}

+

Profil de {{ object.nom }} {% if object.user == user %} -

Modifier mes infos

+ Modifier mes infos {% endif %} +

Promotion : {{ object.promotion }}

Adresse de contact : {{ object.mail }}

diff --git a/avisstage/templates/avisstage/detail/stage.html b/avisstage/templates/avisstage/detail/stage.html index 544b879..02b7275 100644 --- a/avisstage/templates/avisstage/detail/stage.html +++ b/avisstage/templates/avisstage/detail/stage.html @@ -7,7 +7,7 @@ - + +