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
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
div.button_base.ico_gauche.ico_search Back to dashboard
div.dashboard__database
div
#
logout-button.button_base(
div
.
logout-button.button_base(
role='log out'
) 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
div.button_base.ico_gauche.ico_search Back to dashboard
div.dashboard__database
div
#
logout-button.button_base(
div
.
logout-button.button_base(
role='log out'
) Logout
...
...
This diff is collapsed.
Click to expand it.
src/scripts/coopstarter.js
+
58
−
49
View file @
80b040b1
function
openTab
(
pageName
,
elmnt
)
{
// Hide all elements with class="tabcontent" by default */
var
i
,
tabcontent
,
tablinks
;
tabcontent
=
document
.
getElementsByClassName
(
"
tabcontent
"
);
tablinks
=
document
.
getElementsByClassName
(
"
tablink
"
);
for
(
i
=
0
;
i
<
tabcontent
.
length
;
i
++
)
{
tabcontent
[
i
].
style
.
display
=
"
none
"
;
tablinks
[
i
].
classList
.
remove
(
"
active
"
);
}
// Show the specific tab content
document
.
getElementById
(
pageName
).
style
.
display
=
"
block
"
;
elmnt
.
classList
.
add
(
"
active
"
);
// Hide all elements with class="tabcontent" by default */
var
i
,
tabcontent
,
tablinks
;
tabcontent
=
document
.
getElementsByClassName
(
"
tabcontent
"
);
tablinks
=
document
.
getElementsByClassName
(
"
tablink
"
);
for
(
i
=
0
;
i
<
tabcontent
.
length
;
i
++
)
{
tabcontent
[
i
].
style
.
display
=
"
none
"
;
tablinks
[
i
].
classList
.
remove
(
"
active
"
);
}
// Show the specific tab content
document
.
getElementById
(
pageName
).
style
.
display
=
"
block
"
;
elmnt
.
classList
.
add
(
"
active
"
);
}
function
linkDatasetToField
(
detail
,
targetFormName
,
inputName
)
{
let
targetForm
=
document
.
getElementById
(
targetFormName
);
targetForm
.
addEventListener
(
"
populate
"
,
event
=>
{
let
resourceField
=
targetForm
.
querySelector
(
`input[name="
${
inputName
}
"]`
);
if
(
resourceField
)
{
resourceField
.
value
=
JSON
.
stringify
({
'
@id
'
:
detail
.
dataset
.
src
});
resourceField
.
setAttribute
(
'
value
'
,
JSON
.
stringify
({
'
@id
'
:
detail
.
dataset
.
src
}));
}
});
let
targetForm
=
document
.
getElementById
(
targetFormName
);
targetForm
.
addEventListener
(
"
populate
"
,
event
=>
{
let
resourceField
=
targetForm
.
querySelector
(
`input[name="
${
inputName
}
"]`
);
if
(
resourceField
)
{
resourceField
.
value
=
JSON
.
stringify
({
"
@id
"
:
detail
.
dataset
.
src
});
resourceField
.
setAttribute
(
"
value
"
,
JSON
.
stringify
({
"
@id
"
:
detail
.
dataset
.
src
})
);
}
});
}
function
refreshList
(
formId
,
listId
)
{
let
form
=
document
.
getElementById
(
formId
);
form
.
addEventListener
(
"
save
"
,
event
=>
{
let
list
=
document
.
getElementById
(
listId
);
list
.
dataset
.
src
=
list
.
dataset
.
src
;
});
let
form
=
document
.
getElementById
(
formId
);
form
.
addEventListener
(
"
save
"
,
event
=>
{
let
list
=
document
.
getElementById
(
listId
);
list
.
dataset
.
src
=
list
.
dataset
.
src
;
});
}
jQuery
(
document
).
ready
(
function
(
$
)
{
// Get the element with id="defaultOpen" and click on it
document
.
getElementById
(
"
defaultOpen
"
).
click
();
let
userAccountDataSrc
=
document
.
getElementById
(
"
user-account-picture
"
);
linkDatasetToField
(
userAccountDataSrc
,
'
validation-form
'
,
'
reviewer
'
);
linkDatasetToField
(
userAccountDataSrc
,
'
improvement-dialog-form
'
,
'
reviewer
'
);
linkDatasetToField
(
userAccountDataSrc
,
'
refusal-dialog-form
'
,
'
reviewer
'
);
refreshList
(
"
resource-creation-form
"
,
"
resources-history
"
);
refreshList
(
"
validation-form
"
,
"
pending-resources
"
);
refreshList
(
"
refusal-dialog-form
"
,
"
pending-resources
"
);
refreshList
(
"
improvement-dialog-form
"
,
"
pending-resources
"
);
const
logoutButton
=
document
.
getElementById
(
'
logout-button
'
);
logoutButton
.
addEventListener
(
'
click
'
,
function
()
{
window
.
dispatchEvent
(
new
CustomEvent
(
'
requestNavigation
'
,
{
detail
:
{
route
:
'
splash-index
'
}
})
);
document
.
querySelector
(
'
sib-auth
'
).
logout
();
setTimeout
(
function
(){
location
.
reload
();
},
1000
);
})
});
\ No newline at end of file
jQuery
(
document
).
ready
(
function
(
$
)
{
// Get the element with id="defaultOpen" and click on it
document
.
getElementById
(
"
defaultOpen
"
).
click
();
let
userAccountDataSrc
=
document
.
getElementById
(
"
user-account-picture
"
);
linkDatasetToField
(
userAccountDataSrc
,
"
validation-form
"
,
"
reviewer
"
);
linkDatasetToField
(
userAccountDataSrc
,
"
improvement-dialog-form
"
,
"
reviewer
"
);
linkDatasetToField
(
userAccountDataSrc
,
"
refusal-dialog-form
"
,
"
reviewer
"
);
refreshList
(
"
resource-creation-form
"
,
"
resources-history
"
);
refreshList
(
"
validation-form
"
,
"
pending-resources
"
);
refreshList
(
"
refusal-dialog-form
"
,
"
pending-resources
"
);
refreshList
(
"
improvement-dialog-form
"
,
"
pending-resources
"
);
const
logoutButtons
=
document
.
getElementsByClassName
(
"
logout-button
"
);
for
(
var
i
=
0
;
i
<
logoutButtons
.
length
;
i
++
)
{
logoutButtons
[
i
].
addEventListener
(
"
click
"
,
function
()
{
window
.
dispatchEvent
(
new
CustomEvent
(
"
requestNavigation
"
,
{
detail
:
{
route
:
"
splash-index
"
}
})
);
document
.
querySelector
(
"
sib-auth
"
).
logout
();
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