From 8800e5572c25d9abd99fe5fc8908eafbdb0a6668 Mon Sep 17 00:00:00 2001 From: HamoudaAmine Date: Thu, 3 Jan 2019 18:28:12 +0100 Subject: [PATCH 1/2] fix sthemes input --- backend/i18n/fr/LC_MESSAGES/messages.mo | Bin 2297 -> 2299 bytes .../src/app/add-site/add-site.component.ts | 22 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/backend/i18n/fr/LC_MESSAGES/messages.mo b/backend/i18n/fr/LC_MESSAGES/messages.mo index 83e0bdf9f8046d0b6588145f7a57860a565660e1..a6d0eddef685aff41aca3ec1a3c3c9eaf34fde23 100644 GIT binary patch delta 151 zcmew<_*-zp5ypBp1_lNW4h9BxAk7b?L40u_EexdPfHXIdHUiRuK-vySivZ~WD4hzV zd4c>YAguzVJAkw(kX{R { this.selectedSubthemes = []; // this.siteForm.controls['id_stheme'].reset(); - console.log('this.subthemes', this.subthemes); if (this.siteForm.controls['id_theme'].value && this.siteForm.controls['id_theme'].value.length !== 0) { this.siteForm.controls['id_stheme'].enable(); _.forEach(this.subthemes, (subtheme) => { _.forEach(this.siteForm.controls['id_theme'].value, (idTheme) => { if (_.includes(subtheme.themes, Number(idTheme)) && !_.find(this.selectedSubthemes, { 'id_stheme': subtheme.id_stheme })) { this.selectedSubthemes.push(subtheme); - console.log('this.selectedSubthemes', this.selectedSubthemes); } }); }); - /* _.forEach(this.siteForm.controls['id_theme'].value, (idTheme) => { - if (_.includes(selectedSubthemes, Number(idTheme)) && !_.find(this.selectedSubthemes, { 'id_stheme': subtheme.id_stheme })) { - this.selectedSubthemes.push(subtheme); - console.log('this.selectedSubthemes', this.selectedSubthemes); - } - }); */ + _.map(this.siteForm.controls['id_stheme'].value, (idStheme) => { + if (!_.find(this.selectedSubthemes, { 'id_stheme': idStheme })) { + _.remove(this.siteForm.controls['id_stheme'].value, (item) => { + return item === idStheme; + }); + } + }); + this.siteForm.patchValue({ + 'id_stheme': this.siteForm.controls['id_stheme'].value, + }); + } else { - this.siteForm.controls['id_stheme'].disable(); + this.siteForm.controls['id_stheme'].setValue(null), + this.siteForm.controls['id_stheme'].disable(); this.selectedSubthemes = []; } }); From 085c0afb06728df916f79f4574cc38c44b20e11a Mon Sep 17 00:00:00 2001 From: HamoudaAmine Date: Fri, 4 Jan 2019 17:55:52 +0100 Subject: [PATCH 2/2] change the hover color of filter's buttons --- backend/api.py | 6 +++--- backend/static/css/map.css | 6 +++++- .../src/app/add-photo/add-photo.component.html | 2 +- front-backOffice/src/app/add-site/add-site.component.ts | 7 +++++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/backend/api.py b/backend/api.py index bf615218..063833e5 100755 --- a/backend/api.py +++ b/backend/api.py @@ -179,7 +179,7 @@ def add_site(): @fnauth.check_auth(2, False, None, None) def update_site(): site = request.get_json() - models.CorSiteSthemeTheme.query.filter_by(id_site=site.get('id_site')).delete() + #models.CorSiteSthemeTheme.query.filter_by(id_site=site.get('id_site')).delete() models.TSite.query.filter_by(id_site= site.get('id_site')).update(site) db.session.commit() return jsonify('site updated successfully'), 200 @@ -212,9 +212,9 @@ def upload_file(): check_exist = models.TPhoto.query.filter_by( path_file_photo=d_serialized.get('path_file_photo')).first() if(check_exist): - #models.CorSiteSthemeTheme.query.filter_by(id_site=d_serialized.get('id_site')).delete() + models.CorSiteSthemeTheme.query.filter_by(id_site=d_serialized.get('id_site')).delete() #models.TSite.query.filter_by(id_site=d_serialized.get('id_site')).delete() - #db.session.commit() + db.session.commit() return jsonify(error='image_already_exist', image=d_serialized.get('path_file_photo')), 400 main_photo = d_serialized.get('main_photo') del d_serialized['main_photo'] diff --git a/backend/static/css/map.css b/backend/static/css/map.css index eb27a029..5cdb659f 100644 --- a/backend/static/css/map.css +++ b/backend/static/css/map.css @@ -100,7 +100,11 @@ border-color: transparent; margin-bottom: 1px; } -.app-map .sidebar .filters .card-body .btn:hover, +.app-map .sidebar .filters .card-body .btn:hover +{ + background: #99d6ea61; + color: #FFF; +} .app-map .sidebar .filters .card-body .btn.active, .app-map .sidebar .btn-site:hover { background: #99D6EA; diff --git a/front-backOffice/src/app/add-photo/add-photo.component.html b/front-backOffice/src/app/add-photo/add-photo.component.html index 8e21fcf2..f4533dd8 100644 --- a/front-backOffice/src/app/add-photo/add-photo.component.html +++ b/front-backOffice/src/app/add-photo/add-photo.component.html @@ -28,7 +28,7 @@
- +