Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Sith
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
59
Issues
59
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AE
Sith
Commits
6fce2711
Commit
6fce2711
authored
Oct 21, 2019
by
tleb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
/pedagogy/uv/create use quick notif
parent
53a76337
Pipeline
#2115
passed with stage
in 51 minutes and 23 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
core/static/core/js/script.js
core/static/core/js/script.js
+9
-2
pedagogy/templates/pedagogy/uv_create.jinja
pedagogy/templates/pedagogy/uv_create.jinja
+3
-3
No files found.
core/static/core/js/script.js
View file @
6fce2711
...
...
@@ -38,7 +38,14 @@ $( function() {
$
(
"
#quick_notif li
"
).
click
(
function
()
{
$
(
this
).
hide
();
})
}
);
});
function
createQuickNotif
(
msg
)
{
const
el
=
document
.
createElement
(
'
li
'
)
el
.
textContent
=
msg
el
.
addEventListener
(
'
click
'
,
()
=>
el
.
parentNode
.
removeChild
(
el
))
document
.
getElementById
(
'
quick_notif
'
).
appendChild
(
el
)
}
function
display_notif
()
{
$
(
'
#header_notif
'
).
toggle
().
parent
().
toggleClass
(
"
white
"
);
...
...
@@ -52,4 +59,4 @@ function display_notif() {
// https://docs.djangoproject.com/en/2.0/ref/csrf/#acquiring-the-token-if-csrf-use-sessions-is-true
function
getCSRFToken
()
{
return
$
(
"
[name=csrfmiddlewaretoken]
"
).
val
();
}
\ No newline at end of file
}
pedagogy/templates/pedagogy/uv_create.jinja
View file @
6fce2711
...
...
@@ -58,7 +58,7 @@
url
:
url
,
success
:
function
(
data
,
_
,
xhr
)
{
if
(
xhr
.
status
!=
200
)
{
alert
(
"
{%
trans
%}
Unknown UV code
{%
endtrans
%}
"
)
createQuickNotif
(
"
{%
trans
%}
Unknown UV code
{%
endtrans
%}
"
)
return
}
for
(
let
key
in
data
)
{
...
...
@@ -73,10 +73,10 @@
}
}
alert
(
'
{%
trans
%}
Successful autocomplete
{%
endtrans
%}
'
)
createQuickNotif
(
'
{%
trans
%}
Successful autocomplete
{%
endtrans
%}
'
)
},
error
:
function
(
_
,
_
,
statusMessage
)
{
alert
(
'
{%
trans
%}
An error occured:
{%
endtrans
%}
'
+
statusMessage
)
createQuickNotif
(
'
{%
trans
%}
An error occured:
{%
endtrans
%}
'
+
statusMessage
)
},
})
})
...
...
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