Merge branch 'master' of github.com:telerik/team-spirit
This commit is contained in:
Коммит
0b46634275
|
@ -55,6 +55,7 @@
|
|||
.vote,
|
||||
.info-label,
|
||||
.votes-count,
|
||||
.user-display-wrp,
|
||||
.user-display,
|
||||
.registered-users-wrapper .info-icon {
|
||||
vertical-align: middle;
|
||||
|
|
|
@ -75,11 +75,13 @@
|
|||
|
||||
<StackLayout class="info-wrapper no-separator">
|
||||
<Label class="info-label" text="Registered Participants"></Label>
|
||||
<StackLayout *ngIf="registeredUsers.length > 0" (tap)="onParticipantsTap()" class="registered-users-wrapper" orientation="horizontal">
|
||||
<user-display [users]="registeredUsers" [withImages]="3" class="user-display"></user-display>
|
||||
<Label class="info-value going-label" [text]="(registeredUsers.length === 1 ? 'is' : 'are') + ' going'"></Label>
|
||||
<Label class="info-icon if" text="d"></Label>
|
||||
</StackLayout>
|
||||
<GridLayout columns="auto, *" *ngIf="registeredUsers.length > 0" (tap)="onParticipantsTap()" class="registered-users-wrapper">
|
||||
<StackLayout orientation="horizontal" col="0" class="user-display-wrp">
|
||||
<user-display [users]="registeredUsers" [withImages]="3" class="user-display"></user-display>
|
||||
<Label class="info-value going-label" [text]="(registeredUsers.length === 1 ? 'is' : 'are') + ' going'"></Label>
|
||||
</StackLayout>
|
||||
<Label class="info-icon if" text="d" col="1"></Label>
|
||||
</GridLayout>
|
||||
|
||||
<Label class="info-value" *ngIf="registeredUsers.length === 0" [text]="'No one has registered for this event.'"></Label>
|
||||
</StackLayout>
|
||||
|
|
|
@ -3,7 +3,7 @@ import { RouterExtensions } from 'nativescript-angular/router';
|
|||
import { Page } from 'ui/page';
|
||||
|
||||
import { EventsService, UsersService, GroupsService, AlertService } from '../../services';
|
||||
import { Event } from '../../shared/models';
|
||||
import { Event, Group } from '../../shared/models';
|
||||
import { utilities } from '../../shared';
|
||||
|
||||
@Component({
|
||||
|
@ -14,6 +14,7 @@ import { utilities } from '../../shared';
|
|||
export class EventsComponent implements OnInit {
|
||||
upcomingEvents: Event[];
|
||||
pastEvents: Event[];
|
||||
userGroups: Group[] = [];
|
||||
initialized: boolean = false;
|
||||
dateFormat: string = utilities.dateFormat;
|
||||
canAdd: boolean = false;
|
||||
|
@ -49,6 +50,7 @@ export class EventsComponent implements OnInit {
|
|||
if (!userGroups.length) {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
this.userGroups = userGroups;
|
||||
let userGroupIds = userGroups.map(g => g.Id);
|
||||
let prm1 = this._eventsService.getPast(userGroupIds);
|
||||
let prm2 = this._eventsService.getUpcoming(userGroupIds);
|
||||
|
@ -63,6 +65,10 @@ export class EventsComponent implements OnInit {
|
|||
.catch(err => this._alertsService.showError(err.message));
|
||||
}
|
||||
|
||||
canAddEvent() {
|
||||
return this.initialized && this.canAdd && this.userGroups.length;
|
||||
}
|
||||
|
||||
showDetails(event: Event) {
|
||||
this._routerExtensions.navigate([`/events/${event.Id}`]);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<ScrollView class="cntnr">
|
||||
<ActionBarExtension>
|
||||
<ActionItem (tap)="onAdd()" *ngIf="canAdd" ios.position="right">
|
||||
<ActionItem (tap)="onAdd()" *ngIf="canAddEvent()" ios.position="right">
|
||||
<StackLayout>
|
||||
<Label class="button if" text="a"></Label>
|
||||
</StackLayout>
|
||||
|
|
|
@ -56,12 +56,11 @@
|
|||
font-size: 32;
|
||||
}
|
||||
|
||||
.expandable .user-image,
|
||||
.expandable Label,
|
||||
.members-wrapper .info-label,
|
||||
.members-wrapper .user-display,
|
||||
.members-wrapper .info-value,
|
||||
.members-wrapper .info-icon {
|
||||
.members-wrapper .info-icon,
|
||||
.members-wrapper .user-display-wrp {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
@ -72,11 +71,6 @@
|
|||
color: #bfbfbf;
|
||||
}
|
||||
|
||||
.expandable Label {
|
||||
font-size: 12;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.application-sent-msg {
|
||||
color: grey;
|
||||
}
|
||||
|
|
|
@ -48,11 +48,13 @@
|
|||
|
||||
<StackLayout class="info-wrapper members-wrapper" (tap)="onMembersTap()">
|
||||
<Label class="info-label" text="Members"></Label>
|
||||
<StackLayout orientation="horizontal">
|
||||
<user-display *ngIf="members.length" [users]="members" [withImages]="5" class="user-display"></user-display>
|
||||
<Label *ngIf="members.length" class="info-icon if" text="d"></Label>
|
||||
<Label *ngIf="!members.length" text="Group has no members, yet." class="info-value"></Label>
|
||||
</StackLayout>
|
||||
<GridLayout columns="*, auto" *ngIf="members.length">
|
||||
<StackLayout col="0" class="user-display-wrp">
|
||||
<user-display [users]="members" [withImages]="5" class="user-display"></user-display>
|
||||
</StackLayout>
|
||||
<Label class="info-icon if" text="d" col="1"></Label>
|
||||
</GridLayout>
|
||||
<Label *ngIf="!members.length" text="Group has no members, yet." class="info-value"></Label>
|
||||
</StackLayout>
|
||||
|
||||
<StackLayout class="info-wrapper no-separator">
|
||||
|
|
|
@ -38,5 +38,4 @@
|
|||
.app-modal-text {
|
||||
color: #000;
|
||||
text-align: center;
|
||||
font-size: 14;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
TextField {
|
||||
margin-top: 30;
|
||||
}
|
Загрузка…
Ссылка в новой задаче