diff --git a/README.md b/README.md index e99418d..19d5636 100644 --- a/README.md +++ b/README.md @@ -132,13 +132,13 @@ Because I like seeing the numbers. ### `src` -Language | Files | Blank | Comment | Code --------------|-------:|---------:|--------:|---------: -TypeScript | 51 | 543 | 23 | 2521 -PHP | 18 | 538 | 19 | 1672 -HTML | 17 | 117 | 0 | 1061 -SASS | 13 | 207 | 11 | 940 -__SUM:__ | __99__ | __1405__ | __53__ | __6194__ +Language | Files | Blank | Comment | Code +-------------|--------:|---------:|--------:|---------: +TypeScript | 53 | 565 | 24 | 2656 +PHP | 18 | 554 | 19 | 1725 +HTML | 17 | 120 | 10 | 1102 +SASS | 13 | 207 | 11 | 942 +__SUM:__ | __101__ | __1446__ | __64__ | __6425__ Command: `cloc --exclude-dir=vendor --exclude-ext=json src/` @@ -146,11 +146,11 @@ Command: `cloc --exclude-dir=vendor --exclude-ext=json src/` Language | Files | Blank | Comment | Code -------------|-------:|---------:|--------:|---------: -PHP | 10 | 669 | 14 | 1955 -JavaScript | 29 | 383 | 49 | 1584 -__SUM:__ | __39__ | __1052__ | __63__ | __3539__ +PHP | 10 | 683 | 16 | 1994 +JavaScript | 30 | 390 | 50 | 1610 +__SUM:__ | __40__ | __1073__ | __66__ | __3604__ Command: `cloc --exclude-ext=xml test/` -Counts last updated Feb 17, 2017 +Counts last updated Mar 3, 2017 diff --git a/src/app/app.component.ts b/src/app/app.component.ts index eac7750..d0daee6 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -8,7 +8,8 @@ import { Notifications, StringsService } from './shared/index'; }) export class AppComponent { constructor(strings: StringsService) { - // Nothing needed + // StringsService loaded here so the same instance + // is availabe across the app. } } diff --git a/src/app/board/board.component.ts b/src/app/board/board.component.ts index 1aacf53..f75b7e2 100644 --- a/src/app/board/board.component.ts +++ b/src/app/board/board.component.ts @@ -61,7 +61,7 @@ export class BoardDisplay implements OnInit { }); active.params.subscribe(params => { - let id = +params['id']; // tslint:disable-line + let id = +params.id; this.boardNavId = id ? id : null; this.updateActiveBoard(); diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html index 6739c16..1d47926 100644 --- a/src/app/settings/settings.component.html +++ b/src/app/settings/settings.component.html @@ -1,4 +1,4 @@ - +
diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts index 79f9b42..5cb1f2e 100644 --- a/src/app/settings/settings.component.ts +++ b/src/app/settings/settings.component.ts @@ -1,13 +1,8 @@ import { Component } from '@angular/core'; import { Title } from '@angular/platform-browser'; -import { TopNav } from '../shared/index'; +import { StringsService } from '../shared/index'; import { SettingsService } from './settings.service'; -import { - UserSettings, - UserAdmin, - BoardAdmin -} from './index'; @Component({ selector: 'tb-settings', @@ -15,10 +10,18 @@ import { providers: [ SettingsService ] }) export class Settings { - constructor(private settings: SettingsService, private title: Title) { + private strings: any; + + constructor(private settings: SettingsService, + private stringsService: StringsService, + private title: Title) { // SettingsService is loaded here so the same instance is available // to all child components. - title.setTitle('TaskBoard - Settings'); + + stringsService.stringsChanged.subscribe(newStrings => { + this.strings = newStrings; + title.setTitle('TaskBoard - ' + this.strings['settings']); // tslint:disable-line + }); } } diff --git a/src/app/settings/user-admin/user-admin.component.html b/src/app/settings/user-admin/user-admin.component.html index 8da0fa1..cfd7c5d 100644 --- a/src/app/settings/user-admin/user-admin.component.html +++ b/src/app/settings/user-admin/user-admin.component.html @@ -1,15 +1,15 @@
-

User Administration

+

{{ strings['settings_userAdmin'] }}

- - - - - + + + + + @@ -20,11 +20,13 @@
UserEmailSecurity LevelDefault BoardActions{{ strings['settings_user'] }}{{ strings['settings_email'] }}{{ strings['settings_securityLevel'] }}{{ strings['settings_defaultBoard'] }}{{ strings['settings_actions'] }}
{{ user.default_board_name }} - + - @@ -39,53 +41,60 @@ -
Removing a user cannot be undone.
Continue?
+
+ {{ strings['settings_removeUserWarning'] }}
+ {{ strings['settings_continue'] }} +
+ (click)="removeUser()">{{ strings['yes'] }} + (click)="modal.close(MODAL_CONFIRM_ID)">{{ strings['no'] }}
- +
@@ -118,11 +127,12 @@ - {{ modalProps.prefix === '' ? 'Add' : 'Save' }} - User + {{ modalProps.prefix === '' + ? strings['settings_add'] : strings['save'] }} + {{ strings['settings_user'] }}
diff --git a/src/app/settings/user-admin/user-admin.component.ts b/src/app/settings/user-admin/user-admin.component.ts index 018dc9e..8acf800 100644 --- a/src/app/settings/user-admin/user-admin.component.ts +++ b/src/app/settings/user-admin/user-admin.component.ts @@ -10,7 +10,8 @@ import { User, AuthService, ModalService, - NotificationsService + NotificationsService, + StringsService } from '../../shared/index'; import { UserDisplay, @@ -29,6 +30,7 @@ export class UserAdmin { private activeUser: User; private modalProps: ModalProperties; private userToRemove: UserDisplay; + private strings: any; private loading = true; private saving = false; @@ -40,7 +42,8 @@ export class UserAdmin { private notes: NotificationsService, private auth: AuthService, private settings: SettingsService, - private modal: ModalService) { + private modal: ModalService, + private stringsService: StringsService) { this.MODAL_ID = 'user-addEdit-form'; this.MODAL_CONFIRM_ID = 'user-remove-confirm'; @@ -61,6 +64,10 @@ export class UserAdmin { this.replaceUser(activeUser); }); + stringsService.stringsChanged.subscribe(newStrings => { + this.strings = newStrings; + }); + settings.boardsChanged .subscribe(boards => { this.boards = boards; @@ -225,11 +232,11 @@ export class UserAdmin { } private showModal(title: string, user?: UserDisplay): void { - let isAdd = (title === 'Add'); + let isAdd = (title === this.strings.settings_add); this.modalProps = { title, - prefix: isAdd ? '' : 'Change', + prefix: isAdd ? '' : this.strings.settings_change, user: isAdd ? new ModalUser(new User()) : new ModalUser(user) }; diff --git a/src/app/settings/user-settings/user-settings.component.html b/src/app/settings/user-settings/user-settings.component.html index 7df1a9f..aa0ae29 100644 --- a/src/app/settings/user-settings/user-settings.component.html +++ b/src/app/settings/user-settings/user-settings.component.html @@ -40,7 +40,7 @@