Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Début d'intégration du cheminement observateur lors de la soumission de son observation #29

Merged
merged 52 commits into from Jan 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4bb4a42
typo
Jan 16, 2019
eced6b6
bring topbar closer to original design. Use css vars for consistency.…
Jan 16, 2019
8827a4d
topbar
Jan 16, 2019
666190c
comment on a couple of fixmes
Jan 16, 2019
82f2e30
[wip] web integration dispatch among angular components
Jan 16, 2019
f117512
test
Jan 16, 2019
4f5ba93
balance columns
Jan 16, 2019
131f507
obs list padding
Jan 16, 2019
d9b118e
trade clip-path for svg background, ok ?
Jan 16, 2019
6ffd0a1
Merge branch 'trade_clip-path_for_bg_svg' into dev
Jan 16, 2019
5978167
adjust polygon color
Jan 17, 2019
afc75ae
style sync
Jan 17, 2019
b0222cb
Disabled angular ViewEncapsulation for generalized css vars usage.
Jan 17, 2019
6f98b15
sights: basic modal handling.
Jan 20, 2019
f925506
species component: disable ViewEncapsulation
Jan 20, 2019
2d179f5
user dashboard tpl
Naomi-Fischer Jan 21, 2019
ea9b23c
onboarding flow.
Jan 21, 2019
55b06bb
onbarding flow continuation
Jan 21, 2019
a0726d0
add observation modal
Naomi-Fischer Jan 21, 2019
2313546
Merge remote-tracking branch 'origin/dev' into dev
Naomi-Fischer Jan 21, 2019
d5e5591
Merge remote-tracking branch 'origin/dev' into dev
Naomi-Fischer Jan 21, 2019
ac29da7
modales et popup
Naomi-Fischer Jan 21, 2019
43ffd8e
wip observation form
Jan 21, 2019
5e36709
Merge branch 'dev' of https://github.com/patkap/GeoNature-citizen int…
Jan 21, 2019
350aa01
more onboarding.
Jan 21, 2019
5ef586d
input file/image
Jan 21, 2019
f1aa18a
form map, specie media fallback
Jan 21, 2019
64322b4
restore datepicker
Jan 21, 2019
2abcd43
todo
Jan 21, 2019
ec09b6c
gallery test
Jan 22, 2019
0802dd0
popup map custom
Naomi-Fischer Jan 22, 2019
17a1111
form map obs marker
Jan 22, 2019
3aa4ee5
Merge branch 'dev' of https://github.com/patkap/GeoNature-citizen int…
Jan 22, 2019
67a3255
test modales
Naomi-Fischer Jan 22, 2019
fd68dac
form map obs marker cleanup
Jan 22, 2019
cd27bf4
Merge branch 'dev' of https://github.com/patkap/GeoNature-citizen int…
Jan 22, 2019
5068c19
pointer map
Naomi-Fischer Jan 22, 2019
63fcddc
sightmap cleanup
Jan 22, 2019
bfe54c2
modal observation added
Naomi-Fischer Jan 22, 2019
c6d5f74
Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
Naomi-Fischer Jan 22, 2019
128ae3b
modale obs added
Naomi-Fischer Jan 22, 2019
fb3ed39
beautify inté
Naomi-Fischer Jan 23, 2019
ce5a52b
initial flow commit
Jan 28, 2019
75b6073
sync
Jan 28, 2019
d96004c
hot fixes style, thx @Naomi-Fischer
Jan 28, 2019
3828084
Login and Register modals into flow
Jan 28, 2019
3e9834b
noop, cleanup
Jan 28, 2019
0d4b8ad
fix modal flow recall
Jan 28, 2019
34c27dc
pacify error log
Jan 28, 2019
77d8939
cleanup
Jan 28, 2019
9c5aea6
image capture.
Jan 28, 2019
88156eb
demo time
Jan 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/gncitizen/core/taxonomy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ class TMedias(db.Model):
is_public = db.Column(db.BOOLEAN)
supprime = db.Column(db.BOOLEAN)
id_type = db.Column(db.Integer)
types = db.Column(db.Integer)
source = db.Column(db.Text)
licence = db.Column(db.Text)

def __repr__(self):
return '<TMedias %r>' % self.titre
Expand Down
166 changes: 96 additions & 70 deletions backend/gncitizen/core/taxonomy/routes.py
Original file line number Diff line number Diff line change
@@ -1,81 +1,107 @@
import requests
from flask import Blueprint, jsonify
# import requests
from flask import Blueprint, jsonify, current_app

from gncitizen.utils.env import taxhub_lists_url
# from gncitizen.utils.env import taxhub_lists_url
from gncitizen.utils.env import db
from gncitizen.utils.utilssqlalchemy import json_resp
from gncitizen.core.taxonomy.models import (
BibNoms, BibListes, CorNomListe, TMedias, Taxref)

routes = Blueprint('taxonomy', __name__)


# @routes.route('/taxonomy/lists', methods=['GET'])
# @json_resp
# def get_lists():
# """Renvoie toutes liste d'espèces
# GET
# ---
# tags:
# - TaxHub api
# definitions:
# id_liste:
# type: integer
# nb_taxons:
# type: integer
# desc_liste:
# type: string
# picto:
# type: string
# group2inpn:
# type: string
# nom_liste:
# type: string
# regne:
# type: string
# responses:
# 200:
# description: A list of all species lists
# """
# r = requests.get(taxhub_lists_url)
# if r.status_code == 200:
# result = r.json()
# return result
# else:
# return jsonify('Erreur de chargement de l \'API', r.status_code)
@routes.route('/taxonomy/lists', methods=['GET'])
@json_resp
def get_lists():
"""Renvoie toutes liste d'espèces
GET
---
tags:
- TaxHub api
definitions:
id_liste:
type: integer
nb_taxons:
type: integer
desc_liste:
type: string
picto:
type: string
group2inpn:
type: string
nom_liste:
type: string
regne:
type: string
responses:
200:
description: A list of all species lists
"""
# r = requests.get(taxhub_lists_url)
# if r.status_code == 200:
# result = r.json()
# return result
# else:
# return jsonify('Erreur de chargement de l \'API', r.status_code)
try:
data = BibListes.query.all()
# current_app.logger.debug([l.as_dict() for l in data])
return [l.as_dict() for l in data]
except Exception as e:
return {'error_message': str(e)}, 400


# @routes.route('/taxonomy/lists/<int:id>', methods=['GET'])
# @json_resp
# def get_list(id):
# """Renvoie une liste d'espèces spécifiée par son id
# GET
# ---
# tags:
# - TaxHub api
# definitions:
# id_liste:
# type: integer
# nb_taxons:
# type: integer
# desc_liste:
# type: string
# picto:
# type: string
# group2inpn:
# type: string
# nom_liste:
# type: string
# regne:
# type: string
# responses:
# 200:
# description: A list of all species lists
# """
# # taxhub_url = load_config()['TAXHUB_API_URL']
# r = requests.get(taxhub_lists_url + str(id))
# if r.status_code == 200:
# result = r.json()
# return result
# else:
# return jsonify('Erreur de chargement de l \'API', r.status_code)
@routes.route('/taxonomy/lists/<int:id>/species', methods=['GET'])
@json_resp
def get_list(id):
"""Renvoie une liste d'espèces spécifiée par son id
GET
---
tags:
- TaxHub api
definitions:
id_liste:
type: integer
nb_taxons:
type: integer
desc_liste:
type: string
picto:
type: string
group2inpn:
type: string
nom_liste:
type: string
regne:
type: string
responses:
200:
description: A list of all species lists
"""
# # taxhub_url = load_config()['TAXHUB_API_URL']
# r = requests.get(taxhub_lists_url + str(id))
# if r.status_code == 200:
# result = r.json()
# return result
# else:
# return jsonify('Erreur de chargement de l \'API', r.status_code)
try:
data = db.session.query(BibNoms, Taxref, TMedias)\
.distinct(BibNoms.cd_ref)\
.join(CorNomListe, CorNomListe.id_liste == id)\
.join(Taxref, Taxref.cd_ref == BibNoms.cd_ref)\
.outerjoin(TMedias, TMedias.cd_ref == BibNoms.cd_ref)\
.all()
# current_app.logger.debug(
# [{'nom': d[0], 'taxref': d[1]} for d in data])
return [
{
'nom': d[0].as_dict(),
'taxref': d[1].as_dict(),
'medias': d[2].as_dict() if d[2] else None
} for d in data]
except Exception as e:
return {'error_message': str(e)}, 400


# @routes.route('/taxonomy/lists/full', methods=['GET'])
Expand Down
4 changes: 2 additions & 2 deletions config/default_config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ UPLOAD_FOLDER = 'static/medias'
# Front end configuration
[FRONTEND]
PROD_MOD = false
DISPLAU_HEADER = false
DISPLAY_HEADER = false
DISPLAY_FOOTER = false
MULTILINGUAL = false

Expand All @@ -55,4 +55,4 @@ MULTILINGUAL = false
title = 'GeoNature-Citizen API'
version = 'x.x.x'
produces = ["application/json"]
consumes = ["application/json"]
consumes = ["application/json"]
2 changes: 1 addition & 1 deletion frontend/src/app/app.component.css
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.router-app {
margin-top: 106px !important;
}
}
Empty file modified frontend/src/app/app.component.html
100755 → 100644
Empty file.
5 changes: 3 additions & 2 deletions frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

import { AppConfig } from './../conf/app.config';
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ViewEncapsulation } from '@angular/core';


@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
styleUrls: ['./app.component.css'],
encapsulation: ViewEncapsulation.None,
})
export class AppComponent implements OnInit{
title = 'GeoNature-citizen';
Expand Down
34 changes: 28 additions & 6 deletions frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,25 @@ import { AboutComponent } from "./about/about.component";
import { AboutCustomComponent } from "./about/custom/custom.component";
import { AboutFixedComponent } from "./about/fixed/fixed.component";
import { HomeCustomComponent } from "./home/custom/custom.component";
import { FlowComponent } from './programs/sights/modalflow/flow/flow.component'
// import { FlowService } from './programs/sights/flow/flow.service'
import { FlowDirective } from './programs/sights/modalflow/flow/flow.directive'
import { OnboardComponent } from './programs/sights/modalflow/steps/onboard/onboard.component'
import { CommittedComponent } from './programs/sights/modalflow/steps/committed/committed.component'
import { CongratsComponent } from './programs/sights/modalflow/steps/congrats/congrats.component';
import { ModalFlowComponent } from './programs/sights/modalflow/modalflow.component';
import { RewardComponent } from './programs/sights/modalflow/steps/reward/reward.component';
import { ModalFlowService } from './programs/sights/modalflow/modalflow.service';

@NgModule({
imports: [
BrowserModule,
NgbModule,
HttpModule,
HttpClientModule,
FormsModule,
HttpModule,
ReactiveFormsModule,
routing
FormsModule,
NgbModule,
routing,
],
declarations: [
AppComponent,
Expand All @@ -62,19 +71,32 @@ import { HomeCustomComponent } from "./home/custom/custom.component";
SpeciesComponent,
AboutComponent,
AboutCustomComponent,
AboutFixedComponent
AboutFixedComponent,
FlowComponent,
FlowDirective,
OnboardComponent,
CommittedComponent,
CongratsComponent,
ModalFlowComponent,
RewardComponent,
],
providers: [
AuthService,
GncService,
GncProgramsService,
// FlowService,
ModalFlowService,
],
bootstrap: [AppComponent],
entryComponents: [
DescModalComponent,
LoginComponent,
LogoutComponent,
RegisterComponent
RegisterComponent,
OnboardComponent,
CommittedComponent,
CongratsComponent,
RewardComponent,
]
})
export class AppModule {}
26 changes: 12 additions & 14 deletions frontend/src/app/auth/login/login.component.css
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.modal-header{
background: #60b15c;
background: -moz-linear-gradient(top, #60b15c 0%, #60b15c 50%, #57a154 51%, #57a154 100%);
background: -webkit-linear-gradient(top, #60b15c 0%,#60b15c 50%,#57a154 51%,#57a154 100%);
background: linear-gradient(to bottom, #60b15c 0%,#60b15c 50%,#57a154 51%,#57a154 100%);
background-color: var(--secondary);
background-image: -moz-linear-gradient(to bottom, var(--secondary), var(--secondary-gradient));
background-image: -webkit-linear-gradient(to bottom, var(--secondary), var(--secondary-gradient));
background-image: linear-gradient(to bottom, var(--secondary), var(--secondary-gradient));
border-radius: 0px;
align-items : center;
max-height: 61px;
Expand All @@ -23,31 +23,28 @@
}

span.input-group-text {
background: #60b15c;
background-color: var(--secondary);
color: #fff;
}

.modal-body input{
border: solid 1px transparent;
background: #eee;
border : solid 1px #bbb;
transition: all .2s ease-in-out;
}

.modal-body input:focus{
background: rgb(196, 196, 196);
}

.modal-body input::placeholder{
font-style: italic;
}

.modal-body .form-row:first-child, .modal-body .form-row:nth-child(2n) {
border-bottom: solid 1px #60b15c;
border-bottom: solid 1px;
border-bottom-color: var(--secondary);
margin-bottom: 10px;
}

.modal-body button {
background: #60b15c;
background-color: var(--secondary);
color: #fff;
border: solid 1px transparent;
display: flex;
Expand All @@ -56,6 +53,7 @@ span.input-group-text {

.modal-body button:hover{
background: transparent;
color: #60b15c;
border: solid 1px #60b15c;
color: var(--secondary);
border: solid 1px;
border-color: var(--secondary)
}
Empty file modified frontend/src/app/auth/login/login.component.html
100755 → 100644
Empty file.
8 changes: 2 additions & 6 deletions frontend/src/app/auth/logout/logout.component.css
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@ span.input-group-text {

.modal-body input{
border: solid 1px transparent;
background: #eee;
border : solid 1px #bbb;
transition: all .2s ease-in-out;
}

.modal-body input:focus{
background: rgb(196, 196, 196);
}

.modal-body input::placeholder{
font-style: italic;
}
Expand All @@ -56,6 +52,6 @@ span.input-group-text {

.modal-body button:hover{
background: transparent;
color: #60b15c;
color: var(--secondary);
border: solid 1px #60b15c;
}
Loading