From 7b167698ac924839e957f5ee24fbe4ae0242764e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Wo=C5=BAniak?= Date: Tue, 26 Jul 2022 13:05:17 +0200 Subject: [PATCH] UI fixes --- client/src/app.js | 1 + .../business-items/business-item-editor.js | 1 + client/src/business-items/business-item.js | 4 +- client/src/contacts/contact-info-editor.js | 1 + .../local-businesses/local-business-item.js | 16 ++--- client/src/ow-account/account-view.js | 67 ++++++++++++++----- client/src/ow-account/ow-account.js | 4 +- .../register-form/register-item-form-row.js | 2 +- .../src/register-form/register-submit-form.js | 2 +- .../src/register-form/register-user-form.js | 63 ++++++++--------- .../src/register-form/register-user-type.js | 2 +- client/src/shared/facebook-button.js | 1 + client/src/shared/image-input.js | 7 +- server/assets/templates/account.html | 11 ++- server/assets/templates/nav.html | 10 --- server/src/model/view.rs | 8 --- server/src/routes/restricted/contacts.rs | 4 +- server/src/routes/unrestricted/account.rs | 12 ++-- server/src/routes/unrestricted/terms.rs | 2 +- 19 files changed, 119 insertions(+), 99 deletions(-) diff --git a/client/src/app.js b/client/src/app.js index d02b1e3..3ec6229 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -1,6 +1,7 @@ import "./shared/rich-text-editor.js"; import "./shared/form-navigation.js"; import "./shared/image-popup.js"; +import "./shared/facebook-button.js"; import "./shared/nav/ow-nav.js"; import "./shared/nav/ow-path.js"; import "./shared/price/price-input.js"; diff --git a/client/src/business-items/business-item-editor.js b/client/src/business-items/business-item-editor.js index a61f7b4..e197f62 100644 --- a/client/src/business-items/business-item-editor.js +++ b/client/src/business-items/business-item-editor.js @@ -36,6 +36,7 @@ customElements.define('business-item-editor', class extends Component { ${ FORM_STYLE }
+

Edycja konta przedsiębiorcy

diff --git a/client/src/business-items/business-item.js b/client/src/business-items/business-item.js index afbd7a7..4b6d266 100644 --- a/client/src/business-items/business-item.js +++ b/client/src/business-items/business-item.js @@ -51,7 +51,7 @@ customElements.define('business-item', class extends Component {
- +
@@ -90,7 +90,7 @@ customElements.define('business-item', class extends Component { updateForm.querySelector('#price').value = this.price; updateForm.querySelector('#picture_url').value = this.picture_url; updateForm.querySelector('#item_order').value = this.item_order; - updateForm.submit(); + // updateForm.submit(); }); this.shadowRoot.querySelector('#delete').addEventListener('click', ev => { ev.stopPropagation(); diff --git a/client/src/contacts/contact-info-editor.js b/client/src/contacts/contact-info-editor.js index 0cc7537..125371b 100644 --- a/client/src/contacts/contact-info-editor.js +++ b/client/src/contacts/contact-info-editor.js @@ -34,6 +34,7 @@ customElements.define('contact-info-editor', class extends Component { ${ FORM_STYLE }
+

Edycja listy danych kontaktowych

diff --git a/client/src/local-businesses/local-business-item.js b/client/src/local-businesses/local-business-item.js index ea10d29..b6d5e63 100644 --- a/client/src/local-businesses/local-business-item.js +++ b/client/src/local-businesses/local-business-item.js @@ -10,13 +10,9 @@ customElements.define('local-business-item', class extends Component {
- +

@@ -102,7 +100,7 @@ customElements.define('local-business-item', class extends Component { v = v || ''; if (!(v || '').startsWith("/")) v = ''; this.setAttribute('picture-url', v); - const el = this.shadowRoot.querySelector('img'); + const el = this.shadowRoot.querySelector('#img'); el.src = v; } }); diff --git a/client/src/ow-account/account-view.js b/client/src/ow-account/account-view.js index 23b1faf..32f2cf4 100644 --- a/client/src/ow-account/account-view.js +++ b/client/src/ow-account/account-view.js @@ -21,7 +21,11 @@ customElements.define('account-view', class extends Component { display: flex; padding: .375rem .75rem; } - #register-success { display: none; text-align: center; color: darkgreen; } + #register-success { + display: none; + text-align: center; + color: darkgreen; + } :host([register-success]) #register-success { display: block; } @@ -34,13 +38,27 @@ customElements.define('account-view', class extends Component { article { margin: 8px; } - #rules a { - display: block; - } #logout { border-color: var(--red-color); color: var(--red-color); } + section input[type="button"], + section input[type="button"], + section input[type="submit"] { + width: 100%; + } + section input[type="submit"], + section a.btn { + padding-bottom: 0; + padding-top: 0; + display: block; + } + ::slotted(#editService) { + width: calc(100% - 1.5rem) !important; + padding-bottom: 0 !important; + padding-top: 0 !important; + display: block !important; + } @media only screen and (min-device-width: 1000px) { article { margin: 0; @@ -49,36 +67,53 @@ customElements.define('account-view', class extends Component { display: flex; justify-content: space-between; } + #rules a { + display: block; + min-width: calc(120px - 1.5rem); + width: auto; + } + input { + min-width: 120px; + width: auto; + } + ::slotted(#editService) { + min-width: 120px !important; + width: auto !important; + display: inline-block !important; + } } ${ FORM_STYLE }${ BUTTON_STYLE }

Konto utworzone!

-
+
-
-
+
+
-
-
+ +
-
-
+ +

Powiąż z kontem Facebook

-
-
+ +
-
-
+ +
+ +
+
-
+
Regulamin Polityka prywatności diff --git a/client/src/ow-account/ow-account.js b/client/src/ow-account/ow-account.js index 9916479..3bc6096 100644 --- a/client/src/ow-account/ow-account.js +++ b/client/src/ow-account/ow-account.js @@ -45,10 +45,10 @@ customElements.define('ow-account', class extends Component {
- Nie masz konta? Utwórz nowe + Nie masz konta? Utwórz nowe
- Posiadasz konto? Zaloguj się + Posiadasz konto? Zaloguj się
diff --git a/client/src/register-form/register-item-form-row.js b/client/src/register-form/register-item-form-row.js index b349fc5..b42413d 100644 --- a/client/src/register-form/register-item-form-row.js +++ b/client/src/register-form/register-item-form-row.js @@ -25,7 +25,7 @@ customElements.define('register-item-form-row', class extends PseudoForm {
- +
diff --git a/client/src/register-form/register-submit-form.js b/client/src/register-form/register-submit-form.js index e1e664e..6af2b88 100644 --- a/client/src/register-form/register-submit-form.js +++ b/client/src/register-form/register-submit-form.js @@ -53,7 +53,7 @@ customElements.define('register-submit-form', class extends PseudoForm {
- +
`); diff --git a/client/src/register-form/register-user-form.js b/client/src/register-form/register-user-form.js index 7808c95..acaa9a3 100644 --- a/client/src/register-form/register-user-form.js +++ b/client/src/register-form/register-user-form.js @@ -1,5 +1,4 @@ import { Component, FORM_STYLE } from "../shared"; -import "../shared/facebook-button"; customElements.define('register-user-form', class extends Component { static get observedAttributes() { @@ -11,13 +10,6 @@ customElements.define('register-user-form', class extends Component { -
-
- - - - +
+

Utwórz konto

+
@@ -78,11 +74,13 @@ customElements.define('register-user-form', class extends Component {
-
-
+
+ +
+
lub zaloguj się za pomocą:
- -
+ + `); const form = this.shadowRoot.querySelector('form'); @@ -100,17 +98,10 @@ customElements.define('register-user-form', class extends Component { form.querySelector('#account_type').value = 'User'; form.submit(); }); - - this.shadowRoot.querySelector('#email-icon').addEventListener('click', ev => { - ev.stopPropagation(); - ev.preventDefault(); - - this.mode = 'email'; - }); } connectedCallback() { - this.mode = ''; + this.mode = 'email'; } attributeChangedCallback(name, oldV, newV) { diff --git a/client/src/register-form/register-user-type.js b/client/src/register-form/register-user-type.js index 2e1ff70..3cb293b 100644 --- a/client/src/register-form/register-user-type.js +++ b/client/src/register-form/register-user-type.js @@ -106,7 +106,7 @@ customElements.define('register-user-type', class extends Component {
Usługodawca
-
Usługodawca posiadający stałe usłuugi lub produkty w ofercie
+
Usługodawca posiadający stałe usługi lub produkty w ofercie
diff --git a/client/src/shared/facebook-button.js b/client/src/shared/facebook-button.js index 3e0f7be..7411d68 100644 --- a/client/src/shared/facebook-button.js +++ b/client/src/shared/facebook-button.js @@ -12,6 +12,7 @@ customElements.define('facebook-button', class extends Component {