Skip to content

Commit

Permalink
Open Summer of Code final demo version (#62)
Browse files Browse the repository at this point in the history
Misc styling changes, fake YouTube embeds (to be removed), story delete function, questions updates, basic FR/EN translations.

* FIxed login, fixed youtube and sin-up.

* Fixed youtube image

* Fixed image id

* Albums style fixes

* Fixed iFrame

* Can delete and logout

* Begin popover

* Story option further

* Fixes, youtube, fakestories, logout, swipe etc...

* Some cleanup

* Somemore cleanup

* Small changes

* Fixed string

* Many fixes

* Fixed update stories and details.

* Fixex , improvements and clean-ups.

* Many fixes/changes

* Question updates

* Question shuffle & cycle

* Added translation

* En trans

* Fixed

* Package json updates & translation hotfix

* Translated most things and added it in the menu

* Albums & album detail header redesign

* Youtube icon centered

* Translation completed + fixes

* Text backdrop
  • Loading branch information
oxnoctisxo authored and th0rgall committed Jul 28, 2017
1 parent d586322 commit c51af15
Show file tree
Hide file tree
Showing 52 changed files with 940 additions and 1,235 deletions.
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"@ionic-native/status-bar": "3.12.1",
"@ionic-native/transfer": "^3.14.0",
"@ionic/storage": "^2.0.1",
"@ngx-translate/core": "^7.1.0",
"@ngx-translate/http-loader": "^0.1.0",
"com.telerik.plugins.nativepagetransitions": "^0.6.5",
"cordova-android": "^6.2.3",
"cordova-browser": "^4.1.0",
Expand Down
28 changes: 21 additions & 7 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
import {Component} from "@angular/core";
import {Platform} from "ionic-angular";
import {Component, ViewChild} from "@angular/core";
import {MenuController, Nav, Platform} from "ionic-angular";
import {StatusBar} from "@ionic-native/status-bar";
import {SplashScreen} from "@ionic-native/splash-screen";

import {TutorialPage} from "../pages/tutorial/tutorial";
import {PatientService} from "../providers/back-end/user.service";
import {env} from "./environment";
import {User} from "../dto/user";
import { AlbumsPage } from "../pages/albums/albums";
import {LoginPage} from "../pages/login/login";
import {AuthService} from "../providers/auth-service/auth-service";
import {TranslatorService} from "../providers/translator.service";
import {TranslateService} from "@ngx-translate/core";

@Component({
templateUrl: 'app.html'
})
export class MyApp {
private translate: TranslateService;
private translator:TranslatorService;

@ViewChild(Nav) nav: Nav;
rootPage: any = LoginPage;

constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, public patientService: PatientService) {
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,
public patientService: PatientService, public translatorService: TranslatorService,public authService: AuthService, public menu: MenuController) {
//localStorage.clear();
translatorService.refresh();
this.translate = translatorService.translate;
this.translator = translatorService;
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
});
}

logout() {
console.log("login out");
this.menu.close();
this.authService.logout();
this.nav.setRoot(LoginPage);
}
}
36 changes: 35 additions & 1 deletion src/app/app.html
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
<ion-nav [root]="rootPage"></ion-nav>
<ion-menu [content]="content">

<ion-toolbar color="general">
<ion-title>Menu</ion-title>
</ion-toolbar>

<ion-content>
<ion-list>
<button ion-item>
<ion-icon name="log-out"></ion-icon>
Logout
</button>
<button ion-item (click)="logout()" style="font-size: 20px;">
<ion-icon name="log-out"></ion-icon>
{{'Afmelden' | translate}}
</button>
<ion-item>
<ion-row style="text-align: center">
<ion-col *ngIf="translator.lang.indexOf('en') < 0">
<button ion-button color="general" clear (click)="translator.switchLang('en')">EN</button>
</ion-col>
<ion-col *ngIf="translator.lang.indexOf('fr') < 0">
<button ion-button color="general" clear (click)="translator.switchLang('fr')">FR</button>
</ion-col>
<ion-col *ngIf="translator.lang.indexOf('nl') < 0">
<button ion-button color="general" clear (click)="translator.switchLang('nl')">NL</button>
</ion-col>
</ion-row>
</ion-item>
</ion-list>
</ion-content>

</ion-menu>

<ion-nav id="nav" #content [root]="rootPage" swipeBackEnabled="false"></ion-nav>
45 changes: 26 additions & 19 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
import {ErrorHandler, NgModule} from "@angular/core";
import {BrowserModule } from "@angular/platform-browser";
import {BrowserModule} from "@angular/platform-browser";
import {IonicApp, IonicErrorHandler, IonicModule} from "ionic-angular";
import {IonicStorageModule} from "@ionic/storage";
import {MyApp} from "./app.component";

import {StoriesPage} from "../pages/stories/stories";
import {PatientProfilePage} from "../pages/patientprofile/patientprofile";

import {StatusBar} from "@ionic-native/status-bar";
import {SplashScreen} from "@ionic-native/splash-screen";
import {StanizerService} from "../providers/stanizer.service";
import {StoryDetailsPage} from "../pages/storydetails/storydetails";
import {PrismaService} from "../providers/back-end/prisma-api.service";
import {PatientService} from "../providers/back-end/user.service";
import {HttpModule} from "@angular/http";
import {HttpModule, Http} from "@angular/http";
import {StoryService} from "../providers/back-end/story.service";
import {TutorialPage} from "../pages/tutorial/tutorial";
import {Camera} from "@ionic-native/camera";
import {NewStoryPage} from "../pages/new-story/new-story";
import {FileChooser} from "@ionic-native/file-chooser";
import {UtilService} from "../providers/util-service";

import {ApiTestingPage} from "../pages/api-testing/api-testing";

import {FileTransfer} from "@ionic-native/file-transfer";
import {File} from "@ionic-native/file";
Expand All @@ -30,47 +26,52 @@ import {FilePath} from "@ionic-native/file-path";

import {AlbumsPage} from "../pages/albums/albums";
import {AlbumDetailPage} from "../pages/album-detail/album-detail";
import { AuthService } from '../providers/auth-service/auth-service';
import { QuestionService } from "../providers/question-service/question.service";
import { AlbumQuestions } from "../pages/album-detail/album-questions";
import {AuthService} from "../providers/auth-service/auth-service";
import {QuestionService} from "../providers/question-service/question.service";
import {AlbumQuestions} from "../pages/album-detail/album-questions";
import {LoginPage} from "../pages/login/login";
import {AuthGuard} from "../pages/auth-guard";
import {NativePageTransitions} from "@ionic-native/native-page-transitions";
import {StoryOptionsComponent} from "../pages/storydetails/story-options.component";
import {TranslateModule, TranslateLoader, TranslateService} from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import {TranslatorService} from "../providers/translator.service";


@NgModule({
declarations: [
MyApp,
TutorialPage,
LoginPage,
StoriesPage,
AlbumsPage,
AlbumDetailPage,
PatientProfilePage,
StoryDetailsPage,
NewStoryPage,
ApiTestingPage,
AlbumQuestions
AlbumQuestions,
StoryOptionsComponent
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
IonicStorageModule.forRoot(),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [Http]
}
}),
HttpModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
LoginPage,
TutorialPage,
StoriesPage,
AlbumsPage,
AlbumDetailPage,
PatientProfilePage,
StoryDetailsPage,
NewStoryPage,
ApiTestingPage,
AlbumQuestions
AlbumQuestions,
StoryOptionsComponent
],
providers: [
StatusBar,
Expand All @@ -89,9 +90,15 @@ import {NativePageTransitions} from "@ionic-native/native-page-transitions";
Transfer,
FilePath,
NativePageTransitions,
TranslatorService,
{provide: ErrorHandler, useClass: IonicErrorHandler},
AuthService
]
})
export class AppModule {
}


export function createTranslateLoader(http: Http) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
86 changes: 46 additions & 40 deletions src/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,37 @@ $text-input-placeholder-color: color($colors, light-gray);
.list-md .item-input.ng-valid.item-input-has-value.input-has-focus,
.list-md .item-input.ng-valid.input-has-focus:not(.item-input-has-value),
.list-md .item-input.ng-valid.input-has-value.input-has-focus,
{
//border-bottom: 2px solid map-get($colors, light-gray) !important;
border-bottom: none !important;
box-shadow:none !important;
{
//border-bottom: 2px solid map-get($colors, light-gray) !important;
border-bottom: none !important;
box-shadow: none !important;
}

.list-md .item-input:last-child {
border: none !important;
}


// PAGE HEADER

.page-header {
padding: 2em 3em;
//background-color: map-get($colors, 'primary');

height: 50vw;
background-color: color($colors, primary);
display: flex;
flex-direction: column;
justify-content: center;
position: relative;
}

.page-header h2 {
font-size: map-get($sizes, 'large');
line-height: 33px;
font-size: map-get($sizes, 'extra-large');
margin: 0;
//line-height: 33px;
text-align: center;
font-family: $prisma-ff;
color: map-get($colors, 'dark-gray');
// color: map-get($colors, 'dark-gray');
color: #fff;
}

// TOOLBAR
Expand All @@ -82,40 +88,40 @@ $text-input-placeholder-color: color($colors, light-gray);
}

// STARS
.star {
display: block;
position: absolute;
right: 0.7em;
bottom: 0.7em;
font-size: 3em;
color: color($colors, yellow);
}
.star {
display: block;
position: absolute;
right: 0.7em;
bottom: 0.7em;
font-size: 3em;
color: color($colors, yellow);
}

// TODO: class may be redundant now
.star.favorited {
color: color($colors, yellow);
}
// TODO: class may be redundant now
.star.favorited {
color: color($colors, yellow);
}

// ADD NEW STORY/ALBUM header
// ADD NEW STORY/ALBUM header

.add-new-container {
background-color: map-get($colors, 'primary');
color: #fff;
width: 100%;
height: 50vw;
display: flex;
align-items: center;
justify-content: center;
}
.add-new-container {
background-color: map-get($colors, 'primary');
color: #fff;
width: 100%;
height: 50vw;
display: flex;
align-items: center;
justify-content: center;
}

.add-new > * {
display: block;
}
.add-new > * {
display: block;
}

.add-new > ion-icon {
font-size: 3em;
text-align: center;
}
.add-new > ion-icon {
font-size: 3em;
text-align: center;
}

.add-new > span {
}
.add-new > span {
}
12 changes: 6 additions & 6 deletions src/app/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
* Created by Jean on 10-07-17.
*/

export const BACKEND: string = 'https://prisma.care';
export const API_URL: string = BACKEND + '/api/v1';
export const BACKEND: string = 'https://api.prisma.care';
export const API_URL: string = BACKEND + '/v1';


export const env = {
production: false,
jwtToken: 'id_token',
localstorage: {},
localstorage: {LOCALSTORAGE_SELECTEDLANG : "langs"},
api: {
getSignIn:'signin',
getSignIn: 'signin',
getPatient: 'patient',
getAlbum: 'album',
getStory: 'story',
Expand All @@ -24,8 +24,8 @@ export const env = {
fakePatient: "patient"
},
methods: {
addNewStory:'addNewStory',
replaceDescription:'replaceDescription',
addNewStory: 'addNewStory',
replaceDescription: 'replaceDescription',
replaceImage: 'replaceImage'
}
};
23 changes: 23 additions & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"Paswoord": "Paswoord",
"Aanmelden" : "Log in",
"Registreer" : "Register",
"Of heb je nog geen account" : "Do you have an account",
"Voornaam" : "First name",
"Achternaam" : "Last name",
"Annuleer" : "Cancel",
"Afmelden" : "Log out",
"Waarover babbelen we vandaag" : "What are we talking about today",
"Voeg album toe" : "Add an album",
"Voeg verhaal toe" : "Add a story",
"Tekst schrijven" : "Write some text",
"Maak foto" : "Take a photo",
"Kies foto van camerarol" : "Choose a photo from the library",
"Opslaan" : "Save",
"Vul het verhaal aan" : "Edit the story",
"Voeg een foto toe" :"Add a picture",
"Schrijf het verhaal.\nHoe meer details hoe beter." : "Write a story\nThe more details the better",
"Nieuw verhaal" : "New story",
"Voeg toe" : "Add"

}
Loading

0 comments on commit c51af15

Please sign in to comment.