From 54535c4007fd1653779960897db59db42cd7ddf8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ga=C3=ABlle=20Morin?= <morin.gaelle@gmail.com>
Date: Fri, 7 Jun 2019 11:01:34 +0200
Subject: [PATCH] ui(job-offer-create): new fields added

- Date field added
- New multiple select
- All css stykes for form reviewed
---
 src/page-job-offer-create.pug |   6 +-
 src/styles/base/form.scss     | 100 +++++++++++++++++++++++-----------
 www/images/arrow-down.svg     |   1 +
 www/images/calendar.svg       |   4 ++
 4 files changed, 79 insertions(+), 32 deletions(-)
 create mode 100644 www/images/arrow-down.svg
 create mode 100644 www/images/calendar.svg

diff --git a/src/page-job-offer-create.pug b/src/page-job-offer-create.pug
index ae0202b0..8b9a437c 100644
--- a/src/page-job-offer-create.pug
+++ b/src/page-job-offer-create.pug
@@ -14,7 +14,7 @@
     data-src=`${sdn}/sources/job-offers/`
     range-skills=`${sdn}/skills/`
 
-    data-fields='title, title-text, description, description-text, skills'
+    data-fields='title, title-text, description, description-text, skills, closingDate'
 
     class-title='field form-label is-light is-expanded'
     label-title='Title*'
@@ -32,6 +32,10 @@
     label-skills='The required skills for this mission:*'
     multiple-skills='sib-multiple-select'
     widget-skills='sib-form-auto-completion'
+
+    class-closingDate='form-label is-dark'
+    label-closingDate='Publication end date:*'
+    widget-closingDate='sib-form-date'
     
     next="job-offers"
   )
diff --git a/src/styles/base/form.scss b/src/styles/base/form.scss
index d50bbf07..f6d878f3 100644
--- a/src/styles/base/form.scss
+++ b/src/styles/base/form.scss
@@ -23,6 +23,7 @@
     }
 
     p.center {
+      margin: 0;
       text-align: center;
     }
 
@@ -41,14 +42,20 @@
       flex-direction: column;
   
       input {
-        -webkit-appearance: none;
+        -webkit-tap-highlight-color: $color-244-73-62;
         background-color: $color-222-57-95;
         border: none;
         color: $color-233-18-29;
-        flex: 1 1 0;
+        /*flex: 1 1 0;  Problem on Firefox for input type date*/ 
         margin-top: 0.8rem;
         min-width: 0;
         padding: 1.2rem;
+        
+        &:focus,
+        &:active {
+          border-color: transparent;
+          border-bottom: 2px solid $color-244-73-62;
+        }
       }
     }
 
@@ -70,25 +77,51 @@
     .form-label {
       font-weight: 600;
 
-      &.is-dark label > div {
+      &.is-dark label {
         color: $color-216-4-22;
+        margin-top: 3rem;
       }
     
-      &.is-light label > div {
+      &.is-light label {
         color: $color-244-10-70;
+        margin-top: 2.2rem;
         text-transform: uppercase;
       }
     }
 
-    .large-margin>p{
-      margin-bottom: 3rem;
-    }
+    /* WIDGETS */
 
-    .small-margin>p {
-      margin-bottom: 2.2rem;
-    }
+    sib-form-date {
 
-    /* WIDGETS */
+      input[type='date'] {
+        color: $color-213-4-50;
+        font-size: 1.4rem;
+        margin-top: 1.6rem;
+        max-width: 48.75vw;
+        background-image: url("/images/calendar.svg");
+        background-position: right 12px top 50%;
+        background-repeat: no-repeat;
+        background-size: 14px;
+        cursor: default;
+        position: relative;
+        
+        &::-webkit-calendar-picker-indicator {
+          cursor: pointer;
+          opacity: 0;
+          position: absolute;
+          right: 8px;
+        }
+
+        &::-webkit-clear-button {
+          cursor: pointer;
+          margin-right: 3px;
+        }
+
+        &::-webkit-inner-spin-button {
+          display: none
+        }
+      }
+    }
 
     sib-multiple-select {
 
@@ -97,8 +130,9 @@
         flex-direction: column;
 
         .ss-main {
+          margin-bottom: 7.8rem;
           margin-top: 1.6rem;
-          width: 70%;
+          max-width: 50vw;
 
           .ss-multi-selected {
             align-items: center;
@@ -107,37 +141,41 @@
             border-radius: 0px;
             display: flex;
             justify-content: flex-end;
-            height: 4.2rem;
-
-            .ss-values {
-              background: transparent;
-              position: absolute;
-              top: 6rem;
-              width: 100%;
-            }
-
-            .ss-disabled {
-              color: transparent;
-            }
+            min-height: 4.2rem;
+            padding-left: 1.2rem;
 
             .ss-add {
-              @include icon('plus');
-              color: $color-244-73-62;
               font-size: 1.8rem;
-              margin: 0px 12px 0 38px;
-              position: absolute;
+              margin: 0 12px 0 0;
 
               span.ss-plus {
-                align-self: center;
-                background: transparent;
+                background: $color-244-73-62;
 
                 &::after {
-                  background: transparent;
+                  background: $color-244-73-62;
                 }
               }
             }
 
             .ss-values {
+              background: transparent;
+              position: absolute;
+              top: 6rem;
+              width: 100%;
+
+              .ss-disabled {
+                color: transparent;
+                font-size: 1.4rem;
+                left: calc(1.2rem - 5px);
+                position: absolute;
+                top: calc(-6rem + 7px);
+
+                &::before {
+                  color: $color-213-4-50;
+                  content: "Select skills";
+                  font-weight: normal;
+                }
+              }
               
               .ss-value {
                 @extend .skill;
diff --git a/www/images/arrow-down.svg b/www/images/arrow-down.svg
new file mode 100644
index 00000000..29607cd4
--- /dev/null
+++ b/www/images/arrow-down.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1.15em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1024 896"><path d="M8 211q0-14 10-24t24-10 24 10l452 452 445-445q10-10 24-10t24 10 10 24-10 24L542 711q-10 10-24 10t-24-10L18 236q-2-2-3.5-4.5t-2.5-5l-2-5-1.5-5L8 211z" fill="#898F95"/><rect x="0" y="0" width="1024" height="896" fill="rgba(0, 0, 0, 0)" /></svg>
\ No newline at end of file
diff --git a/www/images/calendar.svg b/www/images/calendar.svg
new file mode 100644
index 00000000..3aa532e8
--- /dev/null
+++ b/www/images/calendar.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1024 1024">
+  <path d="M960 96H704V32q0-13-9.5-22.5T672 0t-22.5 9.5T640 32v64H384V32q0-13-9.5-22.5T352 0t-22.5 9.5T320 32v64H64q-27 0-45.5 18.5T0 160v800q0 17 8.5 32t23.5 23.5 32 8.5h896q27 0 45.5-19t18.5-45V160q0-18-8.5-32.5t-23.5-23-32-8.5zm0 864H64V160h256v32q0 13 9.5 22.5T352 224t22.5-9.5T384 192v-32h256v32q0 13 9.5 22.5T672 224t22.5-9.5T704 192v-32h256v800zM736 512h64q13 0 22.5-9.5T832 480v-64q0-13-9.5-22.5T800 384h-64q-13 0-22.5 9.5T704 416v64q0 13 9.5 22.5T736 512zm0 256h64q13 0 22.5-9.5T832 736v-64q0-13-9.5-22.5T800 640h-64q-13 0-22.5 9.5T704 672v64q0 13 9.5 22.5T736 768zM544 640h-64q-13 0-22.5 9.5T448 672v64q0 5 1.5 10t4.5 9 7 7 9 4.5 10 1.5h64q13 0 22.5-9.5T576 736v-64q0-4-1-8.5t-3-8-5-6.5-6.5-5-8-3-8.5-1zm0-256h-64q-13 0-22.5 9.5T448 416v64q0 13 9.5 22.5T480 512h64q13 0 22.5-9.5T576 480v-64q0-7-2.5-12.5t-7-10-10-7T544 384zm-256 0h-64q-13 0-22.5 9.5T192 416v64q0 13 9.5 22.5T224 512h64q13 0 22.5-9.5T320 480v-64q0-7-2.5-12.5t-7-10-10-7T288 384zm0 256h-64q-13 0-22.5 9.5T192 672v64q0 13 9.5 22.5T224 768h64q13 0 22.5-9.5T320 736v-64q0-4-1-8.5t-3-8-5-6.5-6.5-5-8-3-8.5-1z" fill="hsl(244, 73%, 62%)" stroke="hsl(244, 73%, 62%)" stroke-width="50"/>
+  <rect x="0" y="0" width="1024" height="1024" fill="rgba(0, 0, 0, 0)" />
+</svg>
\ No newline at end of file
-- 
GitLab