Basisimplementierung Songlist
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<div [class.padding]="padding" class="card">
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
12
src/app/widget-modules/components/card/card.component.less
Normal file
12
src/app/widget-modules/components/card/card.component.less
Normal file
@@ -0,0 +1,12 @@
|
||||
@import "../../../../styles/shadow";
|
||||
|
||||
.card {
|
||||
.card-3;
|
||||
margin: 20px;
|
||||
border-radius: 8px;
|
||||
background: #fffe;
|
||||
|
||||
&.padding {
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {CardComponent} from './card.component';
|
||||
|
||||
describe('CardComponent', () => {
|
||||
let component: CardComponent;
|
||||
let fixture: ComponentFixture<CardComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [CardComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CardComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
17
src/app/widget-modules/components/card/card.component.ts
Normal file
17
src/app/widget-modules/components/card/card.component.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import {Component, Input, OnInit} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-card',
|
||||
templateUrl: './card.component.html',
|
||||
styleUrls: ['./card.component.less']
|
||||
})
|
||||
export class CardComponent implements OnInit {
|
||||
@Input() padding = true;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
14
src/app/widget-modules/components/card/card.module.ts
Normal file
14
src/app/widget-modules/components/card/card.module.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {CardComponent} from './card.component';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [CardComponent],
|
||||
exports: [CardComponent],
|
||||
imports: [
|
||||
CommonModule
|
||||
]
|
||||
})
|
||||
export class CardModule {
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {SongTypePipe} from './song-type.pipe';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [SongTypePipe],
|
||||
exports: [
|
||||
SongTypePipe
|
||||
],
|
||||
imports: [
|
||||
CommonModule
|
||||
]
|
||||
})
|
||||
export class SongTypeTranslaterModule {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import {SongTypePipe} from './song-type.pipe';
|
||||
|
||||
describe('SongTypePipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new SongTypePipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
import {Pipe, PipeTransform} from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'songType'
|
||||
})
|
||||
export class SongTypePipe implements PipeTransform {
|
||||
|
||||
transform(songTypeKey: string): string {
|
||||
switch (songTypeKey) {
|
||||
case "Worship":
|
||||
return "Anbetung";
|
||||
case "Praise":
|
||||
return "Lobpreis";
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user