diff --git a/src/main/java/com/example/dateplanner/models/entities/AppUser.java b/src/main/java/com/example/dateplanner/models/entities/AppUser.java index 3ceb214..9bdcebd 100644 --- a/src/main/java/com/example/dateplanner/models/entities/AppUser.java +++ b/src/main/java/com/example/dateplanner/models/entities/AppUser.java @@ -3,6 +3,7 @@ package com.example.dateplanner.models.entities; import com.example.dateplanner.models.enums.Role; import lombok.Data; import lombok.NoArgsConstructor; +import lombok.NonNull; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.Column; import org.springframework.data.relational.core.mapping.Table; @@ -20,9 +21,14 @@ import java.util.UUID; public class AppUser implements UserDetails { @Id private UUID uuid; - private String username; + @NonNull + private String phone; private String password; - private Role role; + @NonNull + private String lastName; + @NonNull + private String firstName; + private Role role = Role.USER; @Column("dating_profile_uuid") private UUID datingProfileUuid = null; @@ -40,6 +46,11 @@ public class AppUser implements UserDetails { return List.of(new SimpleGrantedAuthority("ROLE_" + getRole().toString())); } + @Override + public String getUsername() { + return this.phone; + } + @Override public boolean isAccountNonExpired() { return UserDetails.super.isAccountNonExpired(); diff --git a/src/main/resources/static/css/header.css b/src/main/resources/static/css/header.css new file mode 100644 index 0000000..96db8f9 --- /dev/null +++ b/src/main/resources/static/css/header.css @@ -0,0 +1,85 @@ +/* Модальное окно авторизации */ +.auth-tabs { + border: none ; + margin-bottom: 20px !important; +} + +.auth-tabs .nav-link { + border: none !important; + color: #666; + font-weight: 500; + padding: 10px 0; + margin: 0 15px; + position: relative; +} + +.auth-tabs .nav-link.active { + color: #e74c3c !important; + background: none; +} + +.auth-tabs .nav-link.active:after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 3px; + background: #e74c3c; + border-radius: 3px; +} + +.forgot-password { + font-size: 0.9rem; + color: #e74c3c; + text-decoration: none; +} + +.auth-divider { + text-align: center; + position: relative; + margin: 20px 0; + color: #666; +} + +.auth-divider:before { + content: ''; + position: absolute; + top: 50%; + left: 0; + right: 0; + height: 1px; + background: #eee; + z-index: 1; +} + +.auth-divider span { + background: white; + padding: 0 15px; + position: relative; + z-index: 2; +} + +.social-auth-btn { + width: 100%; + padding: 10px; + border: 1px solid #ddd; + border-radius: 8px; + background: white; + display: flex; + align-items: center; + justify-content: center; + gap: 10px; + margin-bottom: 10px; + transition: all 0.3s; + font-weight: 500; +} + +.social-auth-btn:hover { + border-color: #e74c3c; + background: rgba(231, 76, 60, 0.05); +} + +.social-auth-btn.vk { color: #4C75A3; } +.social-auth-btn.google { color: #DB4437; } +.social-auth-btn.yandex { color: #FF0000; } \ No newline at end of file diff --git a/src/main/resources/static/css/main.css b/src/main/resources/static/css/main.css index ee3b3e1..4b4f08d 100644 --- a/src/main/resources/static/css/main.css +++ b/src/main/resources/static/css/main.css @@ -15,6 +15,27 @@ color: white !important; } +/* Добавляем новые стили для иконки авторизации */ +.auth-btn { + background: #e74c3c; + color: white; + border: none; + border-radius: 50px; + padding: 8px 20px; + font-weight: 600; + transition: all 0.3s; + display: flex; + align-items: center; + gap: 8px; + text-decoration: none; +} + +.auth-btn:hover { + transform: translateY(-2px); + box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3); + color: white; +} + .love-gradient { background: linear-gradient(135deg, #e74c3c 0%, #fd79a8 100%); color: white; diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css index 812caca..93d2513 100644 --- a/src/main/resources/static/css/style.css +++ b/src/main/resources/static/css/style.css @@ -1,2 +1,3 @@ @import "fonts.css"; -@import "main.css"; \ No newline at end of file +@import "main.css"; +@import "header.css"; \ No newline at end of file diff --git a/src/main/resources/static/js/site/blocks/header.js b/src/main/resources/static/js/site/blocks/header.js index 3b105ef..7d87c34 100644 --- a/src/main/resources/static/js/site/blocks/header.js +++ b/src/main/resources/static/js/site/blocks/header.js @@ -24,11 +24,118 @@ function initHeader($header){ Для организаций - + Добавить место + + + + Войти + + + + + + + + Вход в DatePlanner + + + + + + + + Вход + + + + + Регистрация + + + + + + + + + + Email или телефон + + + + Пароль + + + Забыли пароль? + + + + + Запомнить меня + + Войти + + + + или войдите через + + + + ВКонтакте + + + Google + + + Яндекс + + + + + + + + + Имя + + + + Фамилия + + + + + Email + + + + Пароль + + Минимум 6 символов + + + Подтвердите пароль + + + + + + Я принимаю условия использования и + политику конфиденциальности + + + Зарегистрироваться + + + + + + + `) } \ No newline at end of file