-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from CentreForDigitalHumanities/feature/bulma-1
Feature/bulma 1
- Loading branch information
Showing
33 changed files
with
509 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.env/ | ||
.env/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.DS_Store | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
{{cookiecutter.slug}}/frontend.angular/src/app/app.config.server.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; | ||
import { provideServerRendering } from '@angular/platform-server'; | ||
import { BACKEND_URL_OVERRIDE, appConfig } from './app.config'; | ||
|
||
const serverConfig: ApplicationConfig = { | ||
providers: [ | ||
provideServerRendering(), | ||
{ provide: BACKEND_URL_OVERRIDE, useValue: 'http://localhost:{{cookiecutter.backend_port}}/api/' } | ||
] | ||
}; | ||
|
||
export const config = mergeApplicationConfig(appConfig, serverConfig); |
24 changes: 18 additions & 6 deletions
24
{{cookiecutter.slug}}/frontend.angular/src/app/app.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...iecutter.slug}}/frontend.angular/src/app/dark-mode-toggle/dark-mode-toggle.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<p class="control"> | ||
@if (dark) { | ||
<a class="button" title="Switch to light mode" i18n-title (click)="toggle()"> | ||
<span class="icon"> | ||
<fa-icon [icon]="faMoon"></fa-icon> | ||
</span> | ||
</a> | ||
} | ||
@else { | ||
<a class="button" title="Switch to dark mode" i18n-title (click)="toggle()"> | ||
<span class="icon"> | ||
<fa-icon [icon]="faSun"></fa-icon> | ||
</span> | ||
</a> | ||
} | ||
</p> |
Empty file.
23 changes: 23 additions & 0 deletions
23
...utter.slug}}/frontend.angular/src/app/dark-mode-toggle/dark-mode-toggle.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DarkModeToggleComponent } from './dark-mode-toggle.component'; | ||
|
||
describe('DarkModeToggleComponent', () => { | ||
let component: DarkModeToggleComponent; | ||
let fixture: ComponentFixture<DarkModeToggleComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [DarkModeToggleComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DarkModeToggleComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
32 changes: 32 additions & 0 deletions
32
...okiecutter.slug}}/frontend.angular/src/app/dark-mode-toggle/dark-mode-toggle.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Component, OnDestroy } from '@angular/core'; | ||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; | ||
import { faSun, faMoon } from '@fortawesome/free-solid-svg-icons'; | ||
import { Subscription } from 'rxjs'; | ||
import { DarkModeService } from '../services/dark-mode.service'; | ||
|
||
@Component({ | ||
selector: '{{cookiecutter.app_prefix}}-dark-mode-toggle', | ||
standalone: true, | ||
imports: [FontAwesomeModule], | ||
templateUrl: './dark-mode-toggle.component.html', | ||
styleUrl: './dark-mode-toggle.component.scss' | ||
}) | ||
export class DarkModeToggleComponent implements OnDestroy { | ||
private subscriptions!: Subscription[]; | ||
faSun = faSun; | ||
faMoon = faMoon; | ||
dark = false; | ||
|
||
constructor(private darkModeService: DarkModeService) { | ||
this.subscriptions = [ | ||
this.darkModeService.theme$.subscribe(theme => this.dark = theme === 'dark')]; | ||
} | ||
|
||
toggle() { | ||
this.darkModeService.toggle(); | ||
} | ||
|
||
ngOnDestroy(): void { | ||
this.subscriptions.forEach(s => s.unsubscribe()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
{{cookiecutter.slug}}/frontend.angular/src/app/footer/footer.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.lab-logo { | ||
max-width: 400px; | ||
.centre-logo { | ||
width: 450px; | ||
max-width: calc(100vw - 7rem); | ||
} |
20 changes: 17 additions & 3 deletions
20
{{cookiecutter.slug}}/frontend.angular/src/app/footer/footer.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,29 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, Inject, LOCALE_ID, OnDestroy } from '@angular/core'; | ||
import { formatDate } from '@angular/common'; | ||
import { Subscription } from 'rxjs'; | ||
import { environment } from '../../environments/environment'; | ||
import { DarkModeService } from '../services/dark-mode.service'; | ||
|
||
@Component({ | ||
selector: '{{cookiecutter.app_prefix}}-footer', | ||
templateUrl: './footer.component.html', | ||
styleUrls: ['./footer.component.scss'], | ||
standalone: true | ||
}) | ||
export class FooterComponent { | ||
export class FooterComponent implements OnDestroy { | ||
environment = environment; | ||
buildTime!: string; | ||
dark = false; | ||
subscriptions!: Subscription[]; | ||
|
||
constructor() { } | ||
constructor(@Inject(LOCALE_ID) localeId: string, darkModeService: DarkModeService) { | ||
this.buildTime = formatDate(new Date(environment.buildTime), $localize`:@@dateFormat:MMMM dd, yyyy`, localeId); | ||
this.subscriptions = [ | ||
darkModeService.theme$.subscribe(theme => this.dark = theme === 'dark')]; | ||
} | ||
|
||
ngOnDestroy(): void { | ||
this.subscriptions.forEach(s => s.unsubscribe()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.