Skip to content

Commit 9ed176d

Browse files
committed
2 parents ca654c5 + c8614fd commit 9ed176d

35 files changed

Lines changed: 233 additions & 210 deletions

projects/social_platform/src/app/auth/set-password/set-password.component.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@
33
margin-bottom: 24px;
44
}
55
}
6+
7+
.error {
8+
color: var(--red) !important;
9+
10+
i {
11+
color: var(--red) !important;
12+
}
13+
}

projects/social_platform/src/app/office/features/detail/detail.component.html

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,38 +63,23 @@
6363
<ng-template #programTpl>
6464
@if (userType() !== undefined) { @if (!isUserMember && !isUserManager) { @if
6565
(info().name.includes("Кейс-чемпионат MIR")) {
66-
<a href="https://case-champ.ru/corporate#rec1176757836">
67-
<app-button
68-
[disabled]="!!registerDateExpired"
69-
[style.opacity]="registerDateExpired ? '0.5' : '1'"
70-
appearance="outline"
71-
size="medium"
72-
customTypographyClass="text-body-12"
73-
>
66+
<a
67+
(click)="checkPrograRegistrationEnded($event)"
68+
href="https://case-champ.ru/corporate#rec1176757836"
69+
>
70+
<app-button appearance="outline" size="medium" customTypographyClass="text-body-12">
7471
зарегистрироваться
7572
</app-button>
7673
</a>
7774
} @else if (info().registrationLink) {
78-
<a [href]="info().registrationLink">
79-
<app-button
80-
[disabled]="!!registerDateExpired"
81-
[style.opacity]="registerDateExpired ? '0.5' : '1'"
82-
appearance="outline"
83-
size="medium"
84-
customTypographyClass="text-body-12"
85-
>
75+
<a (click)="checkPrograRegistrationEnded($event)" [href]="info().registrationLink">
76+
<app-button appearance="outline" size="medium" customTypographyClass="text-body-12">
8677
зарегистрироваться
8778
</app-button>
8879
</a>
8980
} @else {
90-
<a [routerLink]="['/office/program', info().id, 'register']">
91-
<app-button
92-
[disabled]="!!registerDateExpired"
93-
[style.opacity]="registerDateExpired ? '0.5' : '1'"
94-
appearance="outline"
95-
size="medium"
96-
customTypographyClass="text-body-12"
97-
>
81+
<a (click)="checkPrograRegistrationEnded($event)">
82+
<app-button appearance="outline" size="medium" customTypographyClass="text-body-12">
9883
зарегистрироваться
9984
</app-button>
10085
</a>
@@ -310,6 +295,19 @@
310295
</app-button>
311296
</div>
312297
</app-modal>
298+
299+
<app-modal
300+
[open]="isProgramEndedModalOpen()"
301+
(openChange)="isProgramEndedModalOpen.set(!isProgramEndedModalOpen())"
302+
>
303+
<div class="cancel" style="padding: 24px">
304+
<div class="cancel__top">
305+
<p class="cancel__title text-body-14">к сожалению, программа уже завершена!</p>
306+
</div>
307+
308+
<i appIcon icon="sad-smile" appSquare="50" style="margin-top: 36px"></i>
309+
</div>
310+
</app-modal>
313311
</ng-template>
314312

315313
<ng-template #projectTpl>

projects/social_platform/src/app/office/features/detail/detail.component.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export class DeatilComponent implements OnInit, OnDestroy {
103103
// Переменные для работы с модалками
104104
isAssignProjectToProgramModalOpen = signal(false);
105105
showSubmitProjectModal = signal(false);
106+
isProgramEndedModalOpen = signal(false);
106107
isLeaveProjectModalOpen = false; // Флаг модального окна выхода
107108
isEditDisable = false; // Флаг недоступности редактирования
108109
isEditDisableModal = false; // Флаг недоступности редактирования для модалки
@@ -156,7 +157,9 @@ export class DeatilComponent implements OnInit, OnDestroy {
156157
}
157158

158159
get isProjectAssigned() {
159-
return !!this.memberProjects.find(project => project.leader === this.profile?.id);
160+
return !!this.memberProjects.find(
161+
project => project.leader === this.profile?.id && project.partnerProgram
162+
);
160163
}
161164

162165
// Методы для управления состоянием ошибок через сервис
@@ -369,6 +372,24 @@ export class DeatilComponent implements OnInit, OnDestroy {
369372
}
370373
}
371374

375+
/**
376+
* Проверка завершения программы перед регистрацией
377+
*/
378+
checkPrograRegistrationEnded(event: Event): void {
379+
const program = this.info();
380+
381+
if (
382+
program?.datetimeRegistrationEnds &&
383+
Date.now() > Date.parse(program.datetimeRegistrationEnds)
384+
) {
385+
event.preventDefault();
386+
event.stopPropagation();
387+
this.isProgramEndedModalOpen.set(true);
388+
} else {
389+
this.router.navigateByUrl("/office/program/" + this.info().id + "/register");
390+
}
391+
}
392+
372393
/**
373394
* Обновляет состояния страниц на основе URL
374395
*/

projects/social_platform/src/app/office/features/info-card/info-card.component.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,16 @@
169169
}
170170
</p>
171171
</div>
172-
} }
172+
} } @else {
173+
<app-button
174+
[routerLink]="'/office/projects/' + info?.id"
175+
customTypographyClass="text-body-6"
176+
size="extra-small"
177+
class="card__info--text"
178+
>
179+
проект
180+
</app-button>
181+
}
173182
</div>
174183
} @else if (type === 'members') { @if (leaderId === loggedUserId && loggedUserId !==
175184
info?.userId) {

projects/social_platform/src/app/office/features/news-card/news-card.component.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
[src]="feedItem.imageAddress || placeholderUrl"
88
[alt]="feedItem.name"
99
/>
10-
<p class="card__name text-body-10">{{ feedItem.name }}</p>
10+
<p class="card__name text-body-10">
11+
{{ feedItem.name.length > 30 ? feedItem.name.slice(0, 26) + "..." : feedItem.name }}
12+
</p>
1113
</a>
1214
@if (isOwner) {
1315
<div class="card__menu" (clickOutside)="onCloseMenu()">
@@ -28,7 +30,7 @@
2830
@if (feedItem.text) {
2931
<div class="card__text text-body-10">
3032
@if (!editMode) {
31-
<p class="text-body-10" #newsTextEl [innerHTML]="feedItem.text | parseLinks"></p>
33+
<p class="text-body-10" #newsTextEl [innerHTML]="feedItem.text | parseLinks | parseBreaks"></p>
3234
} @else { @if (editForm.get("text"); as text) {
3335
<app-textarea size="big" [formControl]="text | formControl"></app-textarea>
3436
} }

projects/social_platform/src/app/office/features/news-card/news-card.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ import { FeedNews } from "@office/projects/models/project-news.model";
1414
import { SnackbarService } from "@ui/services/snackbar.service";
1515
import { ActivatedRoute, RouterLink } from "@angular/router";
1616
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from "@angular/forms";
17-
import { DayjsPipe, FormControlPipe, ParseLinksPipe, ValidationService } from "projects/core";
17+
import {
18+
DayjsPipe,
19+
FormControlPipe,
20+
ParseBreaksPipe,
21+
ParseLinksPipe,
22+
ValidationService,
23+
} from "projects/core";
1824
import { FileService } from "@core/services/file.service";
1925
import { nanoid } from "nanoid";
2026
import { expandElement } from "@utils/expand-element";
@@ -50,6 +56,7 @@ import { ImgCardComponent } from "@office/shared/img-card/img-card.component";
5056
DayjsPipe,
5157
FormControlPipe,
5258
ParseLinksPipe,
59+
ParseBreaksPipe,
5360
CarouselComponent,
5461
ImgCardComponent,
5562
],

projects/social_platform/src/app/office/feed/feed.component.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
<div class="page">
44
<app-feed-filter class="page__filter"></app-feed-filter>
5-
<div #feedRoot class="page__feed">
6-
@for (item of feedItems(); track item.content.id) { @if (item.typeModel === "vacancy") {
5+
<div #feedRoot class="page__feed" [style.column-count]="feedItems().length > 0 ? '2' : '1'">
6+
@if (feedItems().length > 0) { @for (item of feedItems(); track item.content.id) { @if
7+
(item.typeModel === "vacancy") {
78
<app-open-vacancy
89
class="page__item"
910
[attr.data-id]="item.content.id"
@@ -35,6 +36,11 @@
3536
[resourceLink]="['/office/projects', item.content.contentObject.id]"
3637
(like)="onLike($event)"
3738
></app-news-card>
38-
} } }
39+
} } } } @else {
40+
<div class="page__feed--no-items">
41+
<i appIcon icon="empty-chat" appSquare="38"></i>
42+
<p class="text-body-12">в данном разделе пока нет новостей</p>
43+
</div>
44+
}
3945
</div>
4046
</div>

projects/social_platform/src/app/office/feed/feed.component.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
&__feed {
1010
column-count: 2;
1111
column-gap: 20px;
12+
13+
&--no-items {
14+
display: flex;
15+
flex-direction: column;
16+
gap: 20px;
17+
align-items: center;
18+
justify-content: center;
19+
margin-top: 70px;
20+
21+
i,
22+
p {
23+
color: var(--grey-for-text);
24+
}
25+
}
1226
}
1327

1428
&__item {

projects/social_platform/src/app/office/feed/feed.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@ import { ProfileNewsService } from "@office/profile/detail/services/profile-news
2323
import { FeedFilterComponent } from "@office/feed/filter/feed-filter.component";
2424
import { NewsCardComponent } from "@office/features/news-card/news-card.component";
2525
import { OpenVacancyComponent } from "./shared/open-vacancy/open-vacancy.component";
26+
import { IconComponent } from "@ui/components";
2627

2728
@Component({
2829
selector: "app-feed",
2930
standalone: true,
3031
imports: [
3132
CommonModule,
33+
IconComponent,
3234
NewProjectComponent,
3335
FeedFilterComponent,
3436
NewsCardComponent,
3537
OpenVacancyComponent,
38+
IconComponent,
3639
],
3740
changeDetection: ChangeDetectionStrategy.OnPush,
3841
templateUrl: "./feed.component.html",

projects/social_platform/src/app/office/feed/shared/new-project/new-project.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
<div class="card__info">
1313
<div class="card__info--main">
14-
<p class="text-body-12">{{ feedItem.name }}</p>
14+
<p class="text-body-12">
15+
{{ feedItem.name.length > 30 ? feedItem.name.slice(0, 26) + "..." : feedItem.name }}
16+
</p>
1517
<!-- <p class="text-body-10">{{ feedItem.datetimeCreated | dayjs: "format":"DD MM YY" }}</p> -->
1618
</div>
1719

0 commit comments

Comments
 (0)