Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Administrator
m4lab_landing_page
Commits
1ec3f07f
Commit
1ec3f07f
authored
5 years ago
by
Wolfgang Knopki
Browse files
Options
Download
Email Patches
Plain Diff
user profile fetch / change login button
parent
1f23ea54
Pipeline
#367
passed with stage
in 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/headfoot.js
+4
-6
js/headfoot.js
with
4 additions
and
6 deletions
+4
-6
js/headfoot.js
+
4
-
6
View file @
1ec3f07f
...
@@ -25,13 +25,14 @@ function userAuthenticated(){
...
@@ -25,13 +25,14 @@ function userAuthenticated(){
var
user
=
false
;
var
user
=
false
;
function
profileExists
(){
function
profileExists
SetLogin
(){
$
.
get
(
"
/api/v1/profile
"
,
function
(
data
)
{
$
.
get
(
"
/api/v1/profile
"
,
function
(
data
)
{
let
email
=
data
.
email
let
email
=
data
.
email
if
(
email
!=
''
){
if
(
email
!=
''
){
user
=
true
;
user
=
true
;
document
.
getElementById
(
"
navbarDropdown4
"
).
innerHTML
=
"
Logout
"
;
document
.
getElementById
(
"
navbarDropdown4
"
).
href
=
"
/account/logout
"
;
}
}
})
})
.
done
(
function
()
{
.
done
(
function
()
{
...
@@ -149,10 +150,6 @@ function head(){
...
@@ -149,10 +150,6 @@ function head(){
headlink
.
innerHTML
=
"
Account
"
;
headlink
.
innerHTML
=
"
Account
"
;
headlink
.
href
=
"
/account/
"
;
headlink
.
href
=
"
/account/
"
;
}
}
if
(
profileExists
()){
//user has priority
headlink
.
innerHTML
=
"
Logout
"
;
headlink
.
href
=
"
/account/logout
"
;
}
headlink
.
classList
.
remove
(
"
nav-link
"
);
headlink
.
classList
.
remove
(
"
nav-link
"
);
headlink
.
classList
.
add
(
"
btn
"
);
headlink
.
classList
.
add
(
"
btn
"
);
headlink
.
classList
.
add
(
"
btn-outline-dark
"
);
headlink
.
classList
.
add
(
"
btn-outline-dark
"
);
...
@@ -160,6 +157,7 @@ function head(){
...
@@ -160,6 +157,7 @@ function head(){
headitem
.
appendChild
(
headlink
);
headitem
.
appendChild
(
headlink
);
navelements
.
appendChild
(
headitem
);
navelements
.
appendChild
(
headitem
);
}
}
profileExistsSetLogin
()
//user has priority
let
searchitem
=
document
.
createElement
(
'
li
'
);
let
searchitem
=
document
.
createElement
(
'
li
'
);
searchitem
.
classList
.
add
(
"
nav-item
"
);
searchitem
.
classList
.
add
(
"
nav-item
"
);
let
searchinput
=
document
.
createElement
(
'
input
'
);
let
searchinput
=
document
.
createElement
(
'
input
'
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets