From 920647b4aa2ebe198486f8c3aac4b4dc808190fa Mon Sep 17 00:00:00 2001 From: simon987 Date: Wed, 6 Feb 2019 19:12:07 -0500 Subject: [PATCH] more translations and styling --- web/angular/src/app/app-routing.module.ts | 4 +- web/angular/src/app/app.component.html | 8 +-- web/angular/src/app/app.component.ts | 3 +- web/angular/src/app/app.module.ts | 1 + .../create-project.component.html | 66 +++++++++---------- .../project-dashboard.component.html | 45 +++++-------- .../project-dashboard.component.ts | 29 +++++++- .../project-list/project-list.component.css | 3 + .../project-list/project-list.component.html | 13 ++-- .../update-project.component.html | 57 ++++++++-------- web/angular/src/assets/i18n/en.json | 22 ++++++- web/angular/src/assets/i18n/fr.json | 24 ++++++- 12 files changed, 170 insertions(+), 105 deletions(-) diff --git a/web/angular/src/app/app-routing.module.ts b/web/angular/src/app/app-routing.module.ts index 978d133..1aefed9 100755 --- a/web/angular/src/app/app-routing.module.ts +++ b/web/angular/src/app/app-routing.module.ts @@ -37,7 +37,9 @@ export class AppRoutingModule { } private updateTitle(tr: TranslateService, title: Title, url: string) { - tr.get("title." + url.slice(1)).subscribe((t) => title.setTitle(t)) + url = url.substr(1); + tr.get("title." + url.substring(0, url.indexOf("/") == -1 ? url.length : url.indexOf("/"))) + .subscribe((t) => title.setTitle(t)) } } diff --git a/web/angular/src/app/app.component.html b/web/angular/src/app/app.component.html index 0b2ebdd..5130957 100755 --- a/web/angular/src/app/app.component.html +++ b/web/angular/src/app/app.component.html @@ -1,8 +1,8 @@ - - - - + + + + diff --git a/web/angular/src/app/app.component.ts b/web/angular/src/app/app.component.ts index df8990d..ed37894 100644 --- a/web/angular/src/app/app.component.ts +++ b/web/angular/src/app/app.component.ts @@ -1,4 +1,5 @@ import {Component} from '@angular/core'; +import {Router} from '@angular/router'; import {TranslateService} from "@ngx-translate/core"; import {MatSelectChange} from "@angular/material"; @@ -18,7 +19,7 @@ export class AppComponent { {lang: "en", display: "English"}, ]; - constructor(private translate: TranslateService) { + constructor(private translate: TranslateService, private router: Router) { translate.addLangs([ "en", diff --git a/web/angular/src/app/app.module.ts b/web/angular/src/app/app.module.ts index fa6974e..cdc915a 100755 --- a/web/angular/src/app/app.module.ts +++ b/web/angular/src/app/app.module.ts @@ -40,6 +40,7 @@ import {SnackBarComponent} from "./messenger/snack-bar.component"; import {TranslateLoader, TranslateModule, TranslateService} from "@ngx-translate/core"; import {TranslateHttpLoader} from "@ngx-translate/http-loader"; import {TranslatedPaginator} from "./TranslatedPaginatorConfiguration"; +import {Router} from "@angular/router"; export function createTranslateLoader(http: HttpClient) { diff --git a/web/angular/src/app/create-project/create-project.component.html b/web/angular/src/app/create-project/create-project.component.html index 9cc8711..dbeb4ef 100644 --- a/web/angular/src/app/create-project/create-project.component.html +++ b/web/angular/src/app/create-project/create-project.component.html @@ -1,38 +1,38 @@ - - Create new project - +
+ + {{"project.create_title" | translate}} + {{"project.create_subtitle" | translate}} - -
- - Project name - - + + + + {{"project.name" | translate}} + + + + {{ "project.clone_url" | translate}} + + + + {{ "project.git_repo" | translate }} + + + {{"project.git_repo_hint" | translate}} + + - - Git clone URL - - - - Repository name - - - Changes on the master branch will be tracked if webhooks are enabled - - + + {{"project.public" | translate}} - Public project - + - - - - - -
- - -
+ + + + + + +
diff --git a/web/angular/src/app/project-dashboard/project-dashboard.component.html b/web/angular/src/app/project-dashboard/project-dashboard.component.html index abfa326..59e2084 100644 --- a/web/angular/src/app/project-dashboard/project-dashboard.component.html +++ b/web/angular/src/app/project-dashboard/project-dashboard.component.html @@ -1,44 +1,33 @@ -
+
- Stats for project "{{projectStats["project"]["name"]}}" + {{"dashboard.title" | translate}} "{{project.name}}" -

Git repository: {{projectStats["project"]["git_repo"]}} +

+ {{"project.git_repo" | translate}}: + {{project.git_repo}}

-

Message of the day:

-
{{projectStats["project"]["motd"]}}
+

{{"project.motd" | translate}}:

+
{{project.motd}}
-
+
-
-
-
-
-
-
-
Task Status
-
-
-
-
-
-
-
-
Assignees
-
+
+
- + - Project metadata + {{"dashboard.metadata" | translate}} -
{{projectStats | json}}
+
{{project | json}}
- Update -
+ + +
diff --git a/web/angular/src/app/project-dashboard/project-dashboard.component.ts b/web/angular/src/app/project-dashboard/project-dashboard.component.ts index 9e51d97..57269aa 100644 --- a/web/angular/src/app/project-dashboard/project-dashboard.component.ts +++ b/web/angular/src/app/project-dashboard/project-dashboard.component.ts @@ -1,4 +1,7 @@ import {Component, OnInit} from '@angular/core'; +import {ApiService} from "../api.service"; +import {Project} from "../models/project"; +import {ActivatedRoute} from "@angular/router"; @Component({ @@ -9,8 +12,32 @@ import {Component, OnInit} from '@angular/core'; export class ProjectDashboardComponent implements OnInit { private projectId; - projectStats; + project: Project; + + + constructor(private apiService: ApiService, private route: ActivatedRoute) { + } + ngOnInit(): void { + this.route.params.subscribe(params => { + this.projectId = params["id"]; + this.getProject(); + }) + } + + private getProject() { + this.apiService.getProject(this.projectId).subscribe(data => { + this.project = { + id: data["project"]["id"], + name: data["project"]["name"], + clone_url: data["project"]["clone_url"], + git_repo: data["project"]["git_repo"], + motd: data["project"]["motd"], + priority: data["project"]["priority"], + version: data["project"]["version"], + public: data["project"]["public"], + } + }) } } diff --git a/web/angular/src/app/project-list/project-list.component.css b/web/angular/src/app/project-list/project-list.component.css index e69de29..903540a 100755 --- a/web/angular/src/app/project-list/project-list.component.css +++ b/web/angular/src/app/project-list/project-list.component.css @@ -0,0 +1,3 @@ +button { + margin-right: 15px; +} diff --git a/web/angular/src/app/project-list/project-list.component.html b/web/angular/src/app/project-list/project-list.component.html index be095e5..d0d8962 100755 --- a/web/angular/src/app/project-list/project-list.component.html +++ b/web/angular/src/app/project-list/project-list.component.html @@ -1,5 +1,5 @@
- + {{"projects.projects" | translate}} @@ -7,15 +7,16 @@ - {{project.id}}: {{project.name}} + {{project.id}}{{project.name}} + {{project.motd}}
{{project | json}}
-
- - +
diff --git a/web/angular/src/app/update-project/update-project.component.html b/web/angular/src/app/update-project/update-project.component.html index 9c9076d..aa04016 100644 --- a/web/angular/src/app/update-project/update-project.component.html +++ b/web/angular/src/app/update-project/update-project.component.html @@ -1,29 +1,34 @@ - - Update project +
+ + Update project - -
- - - + + + + + - - - + + + - - - - - - Changes on the master branch will be tracked if webhooks are - enabled - - - - - -
-
+ + + + + + Changes on the master branch will be tracked if webhooks + are + enabled + + + + + + + + +
diff --git a/web/angular/src/assets/i18n/en.json b/web/angular/src/assets/i18n/en.json index b82d499..623ee7c 100644 --- a/web/angular/src/assets/i18n/en.json +++ b/web/angular/src/assets/i18n/en.json @@ -21,13 +21,31 @@ }, "projects": { "projects": "Projects", - "dashboard": "Dashboard", - "update": "Update" + "dashboard": "Dashboard" }, "title": { "": "Index", + "project": "Project", "projects": "Projects", "log": "Logs", "new_project": "New project" + }, + "project": { + "name": "Project name", + "clone_url": "Clone url", + "clone_url_placeholder": "Example: \"https://github.com/simon987/task_tracker\"", + "git_repo_placeholder": "Example: \"simon987/task_tracker\"", + "git_repo_hint": "Changes in the master branch will be tracked if webhooks are enabled", + "create_title": "Create new project", + "create_subtitle": "Todo: subtitle", + "public": "Public", + "create": "Create", + "git_repo": "Git repository name", + "motd": "Message of the day", + "update": "Update" + }, + "dashboard": { + "title": "Dashboard for", + "metadata": "Project metadata" } } diff --git a/web/angular/src/assets/i18n/fr.json b/web/angular/src/assets/i18n/fr.json index bd24d59..baf4d87 100644 --- a/web/angular/src/assets/i18n/fr.json +++ b/web/angular/src/assets/i18n/fr.json @@ -21,14 +21,32 @@ }, "projects": { "projects": "Projets", - "dashboard": "Tableau de bord", - "update": "Modifier" + "dashboard": "Tableau de bord" }, "title": { "": "Accueil", + "project": "Projet", "projects": "Projets", "log": "Journal", - "new_project": "Nouveau projet" + "new_project": "Nouveau projet", + "update": "Modifier" + }, + "project": { + "name": "Nom du projet", + "clone_url": "Url de clone git", + "clone_url_placeholder": "Exemple: \"https://github.com/simon987/task_tracker\"", + "git_repo_placeholder": "Exemple: \"simon987/task_tracker\"", + "git_repo": "Nom du repository git", + "git_repo_hint": "Les changements dans la branche master vont êtres pris en compte si les webhooks sont activés", + "create_title": "Créer un nouveau projet", + "create_subtitle": "todo: sous-titre", + "public": "Publique", + "create": "Créer", + "motd": "Message du jour" + }, + "dashboard": { + "title": "Tableau de bord pour ", + "metadata": "Métadonnés du projet" } }