Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Hsin-Yu Chien
edx-platform-release
Commits
91dcef7f
Commit
91dcef7f
authored
12 years ago
by
ichuang
Browse files
Options
Downloads
Patches
Plain Diff
add gitreload to instructor dashboard
parent
4341ea76
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/instructor/views.py
+14
-2
14 additions, 2 deletions
lms/djangoapps/instructor/views.py
lms/templates/courseware/instructor_dashboard.html
+2
-1
2 additions, 1 deletion
lms/templates/courseware/instructor_dashboard.html
with
16 additions
and
3 deletions
lms/djangoapps/instructor/views.py
+
14
−
2
View file @
91dcef7f
# ======== Instructor views =============================================================================
import
csv
import
itertools
import
json
import
logging
import
os
import
urllib
import
itertools
from
functools
import
partial
from
collections
import
defaultdict
...
...
@@ -85,7 +86,18 @@ def instructor_dashboard(request, course_id):
# process actions from form POST
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
))
try
:
data_dir
=
course
.
metadata
[
'
data_dir
'
]
...
...
This diff is collapsed.
Click to expand it.
lms/templates/courseware/instructor_dashboard.html
+
2
−
1
View file @
91dcef7f
...
...
@@ -70,7 +70,8 @@ table.stat_table td {
%if admin_access:
<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
</form>
...
...
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