Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
175 changes: 143 additions & 32 deletions src/app/profile/user/details/details.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,24 @@
<div class="container">
<div class="profile-header-info__user-card">
<div class="profile-header-info__photo">
<cl-image height="150" crop="scale" public-id="{{ user.profile_pic }}" secure="true"></cl-image>
<cl-image
height="150"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this auto-linting, else it will change multiple time to and fro.

Copy link
Contributor Author

@neozenweb neozenweb Feb 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please help me understand auto-linting? I use visual studio code, so should I disable something on it or do I need to change the code in details.component.html? I have disabled the lint on this workspace on my editor.

crop="scale"
public-id="{{ user.profile_pic }}"
secure="true"
></cl-image>
</div>

<h3 class="profile-header-info__username" [ngStyle]="{ display: !isFieldEditable ? 'block' : 'none' }">
<h3
class="profile-header-info__username"
[ngStyle]="{ display: !isFieldEditable ? 'block' : 'none' }"
>
@{{ user.username }}
</h3>
<mat-form-field [ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }" class="input">
<mat-form-field
[ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }"
class="input"
>
<input
matInput
class="profile-header-info__username"
Expand All @@ -23,14 +34,22 @@ <h3 class="profile-header-info__username" [ngStyle]="{ display: !isFieldEditable
/>
</mat-form-field>
<div class="social-links">
<a href="{{ social.value }}" *ngFor="let social of (user.social_links | keyvalue)" target="_blank">
<a
href="{{ social.value }}"
*ngFor="let social of (user.social_links | keyvalue)"
target="_blank"
>
<img
matTooltip="{{ social.value }}"
class="social-icon"
src="../../../../assets/logos/social/{{ social.key }}-logo.svg"
src="../../../../assets/logos/social/{{
social.key
}}-logo.svg"
/>
</a>
<mat-icon (click)="openSocialDialog()" [ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }"
<mat-icon
(click)="openSocialDialog()"
[ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }"
>add_circle</mat-icon
>
</div>
Expand All @@ -41,14 +60,22 @@ <h3 class="profile-header-info__username" [ngStyle]="{ display: !isFieldEditable
<span class="see-more">
<mat-icon
(click)="toggleFormFields(true)"
[ngStyle]="{ display: !isFieldEditable && isSameUser ? 'inline' : 'none' }"
[ngStyle]="{
display: !isFieldEditable && isSameUser ? 'inline' : 'none'
}"
>
edit
</mat-icon>
<mat-icon (click)="toggleFormFields(false)" [ngStyle]="{ display: isFieldEditable ? 'inline' : 'none' }">
<mat-icon
(click)="toggleFormFields(false)"
[ngStyle]="{ display: isFieldEditable ? 'inline' : 'none' }"
>
cancel
</mat-icon>
<mat-icon (click)="onSubmit()" [ngStyle]="{ display: isFieldEditable ? 'inline' : 'none' }">
<mat-icon
(click)="onSubmit()"
[ngStyle]="{ display: isFieldEditable ? 'inline' : 'none' }"
>
save
</mat-icon>
</span>
Expand All @@ -62,35 +89,66 @@ <h3 class="profile-header-info__username" [ngStyle]="{ display: !isFieldEditable
<div class="side-info">
<div class="info_card">
<div class="info_card--header">Location</div>
<div class="info_card--body" [ngStyle]="{ display: !isFieldEditable ? 'block' : 'none' }">
<div
class="info_card--body"
[ngStyle]="{ display: !isFieldEditable ? 'block' : 'none' }"
>
{{ user.location }}
</div>
<mat-form-field [ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }" class="input ">
<input matInput value="{{ user.location }}" formControlName="location" placeholder="Enter a location" />
<mat-form-field
[ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }"
class="input "
>
<input
matInput
value="{{ user.location }}"
formControlName="location"
placeholder="Enter a location"
/>
</mat-form-field>
<div class="info_card--header">Birthday</div>
<div class="info_card--body" [ngStyle]="{ display: !isFieldEditable ? 'block' : 'none' }">
<div
class="info_card--body"
[ngStyle]="{ display: !isFieldEditable ? 'block' : 'none' }"
>
{{ user.date_of_birth }}
</div>
<mat-form-field [ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }" class="input">
<mat-form-field
[ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }"
class="input"
>
<input
matInput
[matDatepicker]="myDatepicker"
value="{{ user.date_of_birth }}"
formControlName="dob"
placeholder="Select a date"
/>
<mat-datepicker-toggle matSuffix [for]="myDatepicker"></mat-datepicker-toggle>
<mat-datepicker-toggle
matSuffix
[for]="myDatepicker"
></mat-datepicker-toggle>
<mat-datepicker #myDatepicker></mat-datepicker>
</mat-form-field>
</div>
<div class="info_card">
<div class="info_card--header">About me</div>
<div class="info_card--body" [ngStyle]="{ display: !isFieldEditable ? 'block' : 'none' }">
<div
class="info_card--body"
[ngStyle]="{ display: !isFieldEditable ? 'block' : 'none' }"
>
{{ user.bio }}
</div>
<mat-form-field [ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }" class="input">
<input matInput value="{{ user.bio }}" formControlName="bio" placeholder="Enter a bio" />
<mat-form-field
[ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }"
class="input"
>
<input
matInput
value="{{ user.bio }}"
formControlName="bio"
placeholder="Enter a bio"
/>
</mat-form-field>
</div>
<div class="info_card">
Expand All @@ -102,9 +160,16 @@ <h3 class="profile-header-info__username" [ngStyle]="{ display: !isFieldEditable
>
<mat-chip>{{ tech }}</mat-chip>
</mat-chip-list>
<mat-form-field [ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }" class="input">
<mat-form-field
[ngStyle]="{ display: isFieldEditable ? 'block' : 'none' }"
class="input"
>
<mat-chip-list #chipList>
<mat-chip *ngFor="let tech of user.technologies" [removable]="removable" (removed)="remove(tech)">
<mat-chip
*ngFor="let tech of user.technologies"
[removable]="removable"
(removed)="remove(tech)"
>
{{ tech }}
<mat-icon matChipRemove *ngIf="removable">cancel</mat-icon>
</mat-chip>
Expand All @@ -124,29 +189,50 @@ <h3 class="profile-header-info__username" [ngStyle]="{ display: !isFieldEditable
<span *ngIf="userProjects">
<div class="main-info__section-header">
<h2>PROJECTS</h2>
<a class="see-more" *ngIf="userProjects.length === 4" (click)="fetchContributions('projects')"
<a
class="see-more"
*ngIf="userProjects.length === 4"
(click)="fetchContributions('projects')"
>See all projects</a
>
</div>
<div class="main-info__projects">
<div *ngIf="!userProjects?.length > 0; else ProjectCreated">
<div *ngIf="isSameUser; else isDifferentUser">
<p>Nothing to show</p>
<br /><button type="button" routerLink="/add/project" mat-raised-button>Add projects</button>
<br /><button
type="button"
routerLink="/add/project"
mat-raised-button
>
Add projects
</button>
</div>
<ng-template #isDifferentUser> No projects to show </ng-template>
<ng-template #isDifferentUser>
No projects to show
</ng-template>
</div>

<ng-template #ProjectCreated>
<div class="project_card" *ngFor="let project of userProjects">
<div
class="project_card--header"
[routerLink]="['/view/project', project.id + '-' + project.project_name]"
[routerLink]="[
'/view/project',
project.id + '-' + project.project_name
]"
>
{{ project.project_name }} | {{ project.current_stage }}
</div>
<div class="project_card--body">{{ project.description }}</div>
<a class="expand" [routerLink]="['/view/project', project.id + '-' + project.project_name]"
<div class="project_card--body">
{{ project.description }}
</div>
<a
class="expand"
[routerLink]="[
'/view/project',
project.id + '-' + project.project_name
]"
><mat-icon>open_in_new</mat-icon></a
>
</div>
Expand All @@ -157,28 +243,53 @@ <h2>PROJECTS</h2>
<span *ngIf="userIdeas">
<div class="main-info__section-header">
<h2>IDEAS</h2>
<a class="see-more" *ngIf="userIdeas.length === 4" (click)="fetchContributions('ideas')">See all ideas</a>
<a
class="see-more"
*ngIf="userIdeas.length === 4"
(click)="fetchContributions('ideas')"
>See all ideas</a
>
<!--goes to idea/feed with filter of this user's username-->
</div>
<div class="main-info__projects">
<div *ngIf="!userIdeas?.length > 0; else IdeasCreated">
<div *ngIf="isSameUser; else isDifferentUser">
<p>Nothing to show</p>
<br /><button type="button" routerLink="/add/idea" mat-raised-button>Add Ideas</button>
<br /><button
type="button"
routerLink="/add/idea"
mat-raised-button
>
Add Ideas
</button>
</div>
<ng-template #isDifferentUser> No Ideas to show </ng-template>
</div>

<ng-template #IdeasCreated>
<div class="project_card" *ngFor="let idea of userIdeas">
<div class="project_card--header">
<span (click)="openDialog(item)"> {{ idea.idea_name }}</span>
<span (click)="openDialog(item)">
{{ idea.idea_name }}</span
>
<div class="idea-card__header__icon-list">
<a><mat-icon class="expand" (click)="openDialog(idea)">open_in_new</mat-icon></a>
<a><mat-icon class="delete" (click)="deleteIdea(idea.id)">delete</mat-icon></a>
<a
><mat-icon class="expand" (click)="openDialog(idea)"
>open_in_new</mat-icon
></a
>
<a
><mat-icon
class="delete"
(click)="openConfirmDialog(idea)"
>delete</mat-icon
></a
>
</div>
</div>
<div class="idea-card__description">{{ idea.description }}</div>
<div class="idea-card__description">
{{ idea.description }}
</div>
</div>
</ng-template>
</div>
Expand Down
21 changes: 13 additions & 8 deletions src/app/profile/user/details/details.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@

.profile-header {
height: 35vh;
background-image: linear-gradient(135deg, rgb(102, 126, 234) 0%, rgb(118, 75, 162) 100%);
background-image: linear-gradient(
135deg,
rgb(102, 126, 234) 0%,
rgb(118, 75, 162) 100%
);
display: flex;
flex-direction: column;
justify-content: flex-end;
Expand All @@ -42,10 +46,14 @@
justify-content: center;

@media (max-width: 37.5em) {
height:35vh;
background-image: linear-gradient(135deg, rgb(102, 126, 234) 0%, rgb(118, 75, 162) 100%);
height: 35vh;
background-image: linear-gradient(
135deg,
rgb(102, 126, 234) 0%,
rgb(118, 75, 162) 100%
);
background-repeat: no-repeat;
background-size: 100% 65%;
background-size: 100% 65%;
}

.container {
Expand Down Expand Up @@ -99,7 +107,6 @@
@media (max-width: 37.5em) {
margin-bottom: 0;
}

}

&__username {
Expand All @@ -109,18 +116,16 @@
@media (max-width: 37.5em) {
padding-top: 2rem;
}

}

&__name {
font-size: 3rem;
font-weight: 700;
padding-top: .5rem;
padding-top: 0.5rem;

@media (max-width: 37.5em) {
padding-top: 1rem;
}

}
}

Expand Down
Loading