Recherche avancée

This commit is contained in:
Evarin 2017-06-17 00:34:11 +02:00
parent fb91dc3111
commit 542363aefd
6 changed files with 616 additions and 411 deletions

View file

@ -0,0 +1,42 @@
form.recherche {
.generale {
display: block;
text-align: center;
input[type="text"] {
max-width: 400px;
}
}
.avancee {
ul {
display: flexbox;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
width: 100%;
li {
flex-grow: 1;
width: 40%;
margin: 5px 0;
padding: 0 10px;
label {
font-weight: bold;
font-size: 0.9em;
}
input {
display: block;
min-width: 150px;
display: inline-block;
width: 100%;
}
&.field__sujet, &.field__contexte {
width:100%;
}
}
}
}
}

View file

@ -0,0 +1,275 @@
article.stage .avis, div.tinymce {
ul, ol {
list-style: unset;
padding-left: 20px;
}
}
article.stage {
font-weight: normal;
font-family: $paragraphfont;
h2 {
background: desaturate(lighten($jaune, 15%), 40%);
color: #000;
padding: 10px 20px;
margin: -20px;
margin-bottom: 5px;
text-shadow: -3px 3px 0 rgba(#fff, 0.3);
}
h3 {
//border-bottom: 2px solid desaturate($compl, 40%);
margin-top: 30px;
padding: 5px;
padding-left: 0px;
color: darken($vert, 20);
text-shadow: -3px 3px 0 rgba($vert, 0.1);
//margin-right: 25px;
}
section {
&.avis section {
max-width: 700px;
background: #fff;
padding: 14px;
margin: 30px auto;
}
&:first-child {
margin-top: 0;
h3 {
margin-top: 0;
}
}
#stage-map {
height: 300px;
width: 100%;
}
&.misc {
padding-top: 0;
margin-bottom: 30px;
.misc-content {
&.withmap {
display:table;
width: 100%;
direction: rtl;
& > div {
direction: ltr;
display:table-cell;
vertical-align: top;
}
.map {
min-width: 250px;
width: 30%;
min-height: 300px;
vertical-align: middle;
}
.desc {
padding: 5px;
padding-left: 15px;
}
}
}
}
.chapo, .avis-texte {
margin-bottom: 15px;
background: #fff;
padding: 0 20px;
}
.avis-texte {
font-size: $textfontsize - 1px;
}
.chapo {
font-size: 1.1em;
//font-family: $textfont;
font-weight: 700;
padding-left: 0px;
}
.avis-texte {
//border-left: 1px solid #ccc;
padding-left: 15px;
}
.plusmoins {
max-width: 600px;
margin: 15px auto;
margin-top: 40px;
& > div {
display: table;
width: 100%;
&:before {
content: "&nbsp";
width: 90px;
font-size: 1.8em;
font-weight: bold;
text-align: right;
padding-right: 12px;
}
& > *, &:before {
display:table-cell;
}
& > div {
padding: 15px;
color: #fff;
h4 {
font-weight: normal;
margin-left: -5px;
font-size: 0.9em;
opacity: 0.9;
}
p {
font-weight: bold;
margin: 2px;
}
}
}
.plus {
& > div {
background: darken($vert, 5%);
}
&:before {
content: "Les +";
vertical-align: bottom;
color: darken($vert, 10%);
}
}
.moins {
& > div {
background: darken($rouge, 5%);
}
&:before {
content: "Les ";
vertical-align: top;
color: darken($rouge, 10%);
}
}
}
}
// Sommaire sur le côté
.section-wrapper {
display: table;
margin-left: -15px;
width: 100%;
.toc-wrapper, & > section {
display: table-cell;
vertical-align: top;
}
.toc-wrapper {
max-width: 230px;
width: 25%;
padding: 5px;
padding-right: 25px;
}
.toc {
font-family: $textfont;
position: -webkit-sticky;
position: sticky;
top: 12px;
margin-left: -40px;
background: #fff;
padding: 5px;
box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.2);
ul {
list-style: none;
padding: 0;
}
a {
display: block;
color: inherit;
font-weight: normal;
border-radius: 7px;
padding: 5px;
line-height: 1;
&:hover {
color: $fond;
}
}
.toc-h1 a {
font-weight: 900;
}
.toc-h2 {
margin-top: 10px;
font-weight: 400;
}
.toc-h3 a {
font-weight: 300;
}
.toc-active a {
color: darken($vert, 20);
}
}
}
}
.misc-hdr {
display:table;
width: 100%;
border-bottom: 1px solid #ccc;
& > * {
display: table-cell;
vertical-align: bottom;
}
h1, h3 {
width: 100%;
padding-right: 5px;
}
.dates {
width: 50px;
background-color: darken($rouge, 20);
color: #fff;
padding: 3px 10px;
border-radius: 5px 5px 0 0;
font-family: $textfont;
font-size: 0.8em;
text-align: center;
span {
display:block;
}
.year {
font-size: 1.8em;
}
}
}
// Bandeau pour passer en public ou éditer
.edit-box {
background: #eee;
margin: 10px;
padding: 10px 20px;
text-align: center;
&.public {
background: lighten($vert, 40%);
border: 1px solid $vert * 0.7;
}
&.prive {
background: lighten($rouge, 40%);
border: 1px solid $rouge * 0.7;
}
}

View file

@ -268,279 +268,7 @@ ul.infos {
// //
// Détail d'un stage // Détail d'un stage
article.stage .avis, div.tinymce { @import "_stage_detail.scss";
ul, ol {
list-style: unset;
padding-left: 20px;
}
}
article.stage {
font-weight: normal;
font-family: $paragraphfont;
h2 {
background: desaturate(lighten($jaune, 15%), 40%);
color: #000;
padding: 10px 20px;
margin: -20px;
margin-bottom: 5px;
text-shadow: -3px 3px 0 rgba(#fff, 0.3);
}
h3 {
//border-bottom: 2px solid desaturate($compl, 40%);
margin-top: 30px;
padding: 5px;
padding-left: 0px;
color: darken($vert, 20);
text-shadow: -3px 3px 0 rgba($vert, 0.1);
//margin-right: 25px;
}
section {
&.avis section {
max-width: 700px;
background: #fff;
padding: 14px;
margin: 30px auto;
}
&:first-child {
margin-top: 0;
h3 {
margin-top: 0;
}
}
#stage-map {
height: 300px;
width: 100%;
}
&.misc {
padding-top: 0;
margin-bottom: 30px;
.misc-content {
&.withmap {
display:table;
width: 100%;
direction: rtl;
& > div {
direction: ltr;
display:table-cell;
vertical-align: top;
}
.map {
min-width: 250px;
width: 30%;
min-height: 300px;
vertical-align: middle;
}
.desc {
padding: 5px;
padding-left: 15px;
}
}
}
}
.chapo, .avis-texte {
margin-bottom: 15px;
background: #fff;
padding: 0 20px;
}
.avis-texte {
font-size: $textfontsize - 1px;
}
.chapo {
font-size: 1.1em;
//font-family: $textfont;
font-weight: 700;
padding-left: 0px;
}
.avis-texte {
//border-left: 1px solid #ccc;
padding-left: 15px;
}
.plusmoins {
max-width: 600px;
margin: 15px auto;
margin-top: 40px;
& > div {
display: table;
width: 100%;
&:before {
content: "&nbsp";
width: 90px;
font-size: 1.8em;
font-weight: bold;
text-align: right;
padding-right: 12px;
}
& > *, &:before {
display:table-cell;
}
& > div {
padding: 15px;
color: #fff;
h4 {
font-weight: normal;
margin-left: -5px;
font-size: 0.9em;
opacity: 0.9;
}
p {
font-weight: bold;
margin: 2px;
}
}
}
.plus {
& > div {
background: darken($vert, 5%);
}
&:before {
content: "Les +";
vertical-align: bottom;
color: darken($vert, 10%);
}
}
.moins {
& > div {
background: darken($rouge, 5%);
}
&:before {
content: "Les ";
vertical-align: top;
color: darken($rouge, 10%);
}
}
}
}
// Sommaire sur le côté
.section-wrapper {
display: table;
margin-left: -15px;
width: 100%;
.toc-wrapper, & > section {
display: table-cell;
vertical-align: top;
}
.toc-wrapper {
max-width: 230px;
width: 25%;
padding: 5px;
padding-right: 25px;
}
.toc {
font-family: $textfont;
position: -webkit-sticky;
position: sticky;
top: 12px;
margin-left: -40px;
background: #fff;
padding: 5px;
box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.2);
ul {
list-style: none;
padding: 0;
}
a {
display: block;
color: inherit;
font-weight: normal;
border-radius: 7px;
padding: 5px;
line-height: 1;
&:hover {
color: $fond;
}
}
.toc-h1 a {
font-weight: 900;
}
.toc-h2 {
margin-top: 10px;
font-weight: 400;
}
.toc-h3 a {
font-weight: 300;
}
.toc-active a {
color: darken($vert, 20);
}
}
}
}
.misc-hdr {
display:table;
width: 100%;
border-bottom: 1px solid #ccc;
& > * {
display: table-cell;
vertical-align: bottom;
}
h1, h3 {
width: 100%;
padding-right: 5px;
}
.dates {
width: 50px;
background-color: darken($rouge, 20);
color: #fff;
padding: 3px 10px;
border-radius: 5px 5px 0 0;
font-family: $textfont;
font-size: 0.8em;
text-align: center;
span {
display:block;
}
.year {
font-size: 1.8em;
}
}
}
// Bandeau pour passer en public ou éditer
.edit-box {
background: #eee;
margin: 10px;
padding: 10px 20px;
text-align: center;
&.public {
background: lighten($vert, 40%);
border: 1px solid $vert * 0.7;
}
&.prive {
background: lighten($rouge, 40%);
border: 1px solid $rouge * 0.7;
}
}
// //
// //
@ -565,7 +293,7 @@ input, textarea, select, div.tinymce, option, optgroup:before {
input[type='text'], input[type='password'], input[type='text'], input[type='password'],
input[type='email'], textarea, select { input[type='email'], input[type='number'], textarea, select {
border:none; border:none;
border-bottom: 1px solid $fond; border-bottom: 1px solid $fond;
width: 100%; width: 100%;
@ -1034,4 +762,14 @@ article.promo {
} }
} }
//
//
// Recherche
@import "_recherche.scss";
//
//
// Responsive
@import "_responsive.scss"; @import "_responsive.scss";

View file

@ -339,18 +339,18 @@ ul.infos li.lieu {
background-color: #fa6cae; background-color: #fa6cae;
} }
/* line 272, ../../sass/screen.scss */ /* line 4, ../../sass/_stage_detail.scss */
article.stage .avis ul, article.stage .avis ol, div.tinymce ul, div.tinymce ol { article.stage .avis ul, article.stage .avis ol, div.tinymce ul, div.tinymce ol {
list-style: unset; list-style: unset;
padding-left: 20px; padding-left: 20px;
} }
/* line 278, ../../sass/screen.scss */ /* line 10, ../../sass/_stage_detail.scss */
article.stage { article.stage {
font-weight: normal; font-weight: normal;
font-family: "Lato", sans-serif; font-family: "Lato", sans-serif;
} }
/* line 282, ../../sass/screen.scss */ /* line 14, ../../sass/_stage_detail.scss */
article.stage h2 { article.stage h2 {
background: #ddda78; background: #ddda78;
color: #000; color: #000;
@ -359,7 +359,7 @@ article.stage h2 {
margin-bottom: 5px; margin-bottom: 5px;
text-shadow: -3px 3px 0 rgba(255, 255, 255, 0.3); text-shadow: -3px 3px 0 rgba(255, 255, 255, 0.3);
} }
/* line 290, ../../sass/screen.scss */ /* line 22, ../../sass/_stage_detail.scss */
article.stage h3 { article.stage h3 {
margin-top: 30px; margin-top: 30px;
padding: 5px; padding: 5px;
@ -367,87 +367,87 @@ article.stage h3 {
color: #0f4c82; color: #0f4c82;
text-shadow: -3px 3px 0 rgba(26, 130, 221, 0.1); text-shadow: -3px 3px 0 rgba(26, 130, 221, 0.1);
} }
/* line 302, ../../sass/screen.scss */ /* line 34, ../../sass/_stage_detail.scss */
article.stage section.avis section { article.stage section.avis section {
max-width: 700px; max-width: 700px;
background: #fff; background: #fff;
padding: 14px; padding: 14px;
margin: 30px auto; margin: 30px auto;
} }
/* line 309, ../../sass/screen.scss */ /* line 41, ../../sass/_stage_detail.scss */
article.stage section:first-child { article.stage section:first-child {
margin-top: 0; margin-top: 0;
} }
/* line 311, ../../sass/screen.scss */ /* line 43, ../../sass/_stage_detail.scss */
article.stage section:first-child h3 { article.stage section:first-child h3 {
margin-top: 0; margin-top: 0;
} }
/* line 316, ../../sass/screen.scss */ /* line 48, ../../sass/_stage_detail.scss */
article.stage section #stage-map { article.stage section #stage-map {
height: 300px; height: 300px;
width: 100%; width: 100%;
} }
/* line 321, ../../sass/screen.scss */ /* line 53, ../../sass/_stage_detail.scss */
article.stage section.misc { article.stage section.misc {
padding-top: 0; padding-top: 0;
margin-bottom: 30px; margin-bottom: 30px;
} }
/* line 326, ../../sass/screen.scss */ /* line 58, ../../sass/_stage_detail.scss */
article.stage section.misc .misc-content.withmap { article.stage section.misc .misc-content.withmap {
display: table; display: table;
width: 100%; width: 100%;
direction: rtl; direction: rtl;
} }
/* line 331, ../../sass/screen.scss */ /* line 63, ../../sass/_stage_detail.scss */
article.stage section.misc .misc-content.withmap > div { article.stage section.misc .misc-content.withmap > div {
direction: ltr; direction: ltr;
display: table-cell; display: table-cell;
vertical-align: top; vertical-align: top;
} }
/* line 336, ../../sass/screen.scss */ /* line 68, ../../sass/_stage_detail.scss */
article.stage section.misc .misc-content.withmap .map { article.stage section.misc .misc-content.withmap .map {
min-width: 250px; min-width: 250px;
width: 30%; width: 30%;
min-height: 300px; min-height: 300px;
vertical-align: middle; vertical-align: middle;
} }
/* line 342, ../../sass/screen.scss */ /* line 74, ../../sass/_stage_detail.scss */
article.stage section.misc .misc-content.withmap .desc { article.stage section.misc .misc-content.withmap .desc {
padding: 5px; padding: 5px;
padding-left: 15px; padding-left: 15px;
} }
/* line 350, ../../sass/screen.scss */ /* line 82, ../../sass/_stage_detail.scss */
article.stage section .chapo, article.stage section .avis-texte { article.stage section .chapo, article.stage section .avis-texte {
margin-bottom: 15px; margin-bottom: 15px;
background: #fff; background: #fff;
padding: 0 20px; padding: 0 20px;
} }
/* line 355, ../../sass/screen.scss */ /* line 87, ../../sass/_stage_detail.scss */
article.stage section .avis-texte { article.stage section .avis-texte {
font-size: 18px; font-size: 18px;
} }
/* line 359, ../../sass/screen.scss */ /* line 91, ../../sass/_stage_detail.scss */
article.stage section .chapo { article.stage section .chapo {
font-size: 1.1em; font-size: 1.1em;
font-weight: 700; font-weight: 700;
padding-left: 0px; padding-left: 0px;
} }
/* line 365, ../../sass/screen.scss */ /* line 97, ../../sass/_stage_detail.scss */
article.stage section .avis-texte { article.stage section .avis-texte {
padding-left: 15px; padding-left: 15px;
} }
/* line 370, ../../sass/screen.scss */ /* line 102, ../../sass/_stage_detail.scss */
article.stage section .plusmoins { article.stage section .plusmoins {
max-width: 600px; max-width: 600px;
margin: 15px auto; margin: 15px auto;
margin-top: 40px; margin-top: 40px;
} }
/* line 375, ../../sass/screen.scss */ /* line 107, ../../sass/_stage_detail.scss */
article.stage section .plusmoins > div { article.stage section .plusmoins > div {
display: table; display: table;
width: 100%; width: 100%;
} }
/* line 379, ../../sass/screen.scss */ /* line 111, ../../sass/_stage_detail.scss */
article.stage section .plusmoins > div:before { article.stage section .plusmoins > div:before {
content: "&nbsp"; content: "&nbsp";
width: 90px; width: 90px;
@ -456,66 +456,66 @@ article.stage section .plusmoins > div:before {
text-align: right; text-align: right;
padding-right: 12px; padding-right: 12px;
} }
/* line 388, ../../sass/screen.scss */ /* line 120, ../../sass/_stage_detail.scss */
article.stage section .plusmoins > div > *, article.stage section .plusmoins > div:before { article.stage section .plusmoins > div > *, article.stage section .plusmoins > div:before {
display: table-cell; display: table-cell;
} }
/* line 392, ../../sass/screen.scss */ /* line 124, ../../sass/_stage_detail.scss */
article.stage section .plusmoins > div > div { article.stage section .plusmoins > div > div {
padding: 15px; padding: 15px;
color: #fff; color: #fff;
} }
/* line 395, ../../sass/screen.scss */ /* line 127, ../../sass/_stage_detail.scss */
article.stage section .plusmoins > div > div h4 { article.stage section .plusmoins > div > div h4 {
font-weight: normal; font-weight: normal;
margin-left: -5px; margin-left: -5px;
font-size: 0.9em; font-size: 0.9em;
opacity: 0.9; opacity: 0.9;
} }
/* line 401, ../../sass/screen.scss */ /* line 133, ../../sass/_stage_detail.scss */
article.stage section .plusmoins > div > div p { article.stage section .plusmoins > div > div p {
font-weight: bold; font-weight: bold;
margin: 2px; margin: 2px;
} }
/* line 409, ../../sass/screen.scss */ /* line 141, ../../sass/_stage_detail.scss */
article.stage section .plusmoins .plus > div { article.stage section .plusmoins .plus > div {
background: #1775c6; background: #1775c6;
} }
/* line 412, ../../sass/screen.scss */ /* line 144, ../../sass/_stage_detail.scss */
article.stage section .plusmoins .plus:before { article.stage section .plusmoins .plus:before {
content: "Les +"; content: "Les +";
vertical-align: bottom; vertical-align: bottom;
color: #1567af; color: #1567af;
} }
/* line 419, ../../sass/screen.scss */ /* line 151, ../../sass/_stage_detail.scss */
article.stage section .plusmoins .moins > div { article.stage section .plusmoins .moins > div {
background: #df076c; background: #df076c;
} }
/* line 422, ../../sass/screen.scss */ /* line 154, ../../sass/_stage_detail.scss */
article.stage section .plusmoins .moins:before { article.stage section .plusmoins .moins:before {
content: "Les "; content: "Les ";
vertical-align: top; vertical-align: top;
color: #c70660; color: #c70660;
} }
/* line 433, ../../sass/screen.scss */ /* line 165, ../../sass/_stage_detail.scss */
article.stage .section-wrapper { article.stage .section-wrapper {
display: table; display: table;
margin-left: -15px; margin-left: -15px;
width: 100%; width: 100%;
} }
/* line 438, ../../sass/screen.scss */ /* line 170, ../../sass/_stage_detail.scss */
article.stage .section-wrapper .toc-wrapper, article.stage .section-wrapper > section { article.stage .section-wrapper .toc-wrapper, article.stage .section-wrapper > section {
display: table-cell; display: table-cell;
vertical-align: top; vertical-align: top;
} }
/* line 442, ../../sass/screen.scss */ /* line 174, ../../sass/_stage_detail.scss */
article.stage .section-wrapper .toc-wrapper { article.stage .section-wrapper .toc-wrapper {
max-width: 230px; max-width: 230px;
width: 25%; width: 25%;
padding: 5px; padding: 5px;
padding-right: 25px; padding-right: 25px;
} }
/* line 448, ../../sass/screen.scss */ /* line 180, ../../sass/_stage_detail.scss */
article.stage .section-wrapper .toc { article.stage .section-wrapper .toc {
font-family: "Dosis", sans-serif; font-family: "Dosis", sans-serif;
position: -webkit-sticky; position: -webkit-sticky;
@ -526,12 +526,12 @@ article.stage .section-wrapper .toc {
padding: 5px; padding: 5px;
box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.2); box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.2);
} }
/* line 458, ../../sass/screen.scss */ /* line 190, ../../sass/_stage_detail.scss */
article.stage .section-wrapper .toc ul { article.stage .section-wrapper .toc ul {
list-style: none; list-style: none;
padding: 0; padding: 0;
} }
/* line 463, ../../sass/screen.scss */ /* line 195, ../../sass/_stage_detail.scss */
article.stage .section-wrapper .toc a { article.stage .section-wrapper .toc a {
display: block; display: block;
color: inherit; color: inherit;
@ -540,45 +540,45 @@ article.stage .section-wrapper .toc a {
padding: 5px; padding: 5px;
line-height: 1; line-height: 1;
} }
/* line 471, ../../sass/screen.scss */ /* line 203, ../../sass/_stage_detail.scss */
article.stage .section-wrapper .toc a:hover { article.stage .section-wrapper .toc a:hover {
color: #8fcc33; color: #8fcc33;
} }
/* line 475, ../../sass/screen.scss */ /* line 207, ../../sass/_stage_detail.scss */
article.stage .section-wrapper .toc .toc-h1 a { article.stage .section-wrapper .toc .toc-h1 a {
font-weight: 900; font-weight: 900;
} }
/* line 478, ../../sass/screen.scss */ /* line 210, ../../sass/_stage_detail.scss */
article.stage .section-wrapper .toc .toc-h2 { article.stage .section-wrapper .toc .toc-h2 {
margin-top: 10px; margin-top: 10px;
font-weight: 400; font-weight: 400;
} }
/* line 482, ../../sass/screen.scss */ /* line 214, ../../sass/_stage_detail.scss */
article.stage .section-wrapper .toc .toc-h3 a { article.stage .section-wrapper .toc .toc-h3 a {
font-weight: 300; font-weight: 300;
} }
/* line 485, ../../sass/screen.scss */ /* line 217, ../../sass/_stage_detail.scss */
article.stage .section-wrapper .toc .toc-active a { article.stage .section-wrapper .toc .toc-active a {
color: #0f4c82; color: #0f4c82;
} }
/* line 492, ../../sass/screen.scss */ /* line 224, ../../sass/_stage_detail.scss */
.misc-hdr { .misc-hdr {
display: table; display: table;
width: 100%; width: 100%;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
} }
/* line 497, ../../sass/screen.scss */ /* line 229, ../../sass/_stage_detail.scss */
.misc-hdr > * { .misc-hdr > * {
display: table-cell; display: table-cell;
vertical-align: bottom; vertical-align: bottom;
} }
/* line 502, ../../sass/screen.scss */ /* line 234, ../../sass/_stage_detail.scss */
.misc-hdr h1, .misc-hdr h3 { .misc-hdr h1, .misc-hdr h3 {
width: 100%; width: 100%;
padding-right: 5px; padding-right: 5px;
} }
/* line 506, ../../sass/screen.scss */ /* line 238, ../../sass/_stage_detail.scss */
.misc-hdr .dates { .misc-hdr .dates {
width: 50px; width: 50px;
background-color: #950548; background-color: #950548;
@ -589,34 +589,34 @@ article.stage .section-wrapper .toc .toc-active a {
font-size: 0.8em; font-size: 0.8em;
text-align: center; text-align: center;
} }
/* line 516, ../../sass/screen.scss */ /* line 248, ../../sass/_stage_detail.scss */
.misc-hdr .dates span { .misc-hdr .dates span {
display: block; display: block;
} }
/* line 519, ../../sass/screen.scss */ /* line 251, ../../sass/_stage_detail.scss */
.misc-hdr .dates .year { .misc-hdr .dates .year {
font-size: 1.8em; font-size: 1.8em;
} }
/* line 527, ../../sass/screen.scss */ /* line 259, ../../sass/_stage_detail.scss */
.edit-box { .edit-box {
background: #eee; background: #eee;
margin: 10px; margin: 10px;
padding: 10px 20px; padding: 10px 20px;
text-align: center; text-align: center;
} }
/* line 533, ../../sass/screen.scss */ /* line 265, ../../sass/_stage_detail.scss */
.edit-box.public { .edit-box.public {
background: #cae3f9; background: #cae3f9;
border: 1px solid #125b9b; border: 1px solid #125b9b;
} }
/* line 538, ../../sass/screen.scss */ /* line 270, ../../sass/_stage_detail.scss */
.edit-box.prive { .edit-box.prive {
background: #fdcfe4; background: #fdcfe4;
border: 1px solid #ad0654; border: 1px solid #ad0654;
} }
/* line 551, ../../sass/screen.scss */ /* line 279, ../../sass/screen.scss */
input, textarea, select, div.tinymce, option, optgroup:before { input, textarea, select, div.tinymce, option, optgroup:before {
background: #fff; background: #fff;
font-size: 1em; font-size: 1em;
@ -626,15 +626,15 @@ input, textarea, select, div.tinymce, option, optgroup:before {
padding: 5px; padding: 5px;
text-align: left; text-align: left;
} }
/* line 560, ../../sass/screen.scss */ /* line 288, ../../sass/screen.scss */
input:focus, input.mce-edit-focus, textarea:focus, textarea.mce-edit-focus, select:focus, select.mce-edit-focus, div.tinymce:focus, div.tinymce.mce-edit-focus, option:focus, option.mce-edit-focus, optgroup:before:focus, optgroup:before.mce-edit-focus { input:focus, input.mce-edit-focus, textarea:focus, textarea.mce-edit-focus, select:focus, select.mce-edit-focus, div.tinymce:focus, div.tinymce.mce-edit-focus, option:focus, option.mce-edit-focus, optgroup:before:focus, optgroup:before.mce-edit-focus {
background-color: #e9f5d6; background-color: #e9f5d6;
outline: none; outline: none;
} }
/* line 567, ../../sass/screen.scss */ /* line 295, ../../sass/screen.scss */
input[type='text'], input[type='password'], input[type='text'], input[type='password'],
input[type='email'], textarea, select { input[type='email'], input[type='number'], textarea, select {
border: none; border: none;
border-bottom: 1px solid #8fcc33; border-bottom: 1px solid #8fcc33;
width: 100%; width: 100%;
@ -642,7 +642,7 @@ input[type='email'], textarea, select {
transition: border 1s ease-out, background 1s ease-out; transition: border 1s ease-out, background 1s ease-out;
} }
/* line 576, ../../sass/screen.scss */ /* line 304, ../../sass/screen.scss */
select { select {
-moz-appearance: none; -moz-appearance: none;
appearance: none; appearance: none;
@ -650,21 +650,21 @@ select {
margin-right: 5px; margin-right: 5px;
cursor: pointer; cursor: pointer;
} }
/* line 583, ../../sass/screen.scss */ /* line 311, ../../sass/screen.scss */
select option { select option {
padding: 3px; padding: 3px;
white-space: pre-wrap; white-space: pre-wrap;
} }
/* line 589, ../../sass/screen.scss */ /* line 317, ../../sass/screen.scss */
select optgroup option { select optgroup option {
padding-left: 10px; padding-left: 10px;
} }
/* line 592, ../../sass/screen.scss */ /* line 320, ../../sass/screen.scss */
select optgroup:before { select optgroup:before {
font-weight: bold; font-weight: bold;
} }
/* line 598, ../../sass/screen.scss */ /* line 326, ../../sass/screen.scss */
input[type="submit"], .btn { input[type="submit"], .btn {
font: 19px "Dosis", sans-serif; font: 19px "Dosis", sans-serif;
background-color: #8fcc33; background-color: #8fcc33;
@ -675,17 +675,17 @@ input[type="submit"], .btn {
display: inline-block; display: inline-block;
} }
/* line 608, ../../sass/screen.scss */ /* line 336, ../../sass/screen.scss */
p.submits { p.submits {
text-align: right; text-align: right;
} }
/* line 612, ../../sass/screen.scss */ /* line 340, ../../sass/screen.scss */
form .commentaire { form .commentaire {
font-style: italic; font-style: italic;
} }
/* line 616, ../../sass/screen.scss */ /* line 344, ../../sass/screen.scss */
.edit-btn { .edit-btn {
border-color: #706c00; border-color: #706c00;
color: #000; color: #000;
@ -694,14 +694,14 @@ form .commentaire {
background-origin: content-box; background-origin: content-box;
background-size: contain; background-size: contain;
} }
/* line 624, ../../sass/screen.scss */ /* line 352, ../../sass/screen.scss */
.edit-btn:after { .edit-btn:after {
content: ""; content: "";
width: 30px; width: 30px;
display: inline-block; display: inline-block;
} }
/* line 631, ../../sass/screen.scss */ /* line 359, ../../sass/screen.scss */
textarea, div.tinymce { textarea, div.tinymce {
font-family: "Lato", sans-serif; font-family: "Lato", sans-serif;
border: none; border: none;
@ -711,20 +711,20 @@ textarea, div.tinymce {
transition: border 1s ease-out, background 1s ease-out; transition: border 1s ease-out, background 1s ease-out;
} }
/* line 640, ../../sass/screen.scss */ /* line 368, ../../sass/screen.scss */
textarea { textarea {
height: 200px; height: 200px;
resize: vertical; resize: vertical;
} }
/* line 648, ../../sass/screen.scss */ /* line 376, ../../sass/screen.scss */
form .field { form .field {
margin: 5px 0; margin: 5px 0;
display: flex; display: flex;
background: #fff; background: #fff;
padding: 10px; padding: 10px;
} }
/* line 654, ../../sass/screen.scss */ /* line 382, ../../sass/screen.scss */
form .field label, form .field .label { form .field label, form .field .label {
display: inline-block; display: inline-block;
width: 250px; width: 250px;
@ -733,39 +733,39 @@ form .field label, form .field .label {
padding-top: 5px; padding-top: 5px;
flex-shrink: 0; flex-shrink: 0;
} }
/* line 662, ../../sass/screen.scss */ /* line 390, ../../sass/screen.scss */
form .field label.required:before, form .field .label.required:before { form .field label.required:before, form .field .label.required:before {
margin-right: 5px; margin-right: 5px;
content: "*"; content: "*";
color: #f70978; color: #f70978;
} }
/* line 668, ../../sass/screen.scss */ /* line 396, ../../sass/screen.scss */
form .field label { form .field label {
font-family: Alegreya, serif; font-family: Alegreya, serif;
font-weight: bold; font-weight: bold;
} }
/* line 672, ../../sass/screen.scss */ /* line 400, ../../sass/screen.scss */
form .field .help_text { form .field .help_text {
font-style: italic; font-style: italic;
font-size: 0.9em; font-size: 0.9em;
} }
/* line 676, ../../sass/screen.scss */ /* line 404, ../../sass/screen.scss */
form .field .input { form .field .input {
display: inline-block; display: inline-block;
flex-grow: 1; flex-grow: 1;
margin-right: 10px; margin-right: 10px;
} }
/* line 686, ../../sass/screen.scss */ /* line 414, ../../sass/screen.scss */
ul.as-selections { ul.as-selections {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
/* line 690, ../../sass/screen.scss */ /* line 418, ../../sass/screen.scss */
ul.as-selections li { ul.as-selections li {
display: inline-block; display: inline-block;
} }
/* line 694, ../../sass/screen.scss */ /* line 422, ../../sass/screen.scss */
ul.as-selections .as-selection-item { ul.as-selections .as-selection-item {
padding: 0 5px; padding: 0 5px;
background: #f99b20; background: #f99b20;
@ -774,52 +774,52 @@ ul.as-selections .as-selection-item {
border-radius: 2px; border-radius: 2px;
font-weight: 500; font-weight: 500;
} }
/* line 702, ../../sass/screen.scss */ /* line 430, ../../sass/screen.scss */
ul.as-selections .as-selection-item a.as-close { ul.as-selections .as-selection-item a.as-close {
color: #fff; color: #fff;
-webkit-cursor: pointer; -webkit-cursor: pointer;
cursor: pointer; cursor: pointer;
margin-right: 5px; margin-right: 5px;
} }
/* line 709, ../../sass/screen.scss */ /* line 437, ../../sass/screen.scss */
ul.as-selections .as-selection-item.selected { ul.as-selections .as-selection-item.selected {
background: #8fcc33; background: #8fcc33;
} }
/* line 714, ../../sass/screen.scss */ /* line 442, ../../sass/screen.scss */
ul.as-selections .as-original { ul.as-selections .as-original {
flex-grow: 1; flex-grow: 1;
min-width: 200px; min-width: 200px;
} }
/* line 718, ../../sass/screen.scss */ /* line 446, ../../sass/screen.scss */
ul.as-selections .as-original input { ul.as-selections .as-original input {
width: 100%; width: 100%;
} }
/* line 724, ../../sass/screen.scss */ /* line 452, ../../sass/screen.scss */
div.as-results { div.as-results {
position: relative; position: relative;
} }
/* line 726, ../../sass/screen.scss */ /* line 454, ../../sass/screen.scss */
div.as-results ul { div.as-results ul {
position: absolute; position: absolute;
width: 100%; width: 100%;
background: #fff; background: #fff;
border: 1px solid #d2ebad; border: 1px solid #d2ebad;
} }
/* line 733, ../../sass/screen.scss */ /* line 461, ../../sass/screen.scss */
div.as-results ul li { div.as-results ul li {
padding: 3px 5px; padding: 3px 5px;
} }
/* line 739, ../../sass/screen.scss */ /* line 467, ../../sass/screen.scss */
div.as-results ul li.as-result-item.active { div.as-results ul li.as-result-item.active {
background: #fddeb5; background: #fddeb5;
} }
/* line 744, ../../sass/screen.scss */ /* line 472, ../../sass/screen.scss */
div.as-results ul li.as-message { div.as-results ul li.as-message {
font-style: italic; font-style: italic;
} }
/* line 754, ../../sass/screen.scss */ /* line 482, ../../sass/screen.scss */
.window { .window {
display: none; display: none;
position: fixed; position: fixed;
@ -830,11 +830,11 @@ div.as-results ul li.as-message {
left: 0; left: 0;
z-index: 50; z-index: 50;
} }
/* line 764, ../../sass/screen.scss */ /* line 492, ../../sass/screen.scss */
.window.visible { .window.visible {
display: block; display: block;
} }
/* line 768, ../../sass/screen.scss */ /* line 496, ../../sass/screen.scss */
.window .window-bg { .window .window-bg {
background: #000; background: #000;
opacity: 0.7; opacity: 0.7;
@ -845,7 +845,7 @@ div.as-results ul li.as-message {
top: 0; top: 0;
z-index: -1; z-index: -1;
} }
/* line 779, ../../sass/screen.scss */ /* line 507, ../../sass/screen.scss */
.window .window-content { .window .window-content {
position: relative; position: relative;
margin: 0 auto; margin: 0 auto;
@ -859,11 +859,11 @@ div.as-results ul li.as-message {
max-height: 100%; max-height: 100%;
overflow: auto; overflow: auto;
} }
/* line 793, ../../sass/screen.scss */ /* line 521, ../../sass/screen.scss */
.window .window-content form label, .window .window-content form .label { .window .window-content form label, .window .window-content form .label {
width: 150px; width: 150px;
} }
/* line 799, ../../sass/screen.scss */ /* line 527, ../../sass/screen.scss */
.window .window-closer { .window .window-closer {
position: absolute; position: absolute;
top: 0; top: 0;
@ -871,65 +871,65 @@ div.as-results ul li.as-message {
padding: 12px; padding: 12px;
z-index: 3; z-index: 3;
} }
/* line 805, ../../sass/screen.scss */ /* line 533, ../../sass/screen.scss */
.window .window-closer:after { .window .window-closer:after {
content: "×"; content: "×";
} }
/* line 816, ../../sass/screen.scss */ /* line 544, ../../sass/screen.scss */
#lieu_widget .lieu-ui { #lieu_widget .lieu-ui {
position: relative; position: relative;
} }
/* line 818, ../../sass/screen.scss */ /* line 546, ../../sass/screen.scss */
#lieu_widget .lieu-ui .map { #lieu_widget .lieu-ui .map {
height: 400px; height: 400px;
width: 100%; width: 100%;
} }
/* line 822, ../../sass/screen.scss */ /* line 550, ../../sass/screen.scss */
#lieu_widget .lieu-ui.hidden { #lieu_widget .lieu-ui.hidden {
display: none; display: none;
} }
/* line 825, ../../sass/screen.scss */ /* line 553, ../../sass/screen.scss */
#lieu_widget .lieu-ui .masked { #lieu_widget .lieu-ui .masked {
visibility: hidden; visibility: hidden;
} }
/* line 830, ../../sass/screen.scss */ /* line 558, ../../sass/screen.scss */
#lieu_widget .lieu-choixmodif { #lieu_widget .lieu-choixmodif {
display: none; display: none;
} }
/* line 835, ../../sass/screen.scss */ /* line 563, ../../sass/screen.scss */
#lieu_widget.modif .lieu-choixmodif { #lieu_widget.modif .lieu-choixmodif {
display: unset; display: unset;
} }
/* line 840, ../../sass/screen.scss */ /* line 568, ../../sass/screen.scss */
#lieu_widget.modif .lieu-ui, #lieu_widget.attente .lieu-ui { #lieu_widget.modif .lieu-ui, #lieu_widget.attente .lieu-ui {
display: none; display: none;
} }
/* line 847, ../../sass/screen.scss */ /* line 575, ../../sass/screen.scss */
#lieu_widget.edit .lieu-ui .lieu-acinput { #lieu_widget.edit .lieu-ui .lieu-acinput {
display: none; display: none;
} }
/* line 850, ../../sass/screen.scss */ /* line 578, ../../sass/screen.scss */
#lieu_widget.edit .lieu-ui .map { #lieu_widget.edit .lieu-ui .map {
height: 200px; height: 200px;
} }
/* line 856, ../../sass/screen.scss */ /* line 584, ../../sass/screen.scss */
#lieu_widget #avis_lieu_vide { #lieu_widget #avis_lieu_vide {
display: none; display: none;
} }
/* line 860, ../../sass/screen.scss */ /* line 588, ../../sass/screen.scss */
#lieu_widget .message { #lieu_widget .message {
background: #fddeb5; background: #fddeb5;
padding: 5px; padding: 5px;
font-style: italic; font-style: italic;
font-size: 0.9em; font-size: 0.9em;
} }
/* line 866, ../../sass/screen.scss */ /* line 594, ../../sass/screen.scss */
#lieu_widget .message.hidden { #lieu_widget .message.hidden {
display: none; display: none;
} }
/* line 872, ../../sass/screen.scss */ /* line 600, ../../sass/screen.scss */
a.lieu-change { a.lieu-change {
color: #fff; color: #fff;
background: #f99b20; background: #f99b20;
@ -942,25 +942,25 @@ a.lieu-change {
border-radius: 5px; border-radius: 5px;
margin-right: 7px; margin-right: 7px;
} }
/* line 884, ../../sass/screen.scss */ /* line 612, ../../sass/screen.scss */
a.lieu-change.ajout:before { a.lieu-change.ajout:before {
content: "+"; content: "+";
margin-right: 5px; margin-right: 5px;
} }
/* line 890, ../../sass/screen.scss */ /* line 618, ../../sass/screen.scss */
#stages-map { #stages-map {
width: 100%; width: 100%;
height: 600px; height: 600px;
max-height: 90vh; max-height: 90vh;
} }
/* line 897, ../../sass/screen.scss */ /* line 625, ../../sass/screen.scss */
#id_stage-thematiques { #id_stage-thematiques {
display: none; display: none;
} }
/* line 903, ../../sass/screen.scss */ /* line 631, ../../sass/screen.scss */
.homeh1 { .homeh1 {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -970,22 +970,22 @@ a.lieu-change.ajout:before {
border-bottom: 3px solid #000; border-bottom: 3px solid #000;
margin-bottom: 15px; margin-bottom: 15px;
} }
/* line 912, ../../sass/screen.scss */ /* line 640, ../../sass/screen.scss */
.homeh1 > * { .homeh1 > * {
display: inline-block; display: inline-block;
} }
/* line 915, ../../sass/screen.scss */ /* line 643, ../../sass/screen.scss */
.homeh1 p { .homeh1 p {
text-align: right; text-align: right;
} }
/* line 920, ../../sass/screen.scss */ /* line 648, ../../sass/screen.scss */
.betacadre { .betacadre {
background: #fa6cae; background: #fa6cae;
padding: 10px; padding: 10px;
} }
/* line 925, ../../sass/screen.scss */ /* line 653, ../../sass/screen.scss */
.entrer { .entrer {
background: #fff; background: #fff;
max-width: 500px; max-width: 500px;
@ -994,84 +994,84 @@ a.lieu-change.ajout:before {
margin: 15px auto; margin: 15px auto;
} }
/* line 933, ../../sass/screen.scss */ /* line 661, ../../sass/screen.scss */
article.promo { article.promo {
display: block; display: block;
font-size: 1.1em; font-size: 1.1em;
} }
/* line 937, ../../sass/screen.scss */ /* line 665, ../../sass/screen.scss */
article.promo .explications { article.promo .explications {
display: table; display: table;
} }
/* line 940, ../../sass/screen.scss */ /* line 668, ../../sass/screen.scss */
article.promo .explications:first-child { article.promo .explications:first-child {
direction: rtl; direction: rtl;
} }
/* line 942, ../../sass/screen.scss */ /* line 670, ../../sass/screen.scss */
article.promo .explications:first-child > * { article.promo .explications:first-child > * {
direction: ltr; direction: ltr;
} }
/* line 947, ../../sass/screen.scss */ /* line 675, ../../sass/screen.scss */
article.promo .explications > div { article.promo .explications > div {
display: table-cell; display: table-cell;
vertical-align: middle; vertical-align: middle;
text-align: center; text-align: center;
} }
/* line 952, ../../sass/screen.scss */ /* line 680, ../../sass/screen.scss */
article.promo .explications > div p { article.promo .explications > div p {
margin: 15px 15px; margin: 15px 15px;
} }
/* line 960, ../../sass/screen.scss */ /* line 688, ../../sass/screen.scss */
.faq-toc { .faq-toc {
font-family: "Lato", sans-serif; font-family: "Lato", sans-serif;
display: block; display: block;
max-width: 700px; max-width: 700px;
margin: 0 auto; margin: 0 auto;
} }
/* line 965, ../../sass/screen.scss */ /* line 693, ../../sass/screen.scss */
.faq-toc ul { .faq-toc ul {
margin: 20px; margin: 20px;
} }
/* line 969, ../../sass/screen.scss */ /* line 697, ../../sass/screen.scss */
.faq-toc ul li a { .faq-toc ul li a {
color: #000; color: #000;
display: block; display: block;
padding: 5px; padding: 5px;
} }
/* line 975, ../../sass/screen.scss */ /* line 703, ../../sass/screen.scss */
.faq-toc ul li.toc-h1 { .faq-toc ul li.toc-h1 {
display: none; display: none;
} }
/* line 979, ../../sass/screen.scss */ /* line 707, ../../sass/screen.scss */
.faq-toc ul li.toc-h2 a { .faq-toc ul li.toc-h2 a {
background: #fcc883; background: #fcc883;
} }
/* line 983, ../../sass/screen.scss */ /* line 711, ../../sass/screen.scss */
.faq-toc ul li.toc-h3 a { .faq-toc ul li.toc-h3 a {
padding-left: 10px; padding-left: 10px;
background: #fff; background: #fff;
font-weight: normal; font-weight: normal;
} }
/* line 989, ../../sass/screen.scss */ /* line 717, ../../sass/screen.scss */
.faq-toc ul li a:hover { .faq-toc ul li a:hover {
color: #395214; color: #395214;
background: #bce085 !important; background: #bce085 !important;
} }
/* line 998, ../../sass/screen.scss */ /* line 726, ../../sass/screen.scss */
.faq article { .faq article {
background: #fff; background: #fff;
padding: 15px; padding: 15px;
} }
/* line 1001, ../../sass/screen.scss */ /* line 729, ../../sass/screen.scss */
.faq article h2 { .faq article h2 {
background-color: #fcc883; background-color: #fcc883;
color: #ae6505; color: #ae6505;
margin: -15px; margin: -15px;
padding: 15px; padding: 15px;
} }
/* line 1008, ../../sass/screen.scss */ /* line 736, ../../sass/screen.scss */
.faq article h3 { .faq article h3 {
color: #0f4c82; color: #0f4c82;
background-color: #9dcbf3; background-color: #9dcbf3;
@ -1079,19 +1079,19 @@ article.promo .explications > div p {
margin-top: 30px; margin-top: 30px;
padding: 10px 15px; padding: 10px 15px;
} }
/* line 1015, ../../sass/screen.scss */ /* line 743, ../../sass/screen.scss */
.faq article h3:nth-child(2) { .faq article h3:nth-child(2) {
margin-top: 0; margin-top: 0;
} }
/* line 1020, ../../sass/screen.scss */ /* line 748, ../../sass/screen.scss */
.faq article ul { .faq article ul {
padding-left: 20px; padding-left: 20px;
} }
/* line 1022, ../../sass/screen.scss */ /* line 750, ../../sass/screen.scss */
.faq article ul li { .faq article ul li {
list-style: initial; list-style: initial;
} }
/* line 1027, ../../sass/screen.scss */ /* line 755, ../../sass/screen.scss */
.faq article p, .faq article ul { .faq article p, .faq article ul {
font-family: "Lato", sans-serif; font-family: "Lato", sans-serif;
font-size: 18px; font-size: 18px;
@ -1100,6 +1100,47 @@ article.promo .explications > div p {
margin-right: 5%; margin-right: 5%;
} }
/* line 2, ../../sass/_recherche.scss */
form.recherche .generale {
display: block;
text-align: center;
}
/* line 6, ../../sass/_recherche.scss */
form.recherche .generale input[type="text"] {
max-width: 400px;
}
/* line 12, ../../sass/_recherche.scss */
form.recherche .avancee ul {
display: flexbox;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
width: 100%;
}
/* line 19, ../../sass/_recherche.scss */
form.recherche .avancee ul li {
flex-grow: 1;
width: 40%;
margin: 5px 0;
padding: 0 10px;
}
/* line 25, ../../sass/_recherche.scss */
form.recherche .avancee ul li label {
font-weight: bold;
font-size: 0.9em;
}
/* line 29, ../../sass/_recherche.scss */
form.recherche .avancee ul li input {
display: block;
min-width: 150px;
display: inline-block;
width: 100%;
}
/* line 35, ../../sass/_recherche.scss */
form.recherche .avancee ul li.field__sujet, form.recherche .avancee ul li.field__contexte {
width: 100%;
}
@media screen and (max-width: 850px) { @media screen and (max-width: 850px) {
/* line 2, ../../sass/_responsive.scss */ /* line 2, ../../sass/_responsive.scss */
header { header {

View file

@ -7,7 +7,21 @@
<h1>Résultats de la recherche</h1> <h1>Résultats de la recherche</h1>
<form class="recherche" method="GET" action=""> <form class="recherche" method="GET" action="">
<p>{{ form.generique }} <input type="submit" action="submit" value="Rechercher"/></p> <p class="generale">{{ form.generique }} <input type="submit" action="submit" value="Rechercher"/></p>
<a class="toggle_avancee" href="#">Recherche avancée</a>
<div class="avancee">
<ul>
{% for field in form %}
{% if field != form.generique %}
<li class="field__{{ field.name }}">
{% if field.label %}{{ field.label_tag }}{% endif %}
{{ field }}
</li>
{% endif %}
{% endfor %}
</ul>
<input type="submit" action="submit" value="Rechercher"/>
</div>
</form> </form>
<article> <article>
<ul class="stage-liste"> <ul class="stage-liste">

View file

@ -4,22 +4,117 @@ from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django import forms from django import forms
from django.db.models import Q
from avisstage.documents import StageDocument from .documents import StageDocument
from avisstage.models import Stage from .models import Stage
from .statics import TYPE_LIEU_OPTIONS, TYPE_STAGE_OPTIONS, NIVEAU_SCOL_OPTIONS
from datetime import date
# Recherche # Recherche
class SearchForm(forms.Form): class SearchForm(forms.Form):
generique = forms.CharField() generique = forms.CharField(required=False)
sujet = forms.CharField(label=u'À propos de', required=False)
sujet.full_line = True
apres_annee = forms.IntegerField(label=u'Après cette année', required=False)
avant_annee = forms.IntegerField(label=u'Avant cette année', required=False)
type_stage = forms.ChoiceField(label="", choices=([('', u'Type de stage')]
+ list(TYPE_STAGE_OPTIONS)),
required=False)
niveau_scol = forms.ChoiceField(label="", choices=([('', u'Année d\'études')]
+ list(NIVEAU_SCOL_OPTIONS)),
required=False)
contexte = forms.CharField(label=u'Contexte (lieu, encadrant⋅e⋅s, structure)',
required=False)
type_lieu = forms.ChoiceField(choices=([('', u'Type de lieu d\'accueil')]
+ list(TYPE_LIEU_OPTIONS)),
required=False)
tri = forms.ChoiceField(label=u'Trier par',
choices=[('pertinence', u'Par pertinence'),
('-date_maj',u'Par dernière mise à jour')],
required=False, initial='pertinence')
def cherche(**kwargs): def cherche(**kwargs):
resultat = [] filtres = Q(public=True)
if "generique" in kwargs: dsl = StageDocument.search()
resultat = StageDocument.search().filter(
use_dsl = False
def field_relevant(field, test_string=True):
return field in kwargs and \
kwargs[field] is not None and \
((not test_string) or kwargs[field].strip() != '')
#
# Recherche libre
#
# Champ générique : recherche dans tous les champs
if field_relevant("generique"):
print "Filtre generique", kwargs['generique']
dsl = dsl.filter(
"match", "match",
_all={"query": kwargs["generique"], _all={"query": kwargs["generique"],
"fuzziness": "auto"}) "fuzziness": "auto"})
return Stage.objects.filter(id__in=[s._id for s in resultat], public=True) use_dsl = True
# Sujet -> Recherche dan les noms de sujets et les thématiques
if field_relevant("sujet"):
dsl = dsl.filter("multi_match",
query = kwargs["sujet"],
fields = ['sujet^2', 'thematiques'],
fuzziness = "auto")
use_dsl = True
# Contexte -> Encadrants, structure, lieu
if field_relevant("contexte"):
dsl = dsl.filter("multi_match",
query = kwargs["contexte"],
fields = ['encadrants', 'structure^2',
'lieux.nom', 'lieux.pays', 'lieux.ville'],
fuzziness = "auto")
use_dsl = True
#
# Filtres directs db
#
# Dates
if field_relevant('avant_annee', False):
dte = date(kwargs['avant_annee']+1, 1, 1)
filtres &= Q(date_fin__lt=dte)
if field_relevant('apres_annee', False):
dte = date(kwargs['apres_annee'], 1, 1)
filtres &= Q(date_debut__gte=dte)
# Type de stage
if field_relevant('type_stage'):
filtres &= Q(type_stage=kwargs["type_stage"])
if field_relevant('annee_scol'):
filtres &= Q(annee_scol=kwargs["annee_scol"])
# Type de lieu
if field_relevant('type_lieu'):
filtres &= Q(lieux__type_lieu=kwargs["type_lieu"])
# Application
if use_dsl:
filtres &= Q(id__in=[s.meta.id for s in dsl])
print filtres
resultat = Stage.objects.filter(filtres)
if field_relevant('tri') and kwargs['tri'] != 'pertinence':
resultat = resultat.order_by(kwargs['tri'])
return resultat
@login_required @login_required
def recherche(request): def recherche(request):