Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
16720f51
Commit
16720f51
authored
Oct 15, 2012
by
chrisndodge
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #911 from MITx/feature/tomg/cas-import-progress
polished import progress bar
parents
60d431aa
500738d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
7 deletions
+38
-7
cms/static/sass/_import.scss
+25
-0
cms/templates/import.html
+13
-7
No files found.
cms/static/sass/_import.scss
View file @
16720f51
...
...
@@ -67,4 +67,28 @@
white-space
:
normal
;
}
}
.progress-bar
{
display
:
none
;
width
:
350px
;
height
:
30px
;
margin
:
30px
auto
10px
;
border
:
1px
solid
$blue
;
&
.loaded
{
border-color
:
#66b93d
;
.progress-fill
{
background
:
#66b93d
;
}
}
}
.progress-fill
{
width
:
0%
;
height
:
30px
;
background
:
$blue
;
color
:
#fff
;
line-height
:
48px
;
}
}
\ No newline at end of file
cms/templates/import.html
View file @
16720f51
...
...
@@ -23,9 +23,9 @@
<p
class=
"file-name-block"
><span
class=
"file-name"
></span><a
href=
"#"
class=
"choose-file-button-inline"
>
change
</a></p>
<input
type=
"file"
name=
"course-data"
class=
"file-input"
>
<input
type=
"submit"
value=
"Replace my course with the one above"
class=
"submit-button"
>
<div
class=
"progress
"
style=
"position:relative; margin-top:5px; width:250px; height:15px; border: 1px solid #ddd; padding: 1px; border-radius: 3px; display:none;
"
>
<div
class=
"
bar"
style=
"background-color: #B4F5B4; width:0%; height:10px; border-radius: 3px;
"
></div>
<div
class=
"percent"
style=
"margin-top:5px;"
>
0%
</div>
<div
class=
"progress
-bar
"
>
<div
class=
"
progress-fill
"
></div>
<div
class=
"percent"
>
0%
</div>
</div>
</form>
</article>
...
...
@@ -37,29 +37,35 @@
<script>
(
function
()
{
var
bar
=
$
(
'.bar'
);
var
bar
=
$
(
'.progress-bar'
);
var
fill
=
$
(
'.progress-fill'
);
var
percent
=
$
(
'.percent'
);
var
status
=
$
(
'#status'
);
var
submitBtn
=
$
(
'.submit-button'
);
$
(
'form'
).
ajaxForm
({
beforeSend
:
function
()
{
status
.
empty
();
var
percentVal
=
'0%'
;
bar
.
width
(
percentVal
)
bar
.
show
();
fill
.
width
(
percentVal
);
percent
.
html
(
percentVal
);
submitBtn
.
hide
();
},
uploadProgress
:
function
(
event
,
position
,
total
,
percentComplete
)
{
var
percentVal
=
percentComplete
+
'%'
;
bar
.
width
(
percentVal
)
fill
.
width
(
percentVal
);
percent
.
html
(
percentVal
);
},
complete
:
function
(
xhr
)
{
if
(
xhr
.
status
==
200
)
{
alert
(
'Your import
has been
successful.'
);
alert
(
'Your import
was
successful.'
);
window
.
location
=
'${successful_import_redirect_url}'
;
}
else
alert
(
'Your import has failed.
\
n
\
n'
+
xhr
.
responseText
);
submitBtn
.
show
();
bar
.
hide
();
}
});
})();
...
...
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