Skip to content

Commit

Permalink
Merge pull request #31 from frontend-park-mail-ru/profile-graph-rating
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-hub000 authored Nov 25, 2024
2 parents 86ff8aa + 46a9f69 commit 3fb57be
Show file tree
Hide file tree
Showing 88 changed files with 6,341 additions and 4,681 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
.idea/
/components/precompiled-templates.js
nginx/ssl/
/images/
/nginx/ssl/
18 changes: 14 additions & 4 deletions components/AdCard/AdCard.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,28 @@
<div class='housing-card__location'>
<p class='housing-card__city'>{{cityName}}</p>
<p class='housing-card__address'>{{address}}</p>
<a href='{{onMap}}' class='housing-card__href'>Показать на карте</a>
<div class='housing-card__view-row'>
<a href='{{onMap}}' class='housing-card__href'>Показать на карте</a>
<span class='housing-card__view'>
<img
src='../../public/svg/eye.svg'
height='15'
width='15'
/>
<p class='housing-card__view__p'>{{viewsCount}}</p>
</span>
</div>
</div>
<div class='housing-card__author-info'>
<img
class='housing-card__avatar'
src='{{author.avatar}}'
src='{{adAuthor.avatar}}'
alt='User avatar'
/>
<p class='housing-card__author-name'>{{author.name}}</p>
<p class='housing-card__author-name'>{{adAuthor.name}}</p>
<div class='housing-card__rating-container'>
<img class='housing-card__star' src='/star.png' alt='star' />
<span class='housing-card__rating'>{{author.rating}}</span>
<span class='housing-card__rating'>{{adAuthor.rating}}</span>
</div>
</div>
</div>
Expand Down
22 changes: 20 additions & 2 deletions components/AdCard/AdCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
min-height: 40px;
height: 110px;
display: flex;
justify-content: space-around;
justify-content: space-evenly;
}

&__like-button {
Expand Down Expand Up @@ -93,7 +93,6 @@

&__address {
font-size: 16px;
font-style: italic;
margin: 0;
}

Expand All @@ -116,8 +115,27 @@
&__href {
color: #808080;
font-size: 14px;
}

&__view-row{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
position: relative;
bottom: -10px;
width: 170px;
}

&__view{
display: flex;
flex-direction: row;
justify-content: space-between;
width: 30px;

&__p{
color: #808080;
}
}

&__circle {
Expand Down
23 changes: 17 additions & 6 deletions components/AdListPage/AdListPage.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
<div class='ad-list-page'>
<div class='ad-list-page__upper-container'>
<h1 class='ad-list-page__title'>Список объявлений</h1>
<button class='ad-list-page__add-button js-add-btn'>Добавить объявление</button>
</div>
<div class='ad-list-page__adverts-container js-advert-list'>
</div>
{{#if isHost}}
<div class='ad-list-page__upper-container'>
<h1 class='ad-list-page__title'>Список объявлений</h1>
<button class='ad-list-page__add-button js-add-btn'>Добавить
объявление</button>
</div>
<div class='ad-list-page__adverts-container js-advert-list'>
{{#if empty}}
<p class='ad-list-page__no-adverts-text'>Здесь пока пусто... 🕳️</p>
{{/if}}
</div>
{{else}}
<p class='ad-list-page__not-host-message'>🚫Вы не являетесь хостом,
поэтому не можете создавать объявления.</p>
<p class='ad-list-page__not-host-message'>Если вы хотите стать хостом,
пожалуйста, измените свой статус в настройках</p>
{{/if}}
</div>
10 changes: 10 additions & 0 deletions components/AdListPage/AdListPage.sass
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
flex-direction: column
gap: 10px

&__no-adverts-text
margin-top: 50px
text-align: center
font-size: 26px

&__not-host-message
margin-top: 90px
font-size: 40px
text-align: center


.horizontal-ad-card
border: 1px solid black
Expand Down
12 changes: 10 additions & 2 deletions components/AdListPage/AdListPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ import HorizontalAdCard from '../HorizontalAdCard/HorizontalAdCard';

import { HorizontalAdCardData } from '../HorizontalAdCard/HorizontalAdCard';

function AdListPage(data: HorizontalAdCardData[]) {
function AdListPage(data: HorizontalAdCardData[], isHost: boolean) {
const pageContainer = document.createElement('div');

const template = Handlebars.templates['AdListPage.hbs'];

Check warning on line 12 in components/AdListPage/AdListPage.ts

View workflow job for this annotation

GitHub Actions / Run linters

'Handlebars' is not defined

pageContainer.innerHTML = template(data);
pageContainer.innerHTML = template({
...data,
empty: data.length === 0,
isHost: isHost,
});
if (!isHost) {
return pageContainer;
}

const advertListElement = pageContainer.querySelector('.js-advert-list');
const createAdvertElement = pageContainer.querySelector(
'.js-add-btn'
Expand Down
128 changes: 104 additions & 24 deletions components/AdPage/AdPage.hbs
Original file line number Diff line number Diff line change
@@ -1,26 +1,102 @@
<div class='ad-page' id='{{elementId}}'>
<main>
<div class='advert-images-carousel'>
<div class='advert-images-carousel__main-img-div js-main-img-div'>
<img
class='advert-images-carousel__img-background'
src='{{currentImagePath}}'
/>
<img
class='advert-images-carousel__main-img'
src='{{currentImagePath}}'
/>
</div>
<div class='advert-images-carousel__secondary_images'>
<div class='ad-page__gallery'>
<ul class='ad-page__gallery__carousel js-main-img-div'>
<div class='ad-page__gallery__carousel__buttons-container'>
<button
class='ad-page__gallery__carousel__prev-image-button js-prev-image-button js-carousel-overlay-button'
><svg
aria-hidden='true'
width='16'
height='16'
viewBox='0 0 16 16'
fill='none'
xmlns='http://www.w3.org/2000/svg'
><path
fill-rule='evenodd'
clip-rule='evenodd'
d='M3 8.003 10.707.296l1.414 1.414-6.293 6.293 6.293 6.293-1.414 1.414L3 8.003Z'
fill='currentColor'
></path></svg>
</button>
<button
class='ad-page__gallery__carousel__next-image-button js-next-image-button js-carousel-overlay-button'
>
<svg
class='a10a3f92e9--container--izJBY a10a3f92e9--display_block--ERcB0 a10a3f92e9--color_white_100--B2e13'
aria-hidden='true'
width='16'
height='16'
viewBox='0 0 16 16'
fill='none'
xmlns='http://www.w3.org/2000/svg'
><path
fill-rule='evenodd'
clip-rule='evenodd'
d='M13.414 8 5.707.293 4.293 1.707 10.586 8l-6.293 6.293 1.414 1.414L13.414 8Z'
fill='currentColor'
></path></svg>
</button>
</div>

{{#each images}}
<li class='ad-page__gallery__carousel__img-container'>
<img
class='ad-page__gallery__carousel__img-background'
src='{{this.path}}'
/>
<img
class='ad-page__gallery__carousel__img'
src='{{this.path}}'
/>
</li>
{{/each}}
</ul>
<div class='ad-page__gallery__carousel__secondary-images'>
{{#each images}}
<img
class='advert-images-carousel__secondary_img js-carousel-img'
class='ad-page__gallery__secondary-img js-carousel-img'
src='{{this.path}}'
/>
{{/each}}
</div>
</div>

<div class='advert-apps'>
<div class='advert-apps__element'>
<div class='advert-apps__photo-container'>
<img src='/svg/eye-greybg.svg' width='40' height='40' />
</div>
<div class='advert-apps__info'>
<p class='advert-apps__info__p1'>Просмотрено</p>
<p class='advert-apps__info__p2'>{{viewsCount}} раз</p>
</div>
</div>
<div class='advert-apps__element'>
<div class='advert-apps__photo-container'>
<img src='/svg/favorites-grey.svg' width='40' height='40' />
</div>
<div class='advert-apps__info'>
<p class='advert-apps__info__p1'>Понравилось</p>
<p class='advert-apps__info__p2'>5 раз</p>
</div>
</div>
<div class='advert-apps__element'>
<div class='advert-apps__photo-container'>
<img
src='/svg/person-walking.svg'
alt='Количество просмотров объявления'
width='40'
height='40'
/>
</div>
<div class='advert-apps__info'>
<p class='advert-apps__info__p1'>Посещено</p>
<p class='advert-apps__info__p2'>3 раз</p>
</div>
</div>
</div>

<div class='advert-desc'>
<div class='advert-desc__text-data'>
<span class='advert-desc__label'>Город:</span>
Expand All @@ -45,17 +121,22 @@
</div>

<aside class='ad-page-profile-container'>
<div class='ad-page-profile-container__center'>
<a
href='/profiles?id={{authorUUID}}'
class='ad-page-profile-container__center'
>
<div class='ad-page-profile-container__photo'>
<img
src='{{author.avatar}}'
src='{{adAuthor.avatar}}'
class='ad-page-profile-container__photo__img1'
/>
</div>
<p class='ad-page-profile-container__p1'>{{author.name}}</p>
<p class='ad-page-profile-container__p2'>{{author.locationMain}}</p>
<p class='ad-page-profile-container__p1'>{{adAuthor.name}}</p>
<p
class='ad-page-profile-container__p2'
>{{adAuthor.locationMain}}</p>
<hr class='ad-page-profile-container__hr' />
</div>
</a>

<div class='ad-page-profile-container__div'>
<div class='ad-page-profile-container__p'>Рейтинг:</div>
Expand All @@ -68,22 +149,21 @@
/>
<span
class='ad-page-profile-container__score'
>{{author.rating}}</span>
>{{adAuthor.rating}}</span>
</span>
</div>
</div>
<div class='ad-page-profile-container__div'>
<div
class='ad-page-profile-container__p'
>Пол:{{author.rating}}</div>
<p class='ad-page-profile-container__info'>{{author.sex}}</p>
<div class='ad-page-profile-container__p'>Пол:</div>
<p class='ad-page-profile-container__info'>{{sex}}</p>
</div>
<div class='ad-page-profile-container__div'>
<div class='ad-page-profile-container__p'>Возраст:</div>
<p class='ad-page-profile-container__info'>{{age}}</p>
</div>

<button class='ad-page-profile-container__write-msg-button'>Напишите Leo
<button class='ad-page-profile-container__write-msg-button'>Напишите
{{adAuthor.name}}
прямо сейчас
</button>

Expand Down
Loading

0 comments on commit 3fb57be

Please sign in to comment.