Skip to content

Commit

Permalink
1) Made adaptive styles
Browse files Browse the repository at this point in the history
2) Api tour filter fix
  • Loading branch information
Sgadmer committed Jun 14, 2022
1 parent 44922e7 commit 2cfeb0d
Show file tree
Hide file tree
Showing 42 changed files with 576 additions and 130 deletions.
4 changes: 0 additions & 4 deletions backend/controllers/tour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export const findByParams = async (req, res) => {
touristId,
excludeTouristId,
agentId,
mainPhoto,
addPhotos,
title,
place,
dateStart,
Expand Down Expand Up @@ -66,8 +64,6 @@ export const findByParams = async (req, res) => {
res.status(200)
.json((await getTourService.findByParams(_.omitBy({
agentId,
mainPhoto,
addPhotos,
title,
price: priceFilter,
place: placeFilter,
Expand Down
9 changes: 7 additions & 2 deletions backend/services/tour/get.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { Tour } from '../../models/tour'

const findAll = async () => Tour.find({}).populate(['agentId', 'tourists.touristId'])
const findAll = async () => Tour.find({}).populate(['agentId', 'tourists.touristId']).sort({ dateStart: -1 })

const findById = async (id) => Tour.findById(id).populate(['agentId', 'tourists.touristId'])

const findByParams = async (params) => Tour.find(params).populate(['agentId', 'tourists.touristId'])
const findByParams = async (params) => (
Tour
.find(params)
.sort({ dateStart: -1 })
.populate(['agentId', 'tourists.touristId'])
)

const findTouristsBooks = async (touristId) => Tour.find({ 'tourists.touristId': touristId }, {
mainPhoto: 1,
Expand Down
9 changes: 8 additions & 1 deletion frontend/assets/styles/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $colors: (
'danger': #F82424,
'danger-light': #FDB6B6,
'danger-lightest': #FFF5F5,
'warning': #FFE30F,
'warning': #EFD300,
'success': #99E62E,
'success-light': #CEEED1,
'success-lightest': #F9FDFA,
Expand Down Expand Up @@ -123,6 +123,13 @@ $spacers: (
}
}


@mixin break-xl-up() {
@media (min-width: $xl) {
@content;
}
}

@mixin text($font-size, $line-height, $color: '', $font-weight: '',) {
font-size: $font-size;
line-height: $line-height;
Expand Down
14 changes: 11 additions & 3 deletions frontend/assets/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ body {
font-family: $primary-font-family, $fallback-font-family;
background-color: cl('white');
max-width: 1440px;

@include break-xl() {
padding: 20px;
}

@include break-sm(){
padding: 10px 8px 20px 8px;
}
}

#__nuxt {
Expand All @@ -64,7 +72,7 @@ h1, .h1 {
font-size: 140px;
line-height: 140px;

@include break-lg {
@include break-xl {
font-size: 52px;
line-height: 56px;
letter-spacing: unset;
Expand All @@ -81,7 +89,7 @@ h2, .h2 {
line-height: 88px;
}

@include break-lg {
@include break-xl {
font-size: 24px;
line-height: 32px;

Expand All @@ -102,7 +110,7 @@ h3, .h3 {
line-height: 48px;
}

@include break-lg {
@include break-xl {
font-size: 20px;
line-height: 24px;

Expand Down
1 change: 0 additions & 1 deletion frontend/components/common/Admin/Admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* IMPORTS
*/
import $s from '../common.module.scss'
import { useAdminStore } from '~@store/admin'
Expand Down
17 changes: 0 additions & 17 deletions frontend/components/common/Admin/Lists/AgentsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
@onSubmit="handleFiltersChange"
/>

<!-- <div :class="[$s.Common__Row, $s.Common__Row_Center]">-->
<!-- <Tabs-->
<!-- :tabs="tabs"-->
<!-- @onTabChange="handleTabChange"-->
<!-- class="ToursList__Tabs"-->
<!-- />-->
<!-- </div>-->
<ScrollContainer>
<ListCardUser
v-for="(agent, i) in agents"
Expand Down Expand Up @@ -124,14 +117,4 @@ const handleFiltersChange = (formData: Record<string, any>) => {
</script>

<style scoped lang="scss">
.ToursList {
&__Tabs {
width: auto;
margin-right: 35px;
}
&__CreateBtn {
margin-bottom: 4px;
}
}
</style>
7 changes: 0 additions & 7 deletions frontend/components/common/Admin/Lists/TouristsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
/>


<!-- <div :class="[$s.Common__Row, $s.Common__Row_Center]">-->
<!-- <Tabs-->
<!-- :tabs="tabs"-->
<!-- @onTabChange="handleTabChange"-->
<!-- class="ToursList__Tabs"-->
<!-- />-->
<!-- </div>-->
<ScrollContainer>
<ListCardUser
v-for="(tourist, i) in tourists"
Expand Down
13 changes: 0 additions & 13 deletions frontend/components/common/Admin/Lists/ToursList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
@onSubmit="handleFiltersChange"
/>

<div :class="[$s.Common__Row, $s.Common__Row_Center]">
<Tabs
:tabs="tabs"
@onTabChange="handleTabChange"
class="ToursList__Tabs"
/>
</div>
<ScrollContainer>
<TourCard
v-for="card in $toursStore.getAccountTours"
Expand Down Expand Up @@ -150,14 +147,4 @@ const handleFiltersChange = (formData: Record<string, any>) => {
</script>

<style scoped lang="scss">
.ToursList {
&__Tabs {
width: auto;
margin-right: 35px;
}
&__CreateBtn {
margin-bottom: 4px;
}
}
</style>
23 changes: 23 additions & 0 deletions frontend/components/common/Agent/ToursList/ToursList.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@import '@styles/common.scss';

.ToursList {

&__AgentsTabs {
display: flex;
justify-content: center;

@include break-xl() {
flex-direction: column-reverse;
}
}

&__CreateBtn {
margin-bottom: 5px;

@include break-xl() {
max-width: fit-content;
margin-left: auto;
margin-bottom: 20px;
}
}
}
22 changes: 6 additions & 16 deletions frontend/components/common/Agent/ToursList/ToursList.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<template>
<FiltersForm
:class="$s.Common__FiltersForm"
:class="$sCommon.Common__FiltersForm"
@onSubmit="handleFiltersChange"
/>
<div :class="[$s.Common__Row, $s.Common__Row_Center]">
<div :class="$s.ToursList__AgentsTabs">
<Tabs
:tabs="tabs"
@onTabChange="handleTabChange"
class="ToursList__Tabs"
/>
<Button
kind="Main"
corners="Md"
class="ToursList__CreateBtn"
:class="$s.ToursList__CreateBtn"
@click="handleCreateTourModalOpen"
>
Создать&nbsp;&nbsp;&nbsp;+
Expand All @@ -34,7 +33,9 @@
/**
* IMPORTS
*/
import $s from '../../common.module.scss'
import $s from './ToursList.module.scss'
import $sCommon from '../../common.module.scss'
import { EModalsNames } from '~/constants/modals'
import { useModalsStore } from '~@store/modals'
import { useUserStore } from '~@store/user'
Expand Down Expand Up @@ -135,7 +136,6 @@ onBeforeMount((): void => {
})
/**
* METHODS
*/
Expand Down Expand Up @@ -167,14 +167,4 @@ const handleFiltersChange = (formData: Record<string, any>) => {
</script>

<style scoped lang="scss">
.ToursList {
&__Tabs {
width: auto;
margin-right: 35px;
}
&__CreateBtn {
margin-bottom: 4px;
}
}
</style>
8 changes: 8 additions & 0 deletions frontend/components/common/Main/AllTours/AllTours.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@
width: 100%;
margin-top: 95px;

@include break-xl() {
margin-top: 40px;
}

&__TitleWrap {
width: 100%;
text-align: center;
margin-bottom: 40px;

@include break-xl() {
margin-bottom: 20px;
}
}

&__Promo{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
border-radius: 72px 72px 0 0;
overflow: hidden;

@include break-xl() {
height: 305px;
border-radius: 25px 25px 0 0;
}

@include break-sm() {
height: 235px;
}

&__Wrapper {
position: relative;
Expand All @@ -28,6 +36,14 @@
left: 0;
background: cl('white');
mix-blend-mode: lighten;

@include break-xl() {
font-size: 42px;
}

@include break-sm() {
font-size: 35px;
}
}

&__Video {
Expand All @@ -45,6 +61,14 @@
left: 0;
bottom: 0;
right: 0;

@include break-xl() {
max-height: 235px;
}

@include break-sm() {
max-height: 170px;
}
}
}

Expand Down
13 changes: 13 additions & 0 deletions frontend/components/common/Modals/Modals.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,19 @@
font-weight: 500;
font-size: 28px;
line-height: 36px;

@include break-xl() {
flex-direction: column;
margin-bottom: 20px;
}
}

&__InfoList {
margin-bottom: 200px;

@include break-xl() {
margin-bottom: 50px;
}
}

&__InfoTerm {
Expand All @@ -32,6 +41,10 @@
width: 100%;
display: flex;
justify-content: center;

@include break-xl() {
margin-top: 60px;
}
}

&__ConfirmBtn {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

&__FormFields {
margin-bottom: 70px;

@include break-xl() {
margin-bottom: 40px;
}
}

&__PasswordInput {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@
&__FormFields {
width: 100%;
margin-bottom: 90px;

@include break-xl() {
margin-bottom: 40px;
}
}
}
Loading

0 comments on commit 2cfeb0d

Please sign in to comment.