diff --git a/back/api/management/commands/prepareusertests.py b/back/api/management/commands/prepareusertests.py index 9244925b..0d814b45 100644 --- a/back/api/management/commands/prepareusertests.py +++ b/back/api/management/commands/prepareusertests.py @@ -65,19 +65,19 @@ def handle(self, *args, **options): mma.identity.phone = '+41 32 000 00 00' mma.identity.save() - mka = UserModel.objects.create_user( - username='mka', password='mka') - mka.identity.email = 'mka-email@ne.ch' - mka.identity.first_name = 'Michaël' - mka.identity.last_name = 'Kalbermatten' - mka.identity.street = 'Rue de Tivoli 22' - mka.identity.postcode = '2000' - mka.identity.city = 'Neuchâtel' - mka.identity.country = 'Suisse' - mka.identity.company_name = 'Service du Registre Foncier et de la Géomatique - SITN' - mka.identity.phone = '+41 32 000 00 00' - mka.identity.subscribed = True - mka.identity.save() + mka2 = UserModel.objects.create_user( + username='mka2', password='mka2') + mka2.identity.email = 'mka2-email@ne.ch' + mka2.identity.first_name = 'Michaël' + mka2.identity.last_name = 'Kalbermatten' + mka2.identity.street = 'Rue de Tivoli 22' + mka2.identity.postcode = '2000' + mka2.identity.city = 'Neuchâtel' + mka2.identity.country = 'Suisse' + mka2.identity.company_name = 'Service du Registre Foncier et de la Géomatique - SITN' + mka2.identity.phone = '+41 32 000 00 00' + mka2.identity.subscribed = True + mka2.identity.save() # contacts contact1 = Contact.objects.create( @@ -116,7 +116,7 @@ def handle(self, *args, **options): belongs_to=mmi ) contact3.save() - contact_mka = Contact.objects.create( + contact_mka2 = Contact.objects.create( first_name='Jean', last_name='Doe', email='test3@admin.com', @@ -125,9 +125,9 @@ def handle(self, *args, **options): country='Suisse', company_name='Marine de Colombier', phone='+41 00 787 29 16', - belongs_to=mka + belongs_to=mka2 ) - contact_mka.save() + contact_mka2.save() order_geom = Polygon(( ( @@ -195,15 +195,15 @@ def handle(self, *args, **options): date_ordered=timezone.now()) order4.save() - order_mka = Order.objects.create( + order_mka2 = Order.objects.create( title='Plan de situation pour enquête', description='C\'est un test', order_type=order_type_prive, - client=mka, + client=mka2, geom=order_geom, invoice_reference='Dossier n°545454', date_ordered=timezone.now()) - order_mka.save() + order_mka2.save() order_download = Order.objects.create( title='Commande prête à être téléchargée', @@ -241,13 +241,13 @@ def handle(self, *args, **options): OrderItem.objects.create(order=order2, product=product1), OrderItem.objects.create(order=order3, product=product1, data_format=data_format), OrderItem.objects.create(order=order4, product=product2), - OrderItem.objects.create(order=order_mka, product=product1, data_format=data_format) + OrderItem.objects.create(order=order_mka2, product=product1, data_format=data_format) ] for order_item in orderitems: order_item.set_price() order_item.save() order_item_deprecated = OrderItem.objects.create( - order=order_mka, product=product_deprecated, data_format=data_format) + order=order_mka2, product=product_deprecated, data_format=data_format) order_item_deprecated.set_price(price=Money(400, 'CHF'), base_fee=Money(150, 'CHF')) order_item_deprecated.price_status = OrderItem.PricingStatus.CALCULATED order_item_deprecated.save() @@ -274,11 +274,11 @@ def handle(self, *args, **options): order4.save() - order_mka.invoice_contact = contact_mka - order_mka.set_price() - order_mka.date_ordered = datetime.datetime(2018, 12, 1, 8, 20, 3, 0, tzinfo=datetime.timezone.utc) - order_mka.status = Order.OrderStatus.ARCHIVED - order_mka.save() + order_mka2.invoice_contact = contact_mka2 + order_mka2.set_price() + order_mka2.date_ordered = datetime.datetime(2018, 12, 1, 8, 20, 3, 0, tzinfo=datetime.timezone.utc) + order_mka2.status = Order.OrderStatus.ARCHIVED + order_mka2.save() order_download.set_price() empty_zip_data = b'PK\x05\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' diff --git a/back/api/templates/email_admin_fr-ch.html b/back/api/templates/email_admin_fr-ch.html index fafd96d9..ceec5e6f 100644 --- a/back/api/templates/email_admin_fr-ch.html +++ b/back/api/templates/email_admin_fr-ch.html @@ -16,7 +16,7 @@ {% endif %} {% if admin_url %}

- + {% url admin_url admin_url_params %}

diff --git a/back/api/templates/email_password_reset.html b/back/api/templates/email_password_reset.html index ff2ea1c6..37f404f0 100644 --- a/back/api/templates/email_password_reset.html +++ b/back/api/templates/email_password_reset.html @@ -1,11 +1,11 @@ {% extends "email_base_template.html" %} {% load i18n %} {% block content %} -{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %} +{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}

-{% trans "Please go to the following page and choose a new password:" %} +{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %} {{ protocol }}://{{ domain }}/auth/reset/{{ uid }}/{{ token }} -{% endblock %} -{% trans 'Your username, in case you’ve forgotten:' %} {{ user.get_username }} +{% endblock %}

+{% trans 'Your username, in case you’ve forgotten:' %} {{ user.get_username }} {% endblock %} \ No newline at end of file diff --git a/back/api/templates/registration/password_reset_email.html b/back/api/templates/registration/password_reset_email.html deleted file mode 100644 index 13e34fcd..00000000 --- a/back/api/templates/registration/password_reset_email.html +++ /dev/null @@ -1,12 +0,0 @@ -{% load i18n %}{% autoescape off %} -{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}

- -{% trans "Please go to the following page and choose a new password:" %}
-{% block reset_link %} -{{ protocol }}://{{ domain }}/auth/reset/{{ uid }}/{{ token }} -{% endblock %}

-{% trans 'Your username, in case you’ve forgotten:' %} {{ user.get_username }} -

-{% trans "Le SITN" %}
- -{% endautoescape %} diff --git a/front/angular.json b/front/angular.json index fcbca744..c70b75ee 100644 --- a/front/angular.json +++ b/front/angular.json @@ -24,7 +24,7 @@ "tsConfig": "tsconfig.app.json", "aot": true, "assets": [ - "src/favicon.png", + "src/favicon.ico", "src/assets" ], "styles": [ @@ -92,7 +92,7 @@ "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", "assets": [ - "src/favicon.png", + "src/favicon.ico", "src/assets" ], "styles": [ diff --git a/front/src/app/_components/help-overlay/help-overlay.component.html b/front/src/app/_components/help-overlay/help-overlay.component.html index 3c25710b..34bc4ad8 100644 --- a/front/src/app/_components/help-overlay/help-overlay.component.html +++ b/front/src/app/_components/help-overlay/help-overlay.component.html @@ -4,7 +4,10 @@ Voir l'aide - + + Informations sur la tarification + +
Avez-vous des questions ? diff --git a/front/src/app/account/profile/modify-profile.component.html b/front/src/app/account/profile/modify-profile.component.html index c4827033..1372b2e2 100644 --- a/front/src/app/account/profile/modify-profile.component.html +++ b/front/src/app/account/profile/modify-profile.component.html @@ -1,4 +1,4 @@ - + GeoShop - Modification du profil @@ -127,10 +127,11 @@ placeholder="N° IDE"> Mauvais format du numéro IDE, accepté : CHE-012.345.678 - - +
+ +
diff --git a/front/src/app/account/profile/modify-profile.component.scss b/front/src/app/account/profile/modify-profile.component.scss index f1d0f789..406ba893 100644 --- a/front/src/app/account/profile/modify-profile.component.scss +++ b/front/src/app/account/profile/modify-profile.component.scss @@ -1,34 +1,26 @@ :host { display: flex; - justify-content: center; - align-content: center; - margin: 10px; - height: calc(100vh - 84px); + height: calc(100vh - 64px); .mat-card { - display: flex; - flex-direction: column; - min-width: 720px; - - .mat-card-content { - display: flex; - flex-direction: column; - flex: 1; - } + margin: 10px auto; + flex: 1; + max-width: 960px; } - ul { - list-style-type: none; + form { + height: calc(100vh - 64px - 60px - 30px); + overflow-y: auto; } - form { + .bottom-container { display: flex; - flex-direction: column; - flex: 1; - } + justify-content: flex-end; - .action-button-container { - align-self: flex-end; - margin-top: auto; + .mat-button { + &:only-child { + margin-right: auto; + } + } } } diff --git a/front/src/app/account/profile/modify-profile.component.ts b/front/src/app/account/profile/modify-profile.component.ts index fbfb169d..3e4e39da 100644 --- a/front/src/app/account/profile/modify-profile.component.ts +++ b/front/src/app/account/profile/modify-profile.component.ts @@ -1,10 +1,7 @@ import {Component, HostBinding, OnInit} from '@angular/core'; import {FormControl, FormGroup, FormBuilder, Validators} from '@angular/forms'; -import {of} from 'rxjs'; -import {catchError} from 'rxjs/operators'; import {PHONE_REGEX} from '../../_helpers/regex'; import {ApiService} from '../../_services/api.service'; -import {IIdentity} from '../../_models/IIdentity'; import {MatSnackBar} from '@angular/material/snack-bar'; import {Router} from '@angular/router'; import {IUser, IUserToPost} from '../../_models/IUser'; @@ -50,8 +47,8 @@ export class ModifyProfileComponent implements OnInit { postcode: new FormControl(this.user.postcode, Validators.required), city: new FormControl(this.user.city, Validators.required), country: new FormControl(this.user.country, Validators.required), - companyName: new FormControl(this.user.company_name, Validators.required), - ideId: new FormControl(this.user.ide_id, Validators.required), + companyName: new FormControl(this.user.company_name), + ideId: new FormControl(this.user.ide_id), }); } @@ -81,7 +78,11 @@ export class ModifyProfileComponent implements OnInit { this.apiService.change(user) .subscribe(async (res) => { if (res) { - this.snackBar.open('Vos modifications ont été soumises aux gestionnaires du Geoshop et un email de confirmation vous a été envoyé. Vos modifications seront validées par leur soin d\'ici quelques jours.', 'Ok', {panelClass: 'notification-info'}); + this.snackBar.open( + 'Vos modifications ont été soumises aux gestionnaires du Geoshop' + + ' et un email de confirmation vous a été envoyé. Vos modifications' + + ' seront validées dans les meilleurs délais.', + 'Ok', {panelClass: 'notification-info'}); await this.router.navigate(['/account/profile']); } else { this.formModifyUser.markAsDirty(); diff --git a/front/src/app/app.component.html b/front/src/app/app.component.html index 78d6cb2f..cb5b4282 100644 --- a/front/src/app/app.component.html +++ b/front/src/app/app.component.html @@ -1,7 +1,7 @@
- GeoShop + GeoShop du système d'information du territoire neuchâtelois {{subTitle}}
@@ -10,7 +10,7 @@
diff --git a/front/src/app/auth/register/register.component.ts b/front/src/app/auth/register/register.component.ts index 9f1c7159..f642bbee 100644 --- a/front/src/app/auth/register/register.component.ts +++ b/front/src/app/auth/register/register.component.ts @@ -104,7 +104,10 @@ export class RegisterComponent implements OnInit, AfterViewInit { } get birthDay() { - return this.formAddress.get('birthDay'); + if (this.formAddress.get('birthDay')?.value) { + return this.formAddress.get('birthDay')?.value.toISOString().slice(0, 10); + } + return null; } get password() { @@ -165,7 +168,7 @@ export class RegisterComponent implements OnInit, AfterViewInit { company_name: this.companyName?.value, ide_id: this.ideId?.value, phone: this.phone?.value, - birthday: this.birthDay?.value?.toISOString().slice(0,10), + birthday: this.birthDay, }; this.apiService.register(user) .subscribe(async (res) => { diff --git a/front/src/app/welcome/catalog/catalog.component.html b/front/src/app/welcome/catalog/catalog.component.html index 7e7e5318..eeac010a 100644 --- a/front/src/app/welcome/catalog/catalog.component.html +++ b/front/src/app/welcome/catalog/catalog.component.html @@ -22,6 +22,7 @@ src="{{mediaUrl}}/{{product.thumbnail_link}}">
{{product.label}}
+