diff --git a/pom.xml b/pom.xml index f2a24b7..8660950 100644 --- a/pom.xml +++ b/pom.xml @@ -138,6 +138,11 @@ commons-io 2.11.0 + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + 2.20.1 + org.springframework.boot diff --git a/src/main/java/com/example/dateplanner/models/entities/DatingPlace.java b/src/main/java/com/example/dateplanner/models/entities/DatingPlace.java new file mode 100644 index 0000000..f908172 --- /dev/null +++ b/src/main/java/com/example/dateplanner/models/entities/DatingPlace.java @@ -0,0 +1,53 @@ +package com.example.dateplanner.models.entities; + +import com.example.dateplanner.models.enums.DatingTime; +import com.example.dateplanner.models.enums.DatingType; +import com.example.dateplanner.models.enums.PriceType; +import jakarta.persistence.Table; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Column; +import java.time.LocalDateTime; +import java.util.*; + +@Data +@NoArgsConstructor +@Table(name = "dating_places") +public class DatingPlace { + @Id + private UUID uuid; + private String title; + private String photo; + private String description; + @Column("organization_uuid") + private UUID organizationUuid; + @Column("dating_type") + private DatingType datingType; + private long price = 0; + @Column("price_type") + private PriceType priceType; + @Column("dating_time") + private DatingTime datingTime; + @Column("start_time") + private LocalDateTime startTime = null; // если это одноразовое событие + private Long duration = null; // длительность мероприятия + @Column("schedule_uuids") + private List scheduleUuids = new ArrayList<>(); // если многоразовое событие + private String location; + private String coordinates; + private int views = 0; // просмотры + @Column("in_favourite") + private int inFavourite = 0; + private Double rating = null; + @Column("expiration_date") + private LocalDateTime expirationDate = null; + + private boolean enabled = true; + + @Column("created_at") + private LocalDateTime createdAt; + @Column("updated_at") + private LocalDateTime updatedAt; + +} diff --git a/src/main/java/com/example/dateplanner/models/entities/DatingPlan.java b/src/main/java/com/example/dateplanner/models/entities/DatingPlan.java new file mode 100644 index 0000000..ab5ec57 --- /dev/null +++ b/src/main/java/com/example/dateplanner/models/entities/DatingPlan.java @@ -0,0 +1,23 @@ +package com.example.dateplanner.models.entities; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Column; +import org.springframework.data.relational.core.mapping.Table; + +import java.time.LocalDateTime; +import java.util.UUID; + +@Data +@NoArgsConstructor +@Table(name = "dating_plans") +public class DatingPlan { + @Id + private UUID uuid; + + @Column("created_at") + private LocalDateTime createdAt; + @Column("updated_at") + private LocalDateTime updatedAt; +} diff --git a/src/main/java/com/example/dateplanner/models/entities/DatingProfile.java b/src/main/java/com/example/dateplanner/models/entities/DatingProfile.java new file mode 100644 index 0000000..86356b4 --- /dev/null +++ b/src/main/java/com/example/dateplanner/models/entities/DatingProfile.java @@ -0,0 +1,23 @@ +package com.example.dateplanner.models.entities; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Column; +import org.springframework.data.relational.core.mapping.Table; + +import java.time.LocalDateTime; +import java.util.UUID; + +@Data +@NoArgsConstructor +@Table(name = "dating_profiles") +public class DatingProfile { + @Id + private UUID uuid; + + @Column("created_at") + private LocalDateTime createdAt; + @Column("updated_at") + private LocalDateTime updatedAt; +} diff --git a/src/main/java/com/example/dateplanner/models/entities/Feedback.java b/src/main/java/com/example/dateplanner/models/entities/Feedback.java new file mode 100644 index 0000000..0bf00b3 --- /dev/null +++ b/src/main/java/com/example/dateplanner/models/entities/Feedback.java @@ -0,0 +1,28 @@ +package com.example.dateplanner.models.entities; + +import jakarta.persistence.Table; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Column; + +import java.time.LocalDateTime; +import java.util.UUID; + +@Data +@NoArgsConstructor +@Table(name = "feedbacks") +public class Feedback { + @Id + private UUID uuid; + private UUID userUuid; + @Column("dating_place_uuid") + private UUID datingPlaceUuid; + private int feedback; + private String comment; + + @Column("created_at") + private LocalDateTime createdAt; + @Column("updated_at") + private LocalDateTime updatedAt; +} diff --git a/src/main/java/com/example/dateplanner/models/entities/Organization.java b/src/main/java/com/example/dateplanner/models/entities/Organization.java new file mode 100644 index 0000000..0114c9f --- /dev/null +++ b/src/main/java/com/example/dateplanner/models/entities/Organization.java @@ -0,0 +1,30 @@ +package com.example.dateplanner.models.entities; + +import jakarta.persistence.Table; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Column; +import java.time.LocalDateTime; +import java.util.UUID; + +@Data +@NoArgsConstructor +@Table(name = "organizations") +public class Organization { + @Id + private UUID uuid; + private String logo; + private String title; + private String description; // хтмл код + @Column("owner_uuid") + private UUID ownerUuid; + + @Column("expires_at") + private LocalDateTime expiresAt; + + @Column("created_at") + private LocalDateTime createdAt; + @Column("updated_at") + private LocalDateTime updatedAt; +} diff --git a/src/main/java/com/example/dateplanner/models/entities/Schedule.java b/src/main/java/com/example/dateplanner/models/entities/Schedule.java new file mode 100644 index 0000000..4e350cd --- /dev/null +++ b/src/main/java/com/example/dateplanner/models/entities/Schedule.java @@ -0,0 +1,20 @@ +package com.example.dateplanner.models.entities; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Table; +import java.time.DayOfWeek; +import java.time.LocalTime; +import java.util.UUID; + +@Data +@NoArgsConstructor +@Table("schedules") +public class Schedule { + @Id + private UUID uuid; + private DayOfWeek dayOfWeek; + private LocalTime startTime; + private LocalTime endTime; +} diff --git a/src/main/java/com/example/dateplanner/models/enums/DatingTime.java b/src/main/java/com/example/dateplanner/models/enums/DatingTime.java new file mode 100644 index 0000000..6d80eaa --- /dev/null +++ b/src/main/java/com/example/dateplanner/models/enums/DatingTime.java @@ -0,0 +1,19 @@ +package com.example.dateplanner.models.enums; + +public enum DatingTime { + MORNING("Утро"), + DAY("День"), + EVENING("Вечер"), + NIGHT("Ночь"), + ANY("Любое"); + + private final String title; + + DatingTime(String title){ + this.title = title; + } + + public String getTitle() { + return title; + } +} diff --git a/src/main/java/com/example/dateplanner/models/enums/DatingType.java b/src/main/java/com/example/dateplanner/models/enums/DatingType.java new file mode 100644 index 0000000..ed6d620 --- /dev/null +++ b/src/main/java/com/example/dateplanner/models/enums/DatingType.java @@ -0,0 +1,22 @@ +package com.example.dateplanner.models.enums; + +public enum DatingType { + ROMANTIC("Романтическое"), + ACTIVE("Активное"), + INTELLECTUAL("Интеллектуальное"), + HORROR("Хоррор"), + COZY("Уют"), + MYSTERY("Тайна"), + CREATIVE("Творческое"), + OPENAIR("На открытом воздухе"), + GASTRONOMIC("Гастрономия"); + + private final String title; + DatingType(String title){ + this.title = title; + } + + public String getTitle() { + return title; + } +} diff --git a/src/main/java/com/example/dateplanner/models/enums/PriceType.java b/src/main/java/com/example/dateplanner/models/enums/PriceType.java new file mode 100644 index 0000000..51cb0c7 --- /dev/null +++ b/src/main/java/com/example/dateplanner/models/enums/PriceType.java @@ -0,0 +1,17 @@ +package com.example.dateplanner.models.enums; + +public enum PriceType { + ECONOMY("Эконом"), + AVERAGE("Средний"), + PREMIUM("Премиум"); + + private final String title; + + PriceType(String title){ + this.title = title; + } + + public String getTitle() { + return title; + } +} diff --git a/src/main/java/com/example/dateplanner/repositories/DatingPlaceRepository.java b/src/main/java/com/example/dateplanner/repositories/DatingPlaceRepository.java new file mode 100644 index 0000000..faa4190 --- /dev/null +++ b/src/main/java/com/example/dateplanner/repositories/DatingPlaceRepository.java @@ -0,0 +1,10 @@ +package com.example.dateplanner.repositories; + +import com.example.dateplanner.models.entities.DatingPlace; +import org.springframework.data.r2dbc.repository.R2dbcRepository; + +import java.util.UUID; + +public interface DatingPlaceRepository extends R2dbcRepository { + +} diff --git a/src/main/java/com/example/dateplanner/repositories/DatingPlanRepository.java b/src/main/java/com/example/dateplanner/repositories/DatingPlanRepository.java new file mode 100644 index 0000000..26524a3 --- /dev/null +++ b/src/main/java/com/example/dateplanner/repositories/DatingPlanRepository.java @@ -0,0 +1,10 @@ +package com.example.dateplanner.repositories; + +import com.example.dateplanner.models.entities.DatingPlan; +import org.springframework.data.r2dbc.repository.R2dbcRepository; + +import java.util.UUID; + +public interface DatingPlanRepository extends R2dbcRepository { + +} diff --git a/src/main/java/com/example/dateplanner/repositories/DatingProfileRepository.java b/src/main/java/com/example/dateplanner/repositories/DatingProfileRepository.java new file mode 100644 index 0000000..e26c1e0 --- /dev/null +++ b/src/main/java/com/example/dateplanner/repositories/DatingProfileRepository.java @@ -0,0 +1,10 @@ +package com.example.dateplanner.repositories; + +import com.example.dateplanner.models.entities.DatingProfile; +import org.springframework.data.r2dbc.repository.R2dbcRepository; + +import java.util.UUID; + +public interface DatingProfileRepository extends R2dbcRepository { + +} diff --git a/src/main/java/com/example/dateplanner/repositories/FeedbackRepository.java b/src/main/java/com/example/dateplanner/repositories/FeedbackRepository.java new file mode 100644 index 0000000..cf08e20 --- /dev/null +++ b/src/main/java/com/example/dateplanner/repositories/FeedbackRepository.java @@ -0,0 +1,10 @@ +package com.example.dateplanner.repositories; + +import com.example.dateplanner.models.entities.Feedback; +import org.springframework.data.r2dbc.repository.R2dbcRepository; + +import java.util.UUID; + +public interface FeedbackRepository extends R2dbcRepository { + +} diff --git a/src/main/java/com/example/dateplanner/repositories/OrganizationRepository.java b/src/main/java/com/example/dateplanner/repositories/OrganizationRepository.java new file mode 100644 index 0000000..0ef4351 --- /dev/null +++ b/src/main/java/com/example/dateplanner/repositories/OrganizationRepository.java @@ -0,0 +1,10 @@ +package com.example.dateplanner.repositories; + +import com.example.dateplanner.models.entities.Organization; +import org.springframework.data.r2dbc.repository.R2dbcRepository; + +import java.util.UUID; + +public interface OrganizationRepository extends R2dbcRepository { + +} diff --git a/src/main/java/com/example/dateplanner/repositories/ScheduleRepository.java b/src/main/java/com/example/dateplanner/repositories/ScheduleRepository.java new file mode 100644 index 0000000..8ceb4bb --- /dev/null +++ b/src/main/java/com/example/dateplanner/repositories/ScheduleRepository.java @@ -0,0 +1,10 @@ +package com.example.dateplanner.repositories; + +import com.example.dateplanner.models.entities.Schedule; +import org.springframework.data.r2dbc.repository.R2dbcRepository; + +import java.util.UUID; + +public interface ScheduleRepository extends R2dbcRepository { + +} diff --git a/src/main/java/com/example/dateplanner/services/DatingPlaceService.java b/src/main/java/com/example/dateplanner/services/DatingPlaceService.java new file mode 100644 index 0000000..f598e19 --- /dev/null +++ b/src/main/java/com/example/dateplanner/services/DatingPlaceService.java @@ -0,0 +1,13 @@ +package com.example.dateplanner.services; + +import com.example.dateplanner.repositories.DatingPlaceRepository; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +public class DatingPlaceService { + private final DatingPlaceRepository datingPlaceRepository; + + +} diff --git a/src/main/java/com/example/dateplanner/services/DatingPlanService.java b/src/main/java/com/example/dateplanner/services/DatingPlanService.java new file mode 100644 index 0000000..6bcff80 --- /dev/null +++ b/src/main/java/com/example/dateplanner/services/DatingPlanService.java @@ -0,0 +1,12 @@ +package com.example.dateplanner.services; + +import com.example.dateplanner.repositories.DatingPlanRepository; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +public class DatingPlanService { + private final DatingPlanRepository datingPlanRepository; + +} diff --git a/src/main/java/com/example/dateplanner/services/DatingProfileService.java b/src/main/java/com/example/dateplanner/services/DatingProfileService.java new file mode 100644 index 0000000..b9a0b6b --- /dev/null +++ b/src/main/java/com/example/dateplanner/services/DatingProfileService.java @@ -0,0 +1,11 @@ +package com.example.dateplanner.services; + +import com.example.dateplanner.repositories.DatingProfileRepository; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +public class DatingProfileService { + private final DatingProfileRepository datingProfileRepository; +} diff --git a/src/main/java/com/example/dateplanner/services/FeedbackService.java b/src/main/java/com/example/dateplanner/services/FeedbackService.java new file mode 100644 index 0000000..7c0276a --- /dev/null +++ b/src/main/java/com/example/dateplanner/services/FeedbackService.java @@ -0,0 +1,12 @@ +package com.example.dateplanner.services; + +import com.example.dateplanner.repositories.FeedbackRepository; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +public class FeedbackService { + private final FeedbackRepository feedbackRepository; + +} diff --git a/src/main/java/com/example/dateplanner/services/OrganizationService.java b/src/main/java/com/example/dateplanner/services/OrganizationService.java new file mode 100644 index 0000000..91278ad --- /dev/null +++ b/src/main/java/com/example/dateplanner/services/OrganizationService.java @@ -0,0 +1,12 @@ +package com.example.dateplanner.services; + +import com.example.dateplanner.repositories.OrganizationRepository; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +public class OrganizationService { + private final OrganizationRepository organizationRepository; + +} diff --git a/src/main/java/com/example/dateplanner/services/ScheduleService.java b/src/main/java/com/example/dateplanner/services/ScheduleService.java new file mode 100644 index 0000000..31c808d --- /dev/null +++ b/src/main/java/com/example/dateplanner/services/ScheduleService.java @@ -0,0 +1,11 @@ +package com.example.dateplanner.services; + +import com.example.dateplanner.repositories.ScheduleRepository; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +public class ScheduleService { + private final ScheduleRepository scheduleRepository; +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 807b2b6..53aa366 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -23,7 +23,7 @@ spring.flyway.locations=db/migration spring.flyway.validate-migration-naming=true spring.flyway.baseline-on-migrate=true #====================== minio configuration ===================== -minio.bucket= +minio.bucket=${spring.application.name} minio.url= minio.cdn= minio.username= diff --git a/src/main/resources/static/css/header.css b/src/main/resources/static/css/header.css new file mode 100644 index 0000000..238bb72 --- /dev/null +++ b/src/main/resources/static/css/header.css @@ -0,0 +1,124 @@ + +.user-avatar { + width: 36px; + height: 36px; + border-radius: 50%; + background: #e74c3c; + color: white; + display: flex; + align-items: center; + justify-content: center; + font-weight: bold; + font-size: 14px; + border: 2px solid white; + box-shadow: 0 2px 5px rgba(0,0,0,0.1); +} + +.user-info { + padding: 15px; + border-bottom: 1px solid #eee; + display: flex; + align-items: center; + gap: 10px; +} + +.dropdown-item { + padding: 10px 15px; + display: flex; + align-items: center; + gap: 10px; + transition: all 0.2s; +} + +.dropdown-item:hover { + background: rgba(231, 76, 60, 0.1) !important; + color: #e74c3c !important; +} + + + +/* Модальное окно авторизации */ +.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; } diff --git a/src/main/resources/static/css/main.css b/src/main/resources/static/css/main.css new file mode 100644 index 0000000..8d18ad8 --- /dev/null +++ b/src/main/resources/static/css/main.css @@ -0,0 +1,129 @@ +.btn-heart { + background: #e74c3c !important; + color: white !important; + border: none !important; + padding: 12px 30px !important; + border-radius: 50px !important; + font-weight: 600 !important; + transition: all 0.3s !important; +} + +.btn-heart:hover { + background: #c0392b !important; + transform: translateY(-3px) !important; + box-shadow: 0 10px 20px rgba(231, 76, 60, 0.3) !important; + 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; +} + +.heart-animation { + position: absolute; + font-size: 30px; + color: rgba(255, 255, 255, 0.3); + animation: float 6s infinite ease-in-out; +} + +@keyframes float { + 0%, 100% { transform: translateY(0) rotate(0deg); } + 50% { transform: translateY(-100px) rotate(180deg); } +} + +.hero-title { + font-size: 3.5rem; + font-weight: 800; + text-shadow: 2px 2px 4px rgba(0,0,0,0.2); +} + +.color-grey { + color: #737373; +} + +.category-romantic { border-color: #fd79a8; color: #fd79a8; } +.category-active { border-color: #2ecc71; color: #2ecc71; } +.category-intellectual { border-color: #3498db; color: #3498db; } +.category-horror { border-color: #2c3e50; color: #2c3e50; } +.category-cozy { border-color: #e67e22; color: #e67e22; } +.category-mystery { border-color: #9b59b6; color: #9b59b6; } +.category-luxury { border-color: #f1c40f; color: #f1c40f; } +.category-budget { border-color: #27ae60; color: #27ae60; } + +.filter-card { + background: white; + border-radius: 20px; + padding: 25px; + box-shadow: 0 10px 30px rgba(0,0,0,0.08); + margin-bottom: 30px; +} + +.filter-btn { + border: 2px solid transparent; + padding: 10px 20px; + border-radius: 50px; + margin: 5px; + transition: all 0.3s; + font-weight: 500; + cursor: pointer; +} + +.filter-btn:hover, .filter-btn.active { + transform: translateY(-3px); + box-shadow: 0 5px 15px rgba(0,0,0,0.1); +} + +.filter-btn.active { + border-color: #e74c3c; + color: #e74c3c; + background: rgba(231, 76, 60, 0.1); +} + + + + +footer { + background: #2d3436; + color: white; + padding: 60px 0 30px; + margin-top: 80px; +} + +.social-icon { + width: 40px; + height: 40px; + background: rgba(255,255,255,0.1); + border-radius: 50%; + display: inline-flex; + align-items: center; + justify-content: center; + margin-right: 10px; + transition: all 0.3s; +} + +.social-icon:hover { + background: var(--love-red); + transform: translateY(-3px); +} diff --git a/src/main/resources/static/css/places.css b/src/main/resources/static/css/places.css new file mode 100644 index 0000000..4142c1c --- /dev/null +++ b/src/main/resources/static/css/places.css @@ -0,0 +1,73 @@ +.place-card { + border: none; + border-radius: 20px; + overflow: hidden; + transition: transform 0.3s, box-shadow 0.3s; + margin-bottom: 30px; + height: 100%; +} + +.place-card:hover { + transform: translateY(-10px); + box-shadow: 0 20px 40px rgba(0,0,0,0.15); +} + +.place-img { + height: 200px; + object-fit: cover; + width: 100%; +} + +.place-category { + position: absolute; + top: 15px; + right: 15px; + padding: 5px 15px; + border-radius: 20px; + font-size: 0.8rem; + font-weight: 600; +} + +.heart-counter { + position: absolute; + top: 10px; + left: 10px; + background: rgba(255,255,255,0.9); + padding: 5px 10px; + border-radius: 20px; + font-weight: 600; + font-size: 0.9rem; +} + +.heart-counter i { + color: #e74c3c; + margin-right: 5px; +} + +.rating { + color: #f1c40f; + font-size: 0.9rem; +} + +.price-tag { + font-weight: 700; + font-size: 1.2rem; + color: #e74c3c; +} + +.place-category { + position: absolute; + top: 15px; + right: 15px; + padding: 5px 15px; + border-radius: 20px; + font-size: 0.8rem; + font-weight: 600; +} + +.romantic-badge { background: #FD79A8FF; color: white; } +.active-badge { background: #2ECC71FF; color: white; } +.intellectual-badge { background: #3498DBFF; color: white; } +.horror-badge { background: #2C3E50FF; color: white; } +.cozy-badge { background: #E67E22FF; color: white; } +.mystery-badge { background: #9B59B6FF; color: white; } \ No newline at end of file diff --git a/src/main/resources/static/js/site/blocks/place-filters.js b/src/main/resources/static/js/site/blocks/place-filters.js new file mode 100644 index 0000000..833c0e4 --- /dev/null +++ b/src/main/resources/static/js/site/blocks/place-filters.js @@ -0,0 +1,95 @@ +let currentFilters = {category: [], price: [], time: []}; +export function initPlaceFilters($filtersContainer) { + console.log("init places filters"); + + // Одна общая функция для всех фильтров + function toggleFilter(event) { + const $btn = $(event.currentTarget); + $btn.toggleClass('active'); + + // Можно получить тип и значение фильтра + const type = $btn.data('type'); + const value = $btn.data('value'); + + console.log(`Фильтр: ${type} = ${value}, активен: ${$btn.hasClass('active')}`); + + // ОБНОВЛЯЕМ МАССИВ ФИЛЬТРОВ! + if ($btn.hasClass('active')) { + // Добавляем фильтр, если его еще нет + if (!currentFilters[type].includes(value)) { + currentFilters[type].push(value); + } + } else { + // Удаляем фильтр + currentFilters[type] = currentFilters[type].filter(item => item !== value); + } + + // Здесь можно обновить данные или сделать запрос + // Триггерим событие изменения фильтров + $(document).trigger('filtersChanged', [currentFilters]); + } + + const $filters = $(` + + + + Какое свидание вы ищете? + + + Тип свидания + + + Романтическое + + + Активное + + + Интеллектуальное + + + Хоррор + + + Уютное + + + Тайна + + + + + Бюджет + + + Эконом (до 2,000₽) + + + Премиум (от 5,000₽) + + + + Время + + + День + + + Вечер + + + Ночь + + + + + + + + `); + + // Вешаем один обработчик на все кнопки + $filters.on('click', '.filter-btn', toggleFilter); + + $filtersContainer.append($filters); +} \ No newline at end of file diff --git a/src/main/resources/static/js/site/blocks/places-block.js b/src/main/resources/static/js/site/blocks/places-block.js new file mode 100644 index 0000000..45a0b92 --- /dev/null +++ b/src/main/resources/static/js/site/blocks/places-block.js @@ -0,0 +1,35 @@ +import {createCard} from "./single-place-card.js"; + +export function initPlacesBlock($container) { + console.log("initPlacesBlock") + $container.append( + $(` + + + + + + `) + ) + + function loadPlaces(filters = {}) { + $('#placesContainer').empty().append('Загрузка...'); + + // Задержка 500ms перед отрисовкой + setTimeout(() => { + $('#placesContainer').empty(); + console.log("новые фильтры в loadPlaces: ", filters) + for (let i = 0; i < 10; i++) { + $('#placesContainer').append($(createCard())); + } + }, 1500); + } + + $(document).on('filtersChanged', (e, filters) => { + console.log('Фильтры изменились:', filters); + loadPlaces(filters); + }); + + // первая загрузка + loadPlaces() +} \ No newline at end of file diff --git a/src/main/resources/static/js/site/blocks/single-place-card.js b/src/main/resources/static/js/site/blocks/single-place-card.js new file mode 100644 index 0000000..6e33202 --- /dev/null +++ b/src/main/resources/static/js/site/blocks/single-place-card.js @@ -0,0 +1,31 @@ +export function createCard() { + return ` + + + + + Романтическое + + 128 + + + + Ресторан 'Панорама' + Ресторан на 25-м этаже с панорамным видом на город. Идеальное место для романтического ужина при све... + + + + ★★★★½ + 4.8 + + 4500₽ + + + Подробнее + + + + + + ` +} \ No newline at end of file diff --git a/src/main/resources/templates/blocks/deepseek_html_20260202_b82073.html b/src/main/resources/templates/blocks/deepseek_html_20260202_b82073.html new file mode 100644 index 0000000..53b0a8d --- /dev/null +++ b/src/main/resources/templates/blocks/deepseek_html_20260202_b82073.html @@ -0,0 +1,652 @@ + + + + + + DatePlanner - Идеальные места для свиданий + + + + + + + + + + + DatePlanner + + + + + + + + Места + + + Карта + + + Идеи + + + Для организаций + + + + + + + + Войти + + + + + + + А + Алексей + + + + + А + + Алексей Петров + alexey@example.com + + + + + Мои избранные + Мои бронирования + Мои отзывы + + Добавить место + + Настройки + Выйти + + + + + Добавить место + + + + + + + + + ❤️ + ❤️ + ❤️ + ❤️ + + + + + Найдите идеальное место для свидания + Более 500 проверенных локаций: от романтических ужинов до экстремальных приключений. Подберите свидание по настроению, бюджету и интересам. + + + Найти место + + + Посмотреть на карте + + + + + + + + + + + + + + + + + + + + + + Вход в DatePlanner + + + + + + Вы успешно вошли в систему! + + + + + + Вход + + + + + Регистрация + + + + + + + + + + Email или телефон + + + + Пароль + + + Забыли пароль? + + + + + Запомнить меня + + Войти + + + + или войдите через + + + + ВКонтакте + + + Google + + + Яндекс + + + + + + + + + Имя + + + + Фамилия + + + + + Email + + + + Пароль + + Минимум 6 символов + + + Подтвердите пароль + + + + + + Я принимаю условия использования и + политику конфиденциальности + + + Зарегистрироваться + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/com/example/dateplanner/DatePlannerApplicationTests.java b/src/test/java/com/example/dateplanner/DatingPlannerApplicationTests.java similarity index 83% rename from src/test/java/com/example/dateplanner/DatePlannerApplicationTests.java rename to src/test/java/com/example/dateplanner/DatingPlannerApplicationTests.java index ce21628..1a2e951 100644 --- a/src/test/java/com/example/dateplanner/DatePlannerApplicationTests.java +++ b/src/test/java/com/example/dateplanner/DatingPlannerApplicationTests.java @@ -4,7 +4,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest -class DatePlannerApplicationTests { +class DatingPlannerApplicationTests { @Test void contextLoads() {
Ресторан на 25-м этаже с панорамным видом на город. Идеальное место для романтического ужина при све...
Более 500 проверенных локаций: от романтических ужинов до экстремальных приключений. Подберите свидание по настроению, бюджету и интересам.