Skip to content

Commit

Permalink
Merge pull request #817 from HiP-App/iss-hipcms-1048
Browse files Browse the repository at this point in the history
Iss hipcms 1048
  • Loading branch information
rajatkhanna1994 authored Aug 25, 2018
2 parents dedd4f8 + 4a56a01 commit b45e534
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ <h1 md-dialog-title> {{ 'create new achievement' | translate }} </h1>
</md-input-container>
<br>
<md-input-container flex="30">
<input mdInput placeholder="{{ 'points' | translate }}" type="number" min=1 oninput="validity.valid||(value='');" [(ngModel)]="achievement.points" name="points" required>
<input mdInput placeholder="{{ 'points' | translate }}" type="number" min=1 oninput="validity.valid||(value='');" [(ngModel)]="achievement.points"
name="points" required>
</md-input-container>
<br>
<md-select placeholder="{{ 'status' | translate }}" [(ngModel)]="achievement.status" name="status">
<md-option *ngFor="let statusOption of statusOptions" [value]="statusOption">{{ statusOption | translate }}</md-option>
</md-select>
</div>
<div *ngIf="this.selectedType === 'RouteFinished'">
<md-input-container class="grow-width">
Expand All @@ -37,16 +41,22 @@ <h1 md-dialog-title> {{ 'create new achievement' | translate }} </h1>
</md-input-container>
<br>
<md-input-container flex="30">
<input mdInput placeholder="{{ 'points' | translate }}" type="number" min=1 oninput="validity.valid||(value='');" [(ngModel)]="achievement.points" name="points" required>
<input mdInput placeholder="{{ 'points' | translate }}" type="number" min=1 oninput="validity.valid||(value='');" [(ngModel)]="achievement.points"
name="points" required>
</md-input-container>
<br>
<md-select placeholder="{{ 'Choose Route' | translate }}" [(ngModel)]="achievement.routeId" (change)="setRoute($event)"
name="routeType" required>
<md-option *ngFor="let route of routeTypes" [value]="route" >
<md-select placeholder="{{ 'status' | translate }}" [(ngModel)]="achievement.status" name="status">
<md-option *ngFor="let statusOption of statusOptions" [value]="statusOption">{{ statusOption | translate }}</md-option>
</md-select>
<br>
<md-select placeholder="{{ 'Choose Route' | translate }}" [(ngModel)]="achievement.routeId" (change)="setRoute($event)" name="routeType"
required>
<md-option *ngFor="let route of routeTypes" [value]="route">
{{ route.title | translate }}
</md-option>
</md-select>
</div>

<br>
<input type="file" [accept]="acceptedTypes" (change)="chooseFile($event)">
<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { RouteService } from '../../routes/shared/routes.service';
import { ExhibitService } from '../../exhibits/shared/exhibit.service';
import { Exhibit } from '../../exhibits/shared/exhibit.model';
import { Route } from '../../routes/shared/route.model';
import { Status } from '../../shared/status.model';


@Component({
Expand All @@ -27,6 +28,7 @@ import { Route } from '../../routes/shared/route.model';
export class CreateAchievementsDialogComponent implements OnInit {
achievements: Achievement[] = [];
selectedType: any = null;
statusOptions = Status.getValues();
selectedExhibit: any = null;
achievement: any;
title: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
margin-top: 1em;
}

#details-form md-select {
#edit-achievement-form md-select {
position: relative;
top: -1px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ <h1>{{ 'Edit achievement' | translate }}: {{ achievement.title }}</h1>
<md-input-container flex="30">
<input mdInput placeholder="{{ 'points' | translate }}" [(ngModel)]="achievement.points" name="points">
</md-input-container>
<md-select placeholder="{{ 'status' | translate }}" [(ngModel)]="achievement.status" name="status" class="align-right">
<md-option *ngFor="let statusOption of statusOptions" [value]="statusOption">{{ statusOption | translate }}</md-option>
</md-select>
<div *ngIf="this.achievement.type === 'ExhibitsVisited'">
<md-input-container flex="30">
<input mdInput placeholder="{{ 'Count' | translate }}" [(ngModel)]="achievement.count" name="count">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Medium } from '../../media/shared/medium.model';
import { AchievementService } from '../shared/achievement.service';
import { RouteService } from '../../routes/shared/routes.service';
import { Route } from '../../routes/shared/route.model';

import { Status } from '../../shared/status.model';


@Component({
Expand All @@ -29,6 +29,7 @@ export class EditAchievementsComponent implements OnInit {
id: number;
achievement: any;
title: string;
statusOptions = Status.getValues();
description: string;
previewURL: SafeUrl;
file: File;
Expand Down
18 changes: 9 additions & 9 deletions app/mobile-content/mobile-content.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ const mobileContentRoutes: Routes = [
{
path: 'exhibits/deleted',
component: ExhibitsComponent,
canActivate: [AuthGuard, SupervisorGuard]
canActivate: [AuthGuard]
},
{
path: 'exhibits/edit/:id',
component: EditExhibitComponent,
canActivate: [AuthGuard, SupervisorGuard]
canActivate: [AuthGuard]
},
{
path: 'exhibits/my-exhibits',
Expand All @@ -55,12 +55,12 @@ const mobileContentRoutes: Routes = [
{
path: 'achievements/view/:id',
component: ViewAchievementComponent,
canActivate: [AuthGuard, SupervisorGuard]
canActivate: [AuthGuard]
},
{
path: 'exhibits/view/:id',
component: ViewExhibitComponent,
canActivate: [AuthGuard, SupervisorGuard]
canActivate: [AuthGuard]
},
{
path: 'media',
Expand All @@ -70,7 +70,7 @@ const mobileContentRoutes: Routes = [
{
path: 'media/deleted',
component: MediaComponent,
canActivate: [AuthGuard, SupervisorGuard]
canActivate: [AuthGuard]
},
{
path: 'pages',
Expand All @@ -85,7 +85,7 @@ const mobileContentRoutes: Routes = [
{
path: 'pages/edit/:id',
component: EditPageComponent,
canActivate: [AuthGuard, SupervisorGuard]
canActivate: [AuthGuard]
},
{
path: 'pages/view/:id',
Expand All @@ -100,18 +100,18 @@ const mobileContentRoutes: Routes = [
{
path: 'routes/edit/:id',
component: EditRouteComponent,
canActivate: [AuthGuard, SupervisorGuard]
canActivate: [AuthGuard]
},
{
path: 'routes/deleted',
component: RoutesComponent,
canActivate: [AuthGuard, SupervisorGuard]
canActivate: [AuthGuard]

},
{
path: 'routes/view/:id',
component: ViewRouteComponent,
canActivate: [AuthGuard, SupervisorGuard]
canActivate: [AuthGuard]
},
{
path: 'routes/my-routes',
Expand Down

0 comments on commit b45e534

Please sign in to comment.