Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Cesium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
173
Issues
173
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clients
Cesium-grp
Cesium
Commits
b965bb4c
Commit
b965bb4c
authored
Jul 20, 2019
by
Benoit Lavenier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[enh] Home: Allow to change locale
parent
2862bb23
Pipeline
#6151
passed with stages
in 5 minutes and 38 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
18 deletions
+48
-18
www/js/controllers/app-controllers.js
www/js/controllers/app-controllers.js
+28
-1
www/templates/api/home.html
www/templates/api/home.html
+4
-8
www/templates/api/locales_popover.html
www/templates/api/locales_popover.html
+1
-1
www/templates/api/transfer.html
www/templates/api/transfer.html
+4
-8
www/templates/home/home.html
www/templates/home/home.html
+11
-0
No files found.
www/js/controllers/app-controllers.js
View file @
b965bb4c
...
...
@@ -503,10 +503,11 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $
}
function
HomeController
(
$scope
,
$state
,
$timeout
,
$ionicHistory
,
csPlatform
,
csCurrency
)
{
function
HomeController
(
$scope
,
$state
,
$timeout
,
$ionicHistory
,
$translate
,
UIUtils
,
csPlatform
,
csCurrency
,
csSettings
)
{
'
ngInject
'
;
$scope
.
loading
=
true
;
$scope
.
locales
=
angular
.
copy
(
csSettings
.
locales
);
$scope
.
enter
=
function
(
e
,
state
)
{
if
(
state
&&
state
.
stateParams
&&
state
.
stateParams
.
error
)
{
// Error query parameter
...
...
@@ -558,6 +559,32 @@ function HomeController($scope, $state, $timeout, $ionicHistory, csPlatform, csC
}
};
$scope
.
changeLanguage
=
function
(
langKey
)
{
$translate
.
use
(
langKey
);
$scope
.
hideLocalesPopover
();
csSettings
.
data
.
locale
=
_
.
findWhere
(
$scope
.
locales
,
{
id
:
langKey
});
};
/* -- show/hide locales popup -- */
$scope
.
showLocalesPopover
=
function
(
event
)
{
UIUtils
.
popover
.
show
(
event
,
{
templateUrl
:
'
templates/api/locales_popover.html
'
,
scope
:
$scope
,
autoremove
:
true
,
afterShow
:
function
(
popover
)
{
$scope
.
localesPopover
=
popover
;
}
});
};
$scope
.
hideLocalesPopover
=
function
()
{
if
(
$scope
.
localesPopover
)
{
$scope
.
localesPopover
.
hide
();
$scope
.
localesPopover
=
null
;
}
};
// For DEV ONLY
/*$timeout(function() {
$scope.loginAndGo();
...
...
www/templates/api/home.html
View file @
b965bb4c
...
...
@@ -5,15 +5,11 @@
<ion-nav-buttons
side=
"right"
>
<!-- locales -->
<img
ng-if=
"$root.settings.locale.country"
ng-src=
"https://www.countryflags.io/{{$root.settings.locale.country}}/shiny/32.png"
style=
"padding: 5px 0"
ng-click=
"showLocalesPopover($event)"
>
<button
class=
"button button-clear hidden-xs hidden-sm gray"
style=
"max-width: 450px !important"
ng-click=
"showLocalesPopover($event)"
>
{{$root.settings.locale.label}}
ng-click=
"showLocalesPopover($event)"
style=
"align-content: center"
>
<img
ng-if=
"$root.settings.locale.country"
ng-src=
"https://www.countryflags.io/{{$root.settings.locale.country}}/shiny/32.png"
>
<span
ng-if=
"!$root.settings.locale.country"
>
{{$root.settings.locale.label}}
</span>
<small
class=
"ion-arrow-down-b"
></small>
</button>
</ion-nav-buttons>
...
...
www/templates/api/locales_popover.html
View file @
b965bb4c
...
...
@@ -6,7 +6,7 @@
class=
"item item-icon-left ink"
ng-click=
"changeLanguage(l.id)"
>
<i
class=
"item-image avatar"
style=
"b
ackground-image: url(https://www.countryflags.io/{{l.country}}/flat/32
.png)"
></i>
style=
"b
order-radius: 0; background-image: url(https://www.countryflags.io/{{l.country}}/shiny/64
.png)"
></i>
{{l.label | translate}}
</a>
...
...
www/templates/api/transfer.html
View file @
b965bb4c
...
...
@@ -12,15 +12,11 @@
<ion-nav-buttons
side=
"right"
>
<!-- locales -->
<img
ng-if=
"$root.settings.locale.country"
ng-src=
"https://www.countryflags.io/{{$root.settings.locale.country}}/shiny/32.png"
style=
"padding: 5px 0"
ng-click=
"showLocalesPopover($event)"
>
<button
class=
"button button-clear hidden-xs hidden-sm gray"
style=
"max-width: 450px !important"
ng-click=
"showLocalesPopover($event)"
>
{{$root.settings.locale.label}}
ng-click=
"showLocalesPopover($event)"
style=
"align-content: center"
>
<img
ng-hide=
"!$root.settings.locale.country"
ng-src=
"https://www.countryflags.io/{{$root.settings.locale.country}}/shiny/32.png"
>
<span
ng-hide=
"$root.settings.locale.country"
>
{{$root.settings.locale.label}}
</span>
<small
class=
"ion-arrow-down-b"
></small>
</button>
...
...
www/templates/home/home.html
View file @
b965bb4c
...
...
@@ -2,6 +2,17 @@
<!-- no title -->
<ion-nav-title></ion-nav-title>
<ion-nav-buttons
side=
"secondary"
>
<!-- locales -->
<button
class=
"button button-clear hidden-xs hidden-sm gray"
ng-click=
"showLocalesPopover($event)"
style=
"align-content: center"
>
<img
ng-if=
":locale:$root.settings.locale.country"
ng-src=
"https://www.countryflags.io/{{:locale:$root.settings.locale.country}}/shiny/32.png"
>
<span
ng-if=
":locale:!$root.settings.locale.country"
>
{{:locale:$root.settings.locale.label}}
</span>
<small
class=
"ion-arrow-down-b"
></small>
</button>
</ion-nav-buttons>
<ion-content
class=
"has-header text-center no-padding-xs positive-900-bg circle-bg-dark"
>
...
...
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