Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
knowledgebase-front
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Applications
Knowledge Base
knowledgebase-front
Commits
80b040b1
Commit
80b040b1
authored
5 years ago
by
Alice Poggioli
Browse files
Options
Downloads
Patches
Plain Diff
Bug: Adapt js to a second logout button in entrepreneur account.
parent
3cdd40fa
No related branches found
Branches containing commit
No related tags found
1 merge request
!29
Feature/entrepreneur account
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/includes/entrepreneur/profile/detail.pug
+1
-1
1 addition, 1 deletion
src/includes/entrepreneur/profile/detail.pug
src/includes/mentor/profile/detail.pug
+1
-1
1 addition, 1 deletion
src/includes/mentor/profile/detail.pug
src/scripts/coopstarter.js
+58
-49
58 additions, 49 deletions
src/scripts/coopstarter.js
with
60 additions
and
51 deletions
src/includes/entrepreneur/profile/detail.pug
+
1
−
1
View file @
80b040b1
...
@@ -19,7 +19,7 @@ div.block_list.flex
...
@@ -19,7 +19,7 @@ div.block_list.flex
div.button_base.ico_gauche.ico_search Back to dashboard
div.button_base.ico_gauche.ico_search Back to dashboard
div.dashboard__database
div.dashboard__database
div
#
logout-button.button_base(
div
.
logout-button.button_base(
role='log out'
role='log out'
) Logout
) Logout
...
...
This diff is collapsed.
Click to expand it.
src/includes/mentor/profile/detail.pug
+
1
−
1
View file @
80b040b1
...
@@ -19,7 +19,7 @@ div.block_list.flex
...
@@ -19,7 +19,7 @@ div.block_list.flex
div.button_base.ico_gauche.ico_search Back to dashboard
div.button_base.ico_gauche.ico_search Back to dashboard
div.dashboard__database
div.dashboard__database
div
#
logout-button.button_base(
div
.
logout-button.button_base(
role='log out'
role='log out'
) Logout
) Logout
...
...
This diff is collapsed.
Click to expand it.
src/scripts/coopstarter.js
+
58
−
49
View file @
80b040b1
function
openTab
(
pageName
,
elmnt
)
{
function
openTab
(
pageName
,
elmnt
)
{
// Hide all elements with class="tabcontent" by default */
// Hide all elements with class="tabcontent" by default */
var
i
,
tabcontent
,
tablinks
;
var
i
,
tabcontent
,
tablinks
;
tabcontent
=
document
.
getElementsByClassName
(
"
tabcontent
"
);
tabcontent
=
document
.
getElementsByClassName
(
"
tabcontent
"
);
tablinks
=
document
.
getElementsByClassName
(
"
tablink
"
);
tablinks
=
document
.
getElementsByClassName
(
"
tablink
"
);
for
(
i
=
0
;
i
<
tabcontent
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
tabcontent
.
length
;
i
++
)
{
tabcontent
[
i
].
style
.
display
=
"
none
"
;
tabcontent
[
i
].
style
.
display
=
"
none
"
;
tablinks
[
i
].
classList
.
remove
(
"
active
"
);
tablinks
[
i
].
classList
.
remove
(
"
active
"
);
}
}
// Show the specific tab content
// Show the specific tab content
document
.
getElementById
(
pageName
).
style
.
display
=
"
block
"
;
document
.
getElementById
(
pageName
).
style
.
display
=
"
block
"
;
elmnt
.
classList
.
add
(
"
active
"
);
elmnt
.
classList
.
add
(
"
active
"
);
}
}
function
linkDatasetToField
(
detail
,
targetFormName
,
inputName
)
{
function
linkDatasetToField
(
detail
,
targetFormName
,
inputName
)
{
let
targetForm
=
document
.
getElementById
(
targetFormName
);
let
targetForm
=
document
.
getElementById
(
targetFormName
);
targetForm
.
addEventListener
(
"
populate
"
,
event
=>
{
targetForm
.
addEventListener
(
"
populate
"
,
event
=>
{
let
resourceField
=
targetForm
.
querySelector
(
`input[name="
${
inputName
}
"]`
);
let
resourceField
=
targetForm
.
querySelector
(
`input[name="
${
inputName
}
"]`
);
if
(
resourceField
)
{
if
(
resourceField
)
{
resourceField
.
value
=
JSON
.
stringify
({
'
@id
'
:
detail
.
dataset
.
src
});
resourceField
.
value
=
JSON
.
stringify
({
"
@id
"
:
detail
.
dataset
.
src
});
resourceField
.
setAttribute
(
'
value
'
,
JSON
.
stringify
({
'
@id
'
:
detail
.
dataset
.
src
}));
resourceField
.
setAttribute
(
}
"
value
"
,
});
JSON
.
stringify
({
"
@id
"
:
detail
.
dataset
.
src
})
);
}
});
}
}
function
refreshList
(
formId
,
listId
)
{
function
refreshList
(
formId
,
listId
)
{
let
form
=
document
.
getElementById
(
formId
);
let
form
=
document
.
getElementById
(
formId
);
form
.
addEventListener
(
"
save
"
,
event
=>
{
form
.
addEventListener
(
"
save
"
,
event
=>
{
let
list
=
document
.
getElementById
(
listId
);
let
list
=
document
.
getElementById
(
listId
);
list
.
dataset
.
src
=
list
.
dataset
.
src
;
list
.
dataset
.
src
=
list
.
dataset
.
src
;
});
});
}
}
jQuery
(
document
).
ready
(
function
(
$
)
{
jQuery
(
document
).
ready
(
function
(
$
)
{
// Get the element with id="defaultOpen" and click on it
// Get the element with id="defaultOpen" and click on it
document
.
getElementById
(
"
defaultOpen
"
).
click
();
document
.
getElementById
(
"
defaultOpen
"
).
click
();
let
userAccountDataSrc
=
document
.
getElementById
(
"
user-account-picture
"
);
let
userAccountDataSrc
=
document
.
getElementById
(
"
user-account-picture
"
);
linkDatasetToField
(
userAccountDataSrc
,
'
validation-form
'
,
'
reviewer
'
);
linkDatasetToField
(
userAccountDataSrc
,
"
validation-form
"
,
"
reviewer
"
);
linkDatasetToField
(
userAccountDataSrc
,
'
improvement-dialog-form
'
,
'
reviewer
'
);
linkDatasetToField
(
userAccountDataSrc
,
"
improvement-dialog-form
"
,
"
reviewer
"
);
linkDatasetToField
(
userAccountDataSrc
,
'
refusal-dialog-form
'
,
'
reviewer
'
);
linkDatasetToField
(
userAccountDataSrc
,
"
refusal-dialog-form
"
,
"
reviewer
"
);
refreshList
(
"
resource-creation-form
"
,
"
resources-history
"
);
refreshList
(
"
resource-creation-form
"
,
"
resources-history
"
);
refreshList
(
"
validation-form
"
,
"
pending-resources
"
);
refreshList
(
"
validation-form
"
,
"
pending-resources
"
);
refreshList
(
"
refusal-dialog-form
"
,
"
pending-resources
"
);
refreshList
(
"
refusal-dialog-form
"
,
"
pending-resources
"
);
refreshList
(
"
improvement-dialog-form
"
,
"
pending-resources
"
);
refreshList
(
"
improvement-dialog-form
"
,
"
pending-resources
"
);
const
logoutButton
=
document
.
getElementById
(
'
logout-button
'
);
const
logoutButtons
=
document
.
getElementsByClassName
(
"
logout-button
"
);
logoutButton
.
addEventListener
(
'
click
'
,
function
()
{
for
(
var
i
=
0
;
i
<
logoutButtons
.
length
;
i
++
)
{
window
.
dispatchEvent
(
logoutButtons
[
i
].
addEventListener
(
"
click
"
,
function
()
{
new
CustomEvent
(
'
requestNavigation
'
,
{
detail
:
{
route
:
'
splash-index
'
}
})
window
.
dispatchEvent
(
);
new
CustomEvent
(
"
requestNavigation
"
,
{
document
.
querySelector
(
'
sib-auth
'
).
logout
();
detail
:
{
route
:
"
splash-index
"
}
setTimeout
(
function
(){
location
.
reload
();
},
1000
);
})
})
);
});
document
.
querySelector
(
"
sib-auth
"
).
logout
();
\ No newline at end of file
setTimeout
(
function
()
{
location
.
reload
();
},
1000
);
});
}
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment