Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RK2 #24

Merged
merged 97 commits into from
Nov 5, 2024
Merged

RK2 #24

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
e984fba
Fix profile url
FireSpirit171 Oct 31, 2024
032fca4
Fix distortion of avatar
rasulov1337 Oct 31, 2024
89aee2a
Variables naming hell
rasulov1337 Oct 31, 2024
28696e7
Retrieve data from backend not use mocks
rasulov1337 Oct 31, 2024
ba69896
Add PATCH method for Ajax.ts
rasulov1337 Oct 31, 2024
c2fd84c
Add getAdsOfUser & updateAdvert methods
rasulov1337 Oct 31, 2024
c5ee8ac
Fix EditAdvertPage to create/edit advertisements
rasulov1337 Oct 31, 2024
52219ac
Add more router paths
rasulov1337 Oct 31, 2024
33bc2d1
Replace locaiton.reload() with SPA reload
rasulov1337 Oct 31, 2024
e9406e1
Update styles for buttons in MainPhoto.scss
rasulov1337 Oct 31, 2024
aa5f03d
Display address field for advertisement
rasulov1337 Oct 31, 2024
ec7e9bb
Fix get profile
FireSpirit171 Nov 1, 2024
561fcbc
Delete city and address
FireSpirit171 Nov 1, 2024
6a27c64
Delete Consts.ts
rasulov1337 Nov 1, 2024
c968d66
Add function to get list of cities
rasulov1337 Nov 1, 2024
80bea38
Fix AdvertPage:
rasulov1337 Nov 1, 2024
8c79aed
Add searchPopup
FireSpirit171 Nov 2, 2024
8d40cdd
Finished search popup
FireSpirit171 Nov 2, 2024
d1de50f
Fix template recompilation
rasulov1337 Oct 31, 2024
2bda6bd
Change port and host of vite app
rasulov1337 Oct 31, 2024
5cf9a21
Add support for nginx
rasulov1337 Oct 31, 2024
a114fc2
Update nginx to work with HTTPS
rasulov1337 Oct 31, 2024
e8a64c7
Update nginx conf
rasulov1337 Nov 1, 2024
a25feea
Update backend BASE_URL
rasulov1337 Nov 1, 2024
fec5bf7
Update path
rasulov1337 Nov 1, 2024
f5e05e8
Redirect image fetches to minio
rasulov1337 Nov 2, 2024
ebdbc3a
Move IMG_HOST env variable
rasulov1337 Nov 2, 2024
d510889
Fix nginx conf
rasulov1337 Nov 2, 2024
fb75523
Move images to public directory
rasulov1337 Nov 2, 2024
eded0e5
Fix proxy pass for images domain
rasulov1337 Nov 2, 2024
88da4bb
Add automatic cert generation
rasulov1337 Nov 2, 2024
ac366ea
Fix permission denied error
rasulov1337 Nov 2, 2024
e528ff6
Update gitignore
rasulov1337 Nov 2, 2024
e04e56d
Merge pull request #21 from frontend-park-mail-ru/nginx
rasulov1337 Nov 2, 2024
442632e
Fix vite's hot reload in docker container
rasulov1337 Nov 3, 2024
27a4214
Fix advertisements being not displayed
rasulov1337 Nov 3, 2024
8174449
Refactor code
rasulov1337 Nov 3, 2024
02ce3ca
Update AdsFilters interface
rasulov1337 Nov 3, 2024
af9132b
Delete / from url
FireSpirit171 Nov 3, 2024
0363957
Add new method getCity
FireSpirit171 Nov 3, 2024
d3fcb92
Fix no-scroll after search
FireSpirit171 Nov 3, 2024
518fd9a
Rewrite filter on hbs, make reset button
FireSpirit171 Nov 3, 2024
d5ea8c0
Add getFilterValues function
FireSpirit171 Nov 3, 2024
b89d140
Delete /dashboard URL
rasulov1337 Nov 3, 2024
9dd43ba
Fix wrong image prefix
rasulov1337 Nov 3, 2024
8d17b3d
Add alert popup in the right bottom corner
rasulov1337 Nov 3, 2024
4ba6c58
Fix double rendering of a page
rasulov1337 Nov 3, 2024
e8ead4e
Add service worker & PWA support
rasulov1337 Nov 3, 2024
d424d43
Add alert popup in the right bottom corner
rasulov1337 Nov 3, 2024
2be1a3e
Add styles of alert popup to main styles
rasulov1337 Nov 3, 2024
d1af727
Delete addPrefix everywhere
FireSpirit171 Nov 3, 2024
e9dfe2d
Delete addPrefix everywhere
FireSpirit171 Nov 3, 2024
6981f0d
Add error message popup when failed upload photo
FireSpirit171 Nov 3, 2024
f2b0f2b
Delete /dashboard & useless callbacks from Header (use router)
rasulov1337 Nov 4, 2024
d7acf2d
Fix router errors
rasulov1337 Nov 4, 2024
c96e2e8
Update EditAdvertPage
rasulov1337 Nov 4, 2024
1079801
Fix double rendering of header on logout
rasulov1337 Nov 4, 2024
dbd4ed3
Update AdListPage styles: hover effect
rasulov1337 Nov 4, 2024
f7c59f7
Replace CDN's handlebars with local one
rasulov1337 Nov 4, 2024
3bb7e93
Add method for deletion of image from ad
rasulov1337 Nov 4, 2024
35884f2
Forgot to add hbs file
rasulov1337 Nov 4, 2024
f4aa802
Update image paths according to the backend
rasulov1337 Nov 4, 2024
886f289
Update image paths & advert data interface
rasulov1337 Nov 4, 2024
cc621f8
Add deletion of images of an advert
rasulov1337 Nov 4, 2024
74885c8
Convert AdPage to function component
rasulov1337 Nov 4, 2024
5aa60bd
Fix some TS errors
rasulov1337 Nov 4, 2024
7c894b9
Fix deletion of uploaded images
rasulov1337 Nov 4, 2024
d3cc5e6
fix: eslint: Ignore hbs file
rasulov1337 Nov 5, 2024
cd05dc4
feat: add method for calculating age
rasulov1337 Nov 5, 2024
8835237
fix: update styles
rasulov1337 Nov 5, 2024
041cbb7
chore: update dependencies
rasulov1337 Nov 5, 2024
3f40262
fix: fix author info on advert page
rasulov1337 Nov 5, 2024
6023763
fix: Update filter types
rasulov1337 Nov 5, 2024
78072cc
fix: fix filters processing
rasulov1337 Nov 5, 2024
6cd2a0f
feat: enable filters
rasulov1337 Nov 5, 2024
fbfccbe
Merge branch '59-pwa' into fix-after-merge
rasulov1337 Nov 5, 2024
f830436
feat: add font requests to cache list
rasulov1337 Nov 5, 2024
2f896f8
fix: update generate-certs.sh to properly check if certs exist
rasulov1337 Nov 5, 2024
40d344e
fix(filter): make apply button of work
rasulov1337 Nov 5, 2024
dc505aa
fix: update url for editing profile
rasulov1337 Nov 5, 2024
6d1f097
feat: add method for validating image size
rasulov1337 Nov 5, 2024
3e2f04d
feat: add image validation on file upload in advert
rasulov1337 Nov 5, 2024
a58e5cd
fix: display pagination circles only once (not twice)
rasulov1337 Nov 5, 2024
90ee7b7
feath: city search
rasulov1337 Nov 5, 2024
e0f70cf
Merge branch 'fix-after-merge' of https://github.com/frontend-park-ma…
rasulov1337 Nov 5, 2024
2c8e34b
fix: proxy city images to minio
rasulov1337 Nov 5, 2024
f6c9f66
fix: delete prefix from city images
rasulov1337 Nov 5, 2024
35b2947
fix: add route for cities
rasulov1337 Nov 5, 2024
272fe71
fix: update style of search suggestions (<a>)
rasulov1337 Nov 5, 2024
6660389
chore: change default value of new ads checkbox
rasulov1337 Nov 5, 2024
8307028
fix: display user data on ad card correctly
rasulov1337 Nov 5, 2024
3d291b5
fix: prevent filter from stretching endlessly
rasulov1337 Nov 5, 2024
252f76b
fix: some strange error
rasulov1337 Nov 5, 2024
b4a3eb5
fix: replace form with div to dodge unneccessary events (onSubmit)
rasulov1337 Nov 5, 2024
0bfb00a
Delete magnifier button icon
rasulov1337 Nov 5, 2024
6057ab7
trigger rebuild
rasulov1337 Nov 5, 2024
a842758
fix some crap so linter would stfu
rasulov1337 Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
.idea/
/components/precompiled-templates.js
/images/
nginx/ssl/
22 changes: 0 additions & 22 deletions Dockerfile

This file was deleted.

176 changes: 88 additions & 88 deletions components/AdCard/AdCard.hbs
Original file line number Diff line number Diff line change
@@ -1,89 +1,89 @@
<div class='ad-card' id='card-{{id}}'>
<!-- ID is used for js not styles -->
<img class='ad_card__img1' src='{{images.[0]}}' alt='Ad card image' />
<div class='ad-card__image-pagination-div'>
<!-- Здесь будут кружочки -->
<!-- <div class="circle-full"></div>-->
<!-- <div class="circle-empty"></div>-->
</div>

<button class='ad-card__button'>
<svg
width='43'
height='43'
viewBox='0 0 43 43'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<g style='mix-blend-mode:multiply' filter='url(#filter0_d_181_2)'>
<circle cx='21.5' cy='17.5' r='17.5' fill='#9D9999' />
</g>
<path
fill-rule='evenodd'
clip-rule='evenodd'
d='M22 13.0001C20.5005 11.2526 17.9948 10.7126 16.116 12.3128C14.2372 13.913 13.9727 16.5884 15.4481 18.481C16.6749 20.0545 20.3873 23.3732 21.6041 24.4474C21.7402 24.5676 21.8082 24.6276 21.8877 24.6512C21.9569 24.6718 22.0327 24.6718 22.1021 24.6512C22.1815 24.6276 22.2495 24.5676 22.3857 24.4474C23.6024 23.3732 27.3148 20.0545 28.5416 18.481C30.017 16.5884 29.7848 13.8961 27.8737 12.3128C25.9626 10.7294 23.4995 11.2526 22 13.0001Z'
stroke='white'
stroke-width='2'
stroke-linecap='round'
stroke-linejoin='round'
/>
<defs>
<filter
id='filter0_d_181_2'
x='0'
y='0'
width='43'
height='43'
filterUnits='userSpaceOnUse'
color-interpolation-filters='sRGB'
>
<feFlood flood-opacity='0' result='BackgroundImageFix' />
<feColorMatrix
in='SourceAlpha'
type='matrix'
values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0'
result='hardAlpha'
/>
<feOffset dy='4' />
<feGaussianBlur stdDeviation='2' />
<feComposite in2='hardAlpha' operator='out' />
<feColorMatrix
type='matrix'
values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'
/>
<feBlend
mode='normal'
in2='BackgroundImageFix'
result='effect1_dropShadow_181_2'
/>
<feBlend
mode='normal'
in='SourceGraphic'
in2='effect1_dropShadow_181_2'
result='shape'
/>
</filter>
</defs>
</svg>
</button>

<div class='ad-card__info'>
<div class='ad-card__location'>
<p class='ad-card__p1'>{{city}}</p>
<p class='ad-card__p2'>{{address}}</p>
<a href='{{onMap}}' class='ad-card__href'>Показать на карте</a>
</div>
<div class='ad-card__author-info'>
<img
class='ad-card__img2'
src='{{authorAvatar}}'
alt='User avatar'
/>
<p>{{authorName}}</p>
<div class='ad-card__score-container'>
<img class='ad-card__img3' src='images/star.png' alt='star' />
<span class='ad-card__score'>{{authorRating}}</span>
</div>
</div>
</div>
<div class='ad-card' id='card-{{id}}'>
<!-- ID is used for js not styles -->
<img class='ad_card__img1' src='{{images.[0].path}}' alt='Ad card image' />
<div class='ad-card__image-pagination-div'>
<!-- Здесь будут кружочки -->
<!-- <div class="circle-full"></div>-->
<!-- <div class="circle-empty"></div>-->
</div>
<button class='ad-card__button'>
<svg
width='43'
height='43'
viewBox='0 0 43 43'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<g style='mix-blend-mode:multiply' filter='url(#filter0_d_181_2)'>
<circle cx='21.5' cy='17.5' r='17.5' fill='#9D9999' />
</g>
<path
fill-rule='evenodd'
clip-rule='evenodd'
d='M22 13.0001C20.5005 11.2526 17.9948 10.7126 16.116 12.3128C14.2372 13.913 13.9727 16.5884 15.4481 18.481C16.6749 20.0545 20.3873 23.3732 21.6041 24.4474C21.7402 24.5676 21.8082 24.6276 21.8877 24.6512C21.9569 24.6718 22.0327 24.6718 22.1021 24.6512C22.1815 24.6276 22.2495 24.5676 22.3857 24.4474C23.6024 23.3732 27.3148 20.0545 28.5416 18.481C30.017 16.5884 29.7848 13.8961 27.8737 12.3128C25.9626 10.7294 23.4995 11.2526 22 13.0001Z'
stroke='white'
stroke-width='2'
stroke-linecap='round'
stroke-linejoin='round'
/>
<defs>
<filter
id='filter0_d_181_2'
x='0'
y='0'
width='43'
height='43'
filterUnits='userSpaceOnUse'
color-interpolation-filters='sRGB'
>
<feFlood flood-opacity='0' result='BackgroundImageFix' />
<feColorMatrix
in='SourceAlpha'
type='matrix'
values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0'
result='hardAlpha'
/>
<feOffset dy='4' />
<feGaussianBlur stdDeviation='2' />
<feComposite in2='hardAlpha' operator='out' />
<feColorMatrix
type='matrix'
values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'
/>
<feBlend
mode='normal'
in2='BackgroundImageFix'
result='effect1_dropShadow_181_2'
/>
<feBlend
mode='normal'
in='SourceGraphic'
in2='effect1_dropShadow_181_2'
result='shape'
/>
</filter>
</defs>
</svg>
</button>
<div class='ad-card__info'>
<div class='ad-card__location'>
<p class='ad-card__p1'>{{cityName}}</p>
<p class='ad-card__p2'>{{address}}</p>
<a href='{{onMap}}' class='ad-card__href'>Показать на карте</a>
</div>
<div class='ad-card__author-info'>
<img
class='ad-card__img2'
src='{{author.avatar}}'
alt='User avatar'
/>
<p>{{author.name}}</p>
<div class='ad-card__score-container'>
<img class='ad-card__img3' src='/star.png' alt='star' />
<span class='ad-card__score'>{{author.rating}}</span>
</div>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions components/AdCard/AdCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}

render() {
const template = Handlebars.templates['AdCard.hbs'];

Check warning on line 30 in components/AdCard/AdCard.ts

View workflow job for this annotation

GitHub Actions / Run linters

'Handlebars' is not defined

Check warning on line 30 in components/AdCard/AdCard.ts

View workflow job for this annotation

GitHub Actions / Run linters

'Handlebars' is not defined
const templateContainer = document.createElement('div');

templateContainer.innerHTML = template(this.#data);
Expand Down Expand Up @@ -98,7 +98,7 @@
setTimeout(() => {
this.#makeCircleActive(toShowIndex);
this.#currentImgIndex = toShowIndex;
imgElem.src = this.#data.images[toShowIndex];
imgElem.src = this.#data.images[toShowIndex].path;
}, SCROLL_DELAY);
}

Expand All @@ -110,7 +110,7 @@
setTimeout(() => {
this.#makeCircleActive(0);
this.#currentImgIndex = 0;
imgElem.src = this.#data.images[0];
imgElem.src = this.#data.images[0].path;
}, SCROLL_DELAY);
}

Expand Down
2 changes: 1 addition & 1 deletion components/AdListPage/AdListPage.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<h1 class='ad-list-page__title'>Список объявлений</h1>
<button class='ad-list-page__add-button js-add-btn'>Добавить объявление</button>
</div>
<div class='js-advert-list'>
<div class='ad-list-page__adverts-container js-advert-list'>
</div>
</div>
154 changes: 82 additions & 72 deletions components/AdListPage/AdListPage.sass
Original file line number Diff line number Diff line change
@@ -1,73 +1,83 @@
@use '../../mixins'

.ad-list-page
margin-top: 40px
width: 80%
margin: 0 auto

&__title
font-weight: 500

&__upper-container
display: flex
justify-content: space-between
align-items: end
margin: 20px 0
&__add-button
@include mixins.button
background-color: #FF5255


.horizontal-ad-card
border: 1px solid black
border-radius: 10px
display: flex
flex-direction: row
gap: 40px
padding: 15px

&__img
width: 250px
border-radius: 10px

&__info
display: flex
width: 100%
flex-direction: column
justify-content: space-between
position: relative

&__notification-bell
position: absolute
width: 32px
top: 0px
right: 0px
cursor: pointer

&__city
font-size: 32px

&__address
font-size: 20px

&__buttons-container
display: flex
gap: 30px

&__open-btn
@include mixins.button
width: 200px
height: 38px
background-color: #5289FF

&__edit-btn
@include mixins.button
height: 38px

&__del-btn
@include mixins.button
background-color: #FF5900
height: 38px


@use '../../mixins'

.ad-list-page
margin-top: 40px
width: 80%
margin: 0 auto

&__title
font-weight: 500

&__upper-container
display: flex
justify-content: space-between
align-items: end
margin: 20px 0
&__add-button
@include mixins.button
background-color: #FF5255

&__adverts-container
display: flex
flex-direction: column
gap: 10px


.horizontal-ad-card
border: 1px solid black
border-radius: 10px
display: flex
flex-direction: row
gap: 40px
padding: 15px
transition: 0.3s all

&:hover
background-color: #cecece
border: 1px solid #4b4b4b

&__img
width: 250px
border-radius: 10px

&__info
display: flex
width: 100%
flex-direction: column
justify-content: space-between
position: relative

&__notification-bell
position: absolute
width: 32px
top: 0px
right: 0px
cursor: pointer

&__city
font-size: 32px

&__address
font-size: 20px

&__buttons-container
display: flex
gap: 30px

&__open-btn
@include mixins.button
width: 200px
height: 38px
background-color: #5289FF

&__edit-btn
@include mixins.button
height: 38px

&__del-btn
@include mixins.button
background-color: #FF5900
height: 38px



Loading
Loading