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
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;
}
}
@import "_stage_detail.scss";
//
//
@ -565,7 +293,7 @@ input, textarea, select, div.tinymce, option, optgroup:before {
input[type='text'], input[type='password'],
input[type='email'], textarea, select {
input[type='email'], input[type='number'], textarea, select {
border:none;
border-bottom: 1px solid $fond;
width: 100%;
@ -1034,4 +762,14 @@ article.promo {
}
}
//
//
// Recherche
@import "_recherche.scss";
//
//
// Responsive
@import "_responsive.scss";

View file

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

View file

@ -7,7 +7,21 @@
<h1>Résultats de la recherche</h1>
<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>
<article>
<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 import forms
from django.db.models import Q
from avisstage.documents import StageDocument
from avisstage.models import Stage
from .documents import StageDocument
from .models import Stage
from .statics import TYPE_LIEU_OPTIONS, TYPE_STAGE_OPTIONS, NIVEAU_SCOL_OPTIONS
from datetime import date
# Recherche
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):
resultat = []
if "generique" in kwargs:
resultat = StageDocument.search().filter(
filtres = Q(public=True)
dsl = StageDocument.search()
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",
_all={"query": kwargs["generique"],
"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
def recherche(request):