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
91dcef7f
Commit
91dcef7f
authored
Sep 02, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add gitreload to instructor dashboard
parent
4341ea76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
lms/djangoapps/instructor/views.py
+14
-2
lms/templates/courseware/instructor_dashboard.html
+2
-1
No files found.
lms/djangoapps/instructor/views.py
View file @
91dcef7f
# ======== Instructor views =============================================================================
# ======== Instructor views =============================================================================
import
csv
import
csv
import
itertools
import
json
import
json
import
logging
import
logging
import
os
import
urllib
import
urllib
import
itertools
from
functools
import
partial
from
functools
import
partial
from
collections
import
defaultdict
from
collections
import
defaultdict
...
@@ -85,7 +86,18 @@ def instructor_dashboard(request, course_id):
...
@@ -85,7 +86,18 @@ def instructor_dashboard(request, course_id):
# process actions from form POST
# process actions from form POST
action
=
request
.
POST
.
get
(
'action'
,
''
)
action
=
request
.
POST
.
get
(
'action'
,
''
)
if
'Reload'
in
action
:
if
'GIT pull'
in
action
:
data_dir
=
course
.
metadata
[
'data_dir'
]
log
.
debug
(
'git pull
%
s'
%
(
data_dir
))
gdir
=
settings
.
DATA_DIR
/
data_dir
if
not
os
.
path
.
exists
(
gdir
):
msg
+=
"====> ERROR in gitreload - no such directory
%
s"
%
gdir
else
:
cmd
=
"cd
%
s; git reset --hard HEAD; git clean -f -d; git pull origin; chmod g+w course.xml"
%
gdir
msg
+=
"git pull on
%
s:<p>"
%
data_dir
msg
+=
"<pre>
%
s</pre></p>"
%
escape
(
os
.
popen
(
cmd
)
.
read
())
if
'Reload course'
in
action
:
log
.
debug
(
'reloading
%
s (
%
s)'
%
(
course_id
,
course
))
log
.
debug
(
'reloading
%
s (
%
s)'
%
(
course_id
,
course
))
try
:
try
:
data_dir
=
course
.
metadata
[
'data_dir'
]
data_dir
=
course
.
metadata
[
'data_dir'
]
...
...
lms/templates/courseware/instructor_dashboard.html
View file @
91dcef7f
...
@@ -70,7 +70,8 @@ table.stat_table td {
...
@@ -70,7 +70,8 @@ table.stat_table td {
%if admin_access:
%if admin_access:
<p>
<p>
<input
type=
"submit"
name=
"action"
value=
"Reload course from XML files"
>
<input
type=
"submit"
name=
"action"
value=
"Reload course from XML files"
>
<input
type=
"submit"
name=
"action"
value=
"GIT pull and Reload course"
>
%endif
%endif
</form>
</form>
...
...
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