Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
allo-app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nabil Sadki
allo-app
Commits
36dcfd0c
Commit
36dcfd0c
authored
Sep 30, 2019
by
Nabil Sadki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wishlist : hide for anonymous
parent
3c3e8f68
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
104 deletions
+117
-104
config.xml
config.xml
+1
-0
login.page.ts
src/app/pages/compte/login/login.page.ts
+2
-1
menu.page.html
src/app/pages/menu/menu.page.html
+83
-83
menu.page.ts
src/app/pages/menu/menu.page.ts
+14
-7
offres-carte.page.html
src/app/pages/offres/offres-carte/offres-carte.page.html
+10
-8
offres-carte.page.ts
src/app/pages/offres/offres-carte/offres-carte.page.ts
+2
-0
auth.service.ts
src/app/services/auth.service.ts
+5
-5
No files found.
config.xml
View file @
36dcfd0c
...
...
@@ -105,4 +105,5 @@
<feature
name=
"StatusBar"
>
<param
name=
"ios-package"
onload=
"true"
value=
"CDVStatusBar"
/>
</feature>
<engine
name=
"android"
spec=
"^8.1.0"
/>
</widget>
src/app/pages/compte/login/login.page.ts
View file @
36dcfd0c
...
...
@@ -65,6 +65,7 @@ export class LoginPage implements OnInit {
}
doAnonymousLogIn
()
{
this
.
_AUTH
.
isAnonymous
=
true
;
const
wpUser
=
{
token
:
null
,
user_nicename
:
'anonymous'
,
...
...
@@ -89,7 +90,7 @@ export class LoginPage implements OnInit {
.
then
(
res
=>
{
this
.
_ALLO
.
dismissLoading
();
console
.
log
(
'User exist'
,
res
)
;
this
.
_AUTH
.
isAnonymous
=
false
;
this
.
storage
.
get
(
'APP_PARAMS'
).
then
(
appParams
=>
{
if
(
appParams
.
PARAM_mainslider
)
{
this
.
router
.
navigate
([
'app/dashboard'
]);
...
...
src/app/pages/menu/menu.page.html
View file @
36dcfd0c
<ion-menu
contentId=
"content"
>
<ion-header>
<ion-toolbar
color=
"primary"
>
<div
class=
"anonymous ion-text-center"
*
ngIf=
"_AUTH.infoNicename === 'anonymous'"
padding
>
<p
no-margin
>
<img
src=
"../../../../assets/img/ionic3-ico.png"
/>
</p>
<ion-chip
color=
""
outline=
"true"
>
Mode anonyme
</ion-chip>
<p
no-margin
>
<ion-button
size=
"small"
color=
"dark"
(
click
)="
logout
()"
>
<ion-icon
name=
"log-out"
></ion-icon>
Déconnexion
</ion-button>
</p>
</div>
<div
class=
"connected"
*
ngIf=
"_AUTH.infoNicename !== 'anonymous'"
>
<ion-grid>
<ion-row>
<ion-col
size=
"4"
>
<ion-avatar>
<img
src=
"../assets/img/avatar.jpeg"
>
</ion-avatar>
</ion-col>
<ion-col
size=
"8"
>
<ion-text>
<h4>
{{ _AUTH.infoFullname }}
</h4>
</ion-text>
<ion-chip
color=
"light"
outline=
"true"
>
<ion-icon
name=
"star"
></ion-icon>
<ion-label>
Testeur
</ion-label>
</ion-chip>
<!-- <ion-chip color="light">
<div
class=
"anonymous ion-text-center"
*
ngIf=
"_AUTH.infoNicename === 'anonymous'"
padding
>
<p
no-margin
>
<img
src=
"../../../../assets/img/ionic3-ico.png"
/>
</p>
<ion-chip
color=
""
outline=
"true"
>
Mode anonyme
</ion-chip>
<p
no-margin
>
<ion-button
size=
"small"
color=
"dark"
(
click
)="
logout
()"
>
<ion-icon
name=
"log-out"
></ion-icon>
Déconnexion
</ion-button>
</p>
</div>
<div
class=
"connected"
*
ngIf=
"_AUTH.infoNicename !== 'anonymous'"
>
<ion-grid>
<ion-row>
<ion-col
size=
"4"
>
<ion-avatar>
<img
src=
"../assets/img/avatar.jpeg"
>
</ion-avatar>
</ion-col>
<ion-col
size=
"8"
>
<ion-text>
<h4>
{{ _AUTH.infoFullname }}
</h4>
</ion-text>
<ion-chip
color=
"light"
outline=
"true"
>
<ion-icon
name=
"star"
></ion-icon>
<ion-label>
Testeur
</ion-label>
</ion-chip>
<!-- <ion-chip color="light">
<ion-icon name="trophy" no-margin></ion-icon>
</ion-chip> -->
</ion-col>
</ion-row>
</ion-grid>
<ion-card
color=
"light"
>
<ion-grid>
<!-- <ion-row no-padding padding-horizontal>
</ion-col>
</ion-row>
</ion-grid>
<ion-card
color=
"light"
>
<ion-grid>
<!-- <ion-row no-padding padding-horizontal>
<ion-col no-padding>
<ion-label>Mes points :</ion-label>
</ion-col>
...
...
@@ -53,64 +53,64 @@
<ion-col no-padding size="6" class="ion-text-start"> 0 </ion-col>
<ion-col no-padding size="6" class="ion-text-end"> 1000 </ion-col>
</ion-row> -->
<ion-row>
<ion-col
no-padding
class=
"column"
>
<ion-menu-toggle>
<ion-button
fill=
"outline"
size=
"small"
color=
"dark"
routerLink=
"/app/profil"
routerDirection=
"root"
routerLinkActive=
"active"
>
<ion-icon
name=
"contact"
></ion-icon>
Profil
<ion-row>
<ion-col
no-padding
class=
"column"
>
<ion-menu-toggle>
<ion-button
fill=
"outline"
size=
"small"
color=
"dark"
routerLink=
"/app/profil"
routerDirection=
"root"
routerLinkActive=
"active"
>
<ion-icon
name=
"contact"
></ion-icon>
Profil
</ion-button>
</ion-menu-toggle>
</ion-col>
<ion-col
no-padding
class=
"column"
>
<ion-button
size=
"small"
color=
"dark"
(
click
)="
logout
()"
>
<ion-icon
name=
"log-out"
></ion-icon>
Déconnexion
</ion-button>
</ion-menu-toggle>
</ion-col>
<ion-col
no-padding
class=
"column"
>
<ion-button
size=
"small"
color=
"dark"
(
click
)="
logout
()"
>
<ion-icon
name=
"log-out"
></ion-icon>
Déconnexion
</ion-button>
</ion-col>
</ion-row>
</ion-col>
</ion-row>
</ion-grid>
</ion-card>
</div>
</ion-grid>
</ion-card>
</div>
</ion-toolbar>
</ion-header>
<ion-content>
<div
*
ngFor=
"let p of pages"
>
<!-- Standard Menu Item -->
<ion-menu-toggle
*
ngIf=
"p.url"
>
<ion-item
[
routerLink
]="
p
.
url
"
routerDirection=
"root"
routerLinkActive=
"active"
>
<ion-icon
[
name
]="
p
.
icon
"
slot=
"start"
></ion-icon>
<ion-label>
{{ p.title }}
</ion-label>
</ion-item>
</ion-menu-toggle>
<!-- Item with Children -->
<ion-item
button
*
ngIf=
"p.children?.length > 0"
(
click
)="
p
.
open =
!p.open"
[
class
.
parent-active
]="
p
.
open
"
detail=
"false"
>
<ion-icon
slot=
"start"
name=
"arrow-forward"
*
ngIf=
"!p.open"
></ion-icon>
<ion-icon
slot=
"start"
name=
"arrow-down"
*
ngIf=
"p.open"
></ion-icon>
<ion-label>
{{ p.title }}
</ion-label>
</ion-item>
<!-- Children List for clicked Item -->
<ion-list
*
ngIf=
"p.open"
>
<ion-menu-toggle>
<ion-item
*
ngFor=
"let sub of p.children"
class=
"sub-item"
[
routerLink
]="
sub
.
url
"
routerDirection=
"root"
routerLinkActive=
"active"
>
<ion-icon
[
name
]="
sub
.
icon
"
slot=
"start"
></ion-icon>
<div
*
ngIf=
"p.anonymous || (!p.anonymous && !_AUTH.isAnonymous)"
>
<!-- Standard Menu Item -->
<ion-menu-toggle
*
ngIf=
"p.url"
>
<ion-item
[
routerLink
]="
p
.
url
"
routerDirection=
"root"
routerLinkActive=
"active"
>
<ion-icon
[
name
]="
p
.
icon
"
slot=
"start"
></ion-icon>
<ion-label>
{{
sub
.title }}
{{
p
.title }}
</ion-label>
</ion-item>
</ion-menu-toggle>
</ion-list>
<!-- Item with Children -->
<ion-item
button
*
ngIf=
"p.children?.length > 0"
(
click
)="
p
.
open =
!p.open"
[
class
.
parent-active
]="
p
.
open
"
detail=
"false"
>
<ion-icon
slot=
"start"
name=
"arrow-forward"
*
ngIf=
"!p.open"
></ion-icon>
<ion-icon
slot=
"start"
name=
"arrow-down"
*
ngIf=
"p.open"
></ion-icon>
<ion-label>
{{ p.title }}
</ion-label>
</ion-item>
<!-- Children List for clicked Item -->
<ion-list
*
ngIf=
"p.open"
>
<ion-menu-toggle>
<ion-item
*
ngFor=
"let sub of p.children"
class=
"sub-item"
[
routerLink
]="
sub
.
url
"
routerDirection=
"root"
routerLinkActive=
"active"
>
<ion-icon
[
name
]="
sub
.
icon
"
slot=
"start"
></ion-icon>
<ion-label>
{{ sub.title }}
</ion-label>
</ion-item>
</ion-menu-toggle>
</ion-list>
</div>
</div>
</ion-content>
...
...
src/app/pages/menu/menu.page.ts
View file @
36dcfd0c
...
...
@@ -13,37 +13,44 @@ export class MenuPage implements OnInit {
{
title
:
'Les promos'
,
url
:
'/app/dashboard'
,
icon
:
'home'
icon
:
'home'
,
anonymous
:
'true'
},
{
title
:
'Partenaires'
,
url
:
'/app/partenaires'
,
icon
:
'contacts'
icon
:
'contacts'
,
anonymous
:
true
},
{
title
:
'Favoris'
,
url
:
'/app/favoris'
,
icon
:
'bookmark'
icon
:
'bookmark'
,
anonymous
:
false
},
{
title
:
'Paramètres'
,
url
:
'/app/params'
,
icon
:
'settings'
icon
:
'settings'
,
anonymous
:
true
},
{
title
:
'Contact'
,
url
:
'/app/contact'
,
icon
:
'at'
icon
:
'at'
,
anonymous
:
true
},
{
title
:
'A propos'
,
url
:
'/app/a-propos'
,
icon
:
'alert'
icon
:
'alert'
,
anonymous
:
true
},
{
title
:
'Présentation'
,
url
:
'/mainslider'
,
icon
:
'albums'
icon
:
'albums'
,
anonymous
:
true
}
];
...
...
src/app/pages/offres/offres-carte/offres-carte.page.html
View file @
36dcfd0c
...
...
@@ -52,14 +52,16 @@
</ion-card>
</div>
<div
class=
"card-wrapper"
*
ngFor=
"let trip of _TRIP.offersCardList"
>
<ion-button
color=
"light"
fill=
"solid"
class=
"bookmark"
(
click
)="
_TRIP
.
wishList
(
trip
,
'
add
')"
*
ngIf=
"!trip.bookmarked"
no-padding
>
<ion-icon
name=
"heart-empty"
></ion-icon>
</ion-button>
<ion-button
color=
"light"
fill=
"solid"
class=
"bookmark"
(
click
)="
_TRIP
.
wishList
(
trip
,
'
remove
')"
*
ngIf=
"trip.bookmarked"
no-padding
>
<ion-icon
name=
"heart"
color=
"danger"
></ion-icon>
</ion-button>
<div
*
ngIf=
"!_AUTH.isAnonymous"
>
<ion-button
color=
"light"
fill=
"solid"
class=
"bookmark"
(
click
)="
_TRIP
.
wishList
(
trip
,
'
add
')"
*
ngIf=
"!trip.bookmarked"
no-padding
>
<ion-icon
name=
"heart-empty"
></ion-icon>
</ion-button>
<ion-button
color=
"light"
fill=
"solid"
class=
"bookmark"
(
click
)="
_TRIP
.
wishList
(
trip
,
'
remove
')"
*
ngIf=
"trip.bookmarked"
no-padding
>
<ion-icon
name=
"heart"
color=
"danger"
></ion-icon>
</ion-button>
</div>
<ion-card
(
click
)="
viewDetail
(
trip
.
id
)"
tappable
no-margin
margin-bottom
>
<div
class=
"img-spinner-wrap ion-text-center"
>
<ion-spinner
name=
"dots"
*
ngIf=
"trip.hidden"
></ion-spinner>
...
...
src/app/pages/offres/offres-carte/offres-carte.page.ts
View file @
36dcfd0c
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
ToastController
,
IonInfiniteScroll
}
from
'@ionic/angular'
;
import
{
AlloService
}
from
'../../../services/allo-service'
;
import
{
AuthService
}
from
'../../../services/auth.service'
;
import
{
TripService
}
from
'../../../services/trip-service'
;
import
{
Storage
}
from
'@ionic/storage'
;
import
{
Router
}
from
'@angular/router'
;
...
...
@@ -17,6 +18,7 @@ export class OffresCartePage implements OnInit {
constructor
(
public
_ALLO
:
AlloService
,
public
_AUTH
:
AuthService
,
public
_TRIP
:
TripService
,
public
toastCtrl
:
ToastController
,
private
router
:
Router
,
...
...
src/app/services/auth.service.ts
View file @
36dcfd0c
...
...
@@ -22,7 +22,7 @@ export class AuthService {
public
infoEmail
;
authState
=
new
BehaviorSubject
(
false
);
authProfile
=
new
BehaviorSubject
(
false
)
;
public
isAnonymous
=
false
;
constructor
(
private
platform
:
Platform
,
...
...
@@ -41,7 +41,7 @@ export class AuthService {
}
});
this
.
isLoggedIn
();
this
.
i
sAnonymous
();
this
.
checkI
sAnonymous
();
});
}
...
...
@@ -56,16 +56,16 @@ export class AuthService {
isLoggedIn
()
{
this
.
storage
.
get
(
'wpUser'
).
then
((
wpUser
)
=>
{
if
(
wpUser
)
{
console
.
log
(
'wpuser found'
)
this
.
authState
.
next
(
true
);
}
});
}
i
sAnonymous
()
{
checkI
sAnonymous
()
{
this
.
storage
.
get
(
'wpUser'
).
then
((
wpUser
)
=>
{
if
(
wpUser
&&
wpUser
.
hasOwnProperty
(
'user_nicename'
)
&&
wpUser
.
user_nicename
===
'anonymous'
)
{
this
.
authProfile
.
next
(
true
);
this
.
isAnonymous
=
true
;
console
.
log
(
'this.isAnonymous'
,
this
.
isAnonymous
);
}
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment