Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bb81b005
authored
Mar 31, 2018
by
Emil Holsti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eventList update
1 parent
1393c4a8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
20 deletions
code/moya-management-portal/src/app/app.component.html
code/moya-management-portal/src/app/app.component.ts
code/moya-management-portal/src/app/organization/event-list/event-list.component.html
code/moya-management-portal/src/app/organization/event-list/event-list.component.ts
code/moya-management-portal/src/app/organization/event-list/event-service.service.spec.ts
code/moya-management-portal/src/app/organization/event-list/event-service.service.ts
code/moya-management-portal/src/app/organization/organization.module.ts
code/moya-management-portal/src/app/app.component.html
View file @
bb81b00
<!--The content below is only a placeholder and can be replaced.-->
<!--The content below is only a placeholder and can be replaced.-->
<div
style=
"text-align:center"
>
<div>
<h1>
<moya-organization-list
style=
"float:top, left;"
></moya-organization-list>
<h1
style=
"text-align:center; margin-left:25%; display:inline-block"
>
Welcome to {{ title }}!
Welcome to {{ title }}!
</h1>
</h1>
<
img
width=
"300"
alt=
"Angular Logo"
src=
"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="
>
<
a
style=
"float:right; font-size:20px; margin-top: 20px"
href=
"#"
>
Moya Login
</a
>
</div>
</div>
<moya-event-list></moya-event-list>
<div
style=
"width:50%; float:left"
>
\ No newline at end of file
<h2
style=
"margin-left: 10px"
>
Tulevat tapahtumat
</h2>
<moya-event-list
[
organisation
]="
currentOrganisation
"
style=
"margin-top:5em;"
></moya-event-list>
</div>
<div
style=
"width:50%; float:right"
>
<h2>
Ei omaa organisaatiota?
</h2>
<button
(
click
)="
newOrg
()"
>
Luo uusi organisaatio
</button>
</div>
\ No newline at end of file
code/moya-management-portal/src/app/app.component.ts
View file @
bb81b00
...
@@ -8,7 +8,7 @@ import { AppService } from './shared/app.service';
...
@@ -8,7 +8,7 @@ import { AppService } from './shared/app.service';
})
})
export
class
AppComponent
{
export
class
AppComponent
{
title
=
'Moay'
;
title
=
'Moay'
;
public
currentOrganisation
=
'insomnia'
;
constructor
(
private
appService
:
AppService
)
{
constructor
(
private
appService
:
AppService
)
{
console
.
log
(
this
.
appService
.
get
());
console
.
log
(
this
.
appService
.
get
());
}
}
...
...
code/moya-management-portal/src/app/organization/event-list/event-list.component.html
View file @
bb81b00
<mat-card
*
ngFor=
"let event of events"
style=
"
width:40%;margin:1em;
"
>
<mat-card
*
ngFor=
"let event of events"
style=
"
margin:1em;max-width:75%
"
>
<mat-card-title>
{{event.title}}
</mat-card-title>
<mat-card-title>
{{event.title}}
</mat-card-title>
<mat-card-subtitle>
{{event.date}}
</mat-card-subtitle>
<mat-card-subtitle>
{{event.date}}
</mat-card-subtitle>
<mat-card-actions>
<
!--<
mat-card-actions>
<button
mat-raised-button
color=
"primary"
(
click
)="
onClick
()"
style=
"float:right;margin-top:
-5em
;margin-right:1em;"
>
Edit
</button>
<button mat-raised-button color="primary" (click)="onClick()" style="float:right;margin-top:
;margin-right:1em;">Edit</button>
</mat-card-actions>
</mat-card-actions>
-->
</mat-card>
</mat-card>
\ No newline at end of file
code/moya-management-portal/src/app/organization/event-list/event-list.component.ts
View file @
bb81b00
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
Input
}
from
'@angular/core'
;
import
{
EventsService
}
from
'./event-service.service'
;
@
Component
({
@
Component
({
selector
:
'moya-event-list'
,
selector
:
'moya-event-list'
,
...
@@ -6,15 +7,12 @@ import { Component, OnInit } from '@angular/core';
...
@@ -6,15 +7,12 @@ import { Component, OnInit } from '@angular/core';
styleUrls
:
[
'./event-list.component.scss'
]
styleUrls
:
[
'./event-list.component.scss'
]
})
})
export
class
EventListComponent
implements
OnInit
{
export
class
EventListComponent
implements
OnInit
{
@
Input
()
organisation
:
string
;
public
events
:
any
;
public
events
=
[
constructor
(
private
appService
:
EventsService
)
{
{
title
:
'Assembly Winter 18'
,
date
:
'1.2.2018 - 3.2.2018'
},
this
.
events
=
(
this
.
appService
.
get
(
this
.
organisation
));
{
title
:
'Assembly Summer 18'
,
date
:
'1.2.2018 - 3.2.2018'
},
}
{
title
:
'Assembly Winter 19'
,
date
:
'1.2.2018 - 3.2.2018'
},
{
title
:
'Assembly Summer 19'
,
date
:
'1.2.2018 - 3.2.2018'
}
];
constructor
()
{
}
onClick
()
{
onClick
()
{
console
.
log
(
'Nappitoimii'
);
console
.
log
(
'Nappitoimii'
);
...
...
code/moya-management-portal/src/app/organization/event-list/event-service.service.spec.ts
0 → 100644
View file @
bb81b00
import
{
TestBed
,
inject
}
from
'@angular/core/testing'
;
import
{
EventsService
}
from
'./event-service.service'
;
describe
(
'EventsService'
,
()
=>
{
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({
providers
:
[
EventsService
]
});
});
it
(
'should be created'
,
inject
([
EventsService
],
(
service
:
EventsService
)
=>
{
expect
(
service
).
toBeTruthy
();
}));
});
code/moya-management-portal/src/app/organization/event-list/event-service.service.ts
0 → 100644
View file @
bb81b00
import
{
Injectable
}
from
'@angular/core'
;
@
Injectable
()
export
class
EventsService
{
get
(
org
:
String
)
{
if
(
org
.
localeCompare
(
'asm'
)
===
0
)
{
return
[
{
title
:
'Assembly Winter 18'
,
date
:
'1.2.2018 - 3.2.2018'
},
{
title
:
'Assembly Summer 18'
,
date
:
'1.2.2018 - 3.2.2018'
},
{
title
:
'Assembly Winter 19'
,
date
:
'1.2.2018 - 3.2.2018'
},
{
title
:
'Assembly Summer 19'
,
date
:
'1.2.2018 - 3.2.2018'
}
];
}
return
[
{
title
:
'No future events to show at the moment'
,
date
:
' '
}
];
}
}
code/moya-management-portal/src/app/organization/organization.module.ts
View file @
bb81b00
...
@@ -7,6 +7,7 @@ import {MatSelectModule} from '@angular/material/select';
...
@@ -7,6 +7,7 @@ import {MatSelectModule} from '@angular/material/select';
import
{
OrganizationListService
}
from
'./organization-list/organization-list.service'
;
import
{
OrganizationListService
}
from
'./organization-list/organization-list.service'
;
import
{
MatCardModule
}
from
'@angular/material/card'
;
import
{
MatCardModule
}
from
'@angular/material/card'
;
import
{
MatButtonModule
}
from
'@angular/material'
;
import
{
MatButtonModule
}
from
'@angular/material'
;
import
{
EventsService
}
from
'./event-list/event-service.service'
;
@
NgModule
({
@
NgModule
({
imports
:
[
imports
:
[
...
@@ -15,7 +16,7 @@ import {MatButtonModule} from '@angular/material';
...
@@ -15,7 +16,7 @@ import {MatButtonModule} from '@angular/material';
MatCardModule
,
MatCardModule
,
MatButtonModule
MatButtonModule
],
],
providers
:
[
OrganizationListService
],
providers
:
[
OrganizationListService
,
EventsService
],
declarations
:
[
NewOrganizationComponent
,
OrganizationListComponent
,
EventListComponent
],
declarations
:
[
NewOrganizationComponent
,
OrganizationListComponent
,
EventListComponent
],
exports
:
[
NewOrganizationComponent
,
OrganizationListComponent
,
EventListComponent
],
exports
:
[
NewOrganizationComponent
,
OrganizationListComponent
,
EventListComponent
],
})
})
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment