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
fd54b060
Commit
fd54b060
authored
Oct 04, 2013
by
Julia Hansbrough
Committed by
Brian Wilson
Oct 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added self to authors style, changed GET to POST
parent
c7d4270a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
8 deletions
+23
-8
common/djangoapps/terrain/course_helpers.py
+14
-0
lms/djangoapps/instructor/tests/test_email.py
+0
-1
lms/djangoapps/instructor/views/api.py
+5
-5
lms/static/sass/course/instructor/_instructor_2.scss
+4
-1
lms/templates/instructor/instructor_dashboard_2/send_email.html
+0
-1
No files found.
common/djangoapps/terrain/course_helpers.py
View file @
fd54b060
...
...
@@ -63,6 +63,20 @@ def add_to_course_staff(username, course_num):
user
=
User
.
objects
.
get
(
username
=
username
)
user
.
groups
.
add
(
group
)
@world.absorb
def
add_to_course_staff
(
username
,
course_num
):
"""
Add the user with `username` to the course staff group
for `course_num`.
"""
# Based on code in lms/djangoapps/courseware/access.py
group_name
=
"instructor_{}"
.
format
(
course_num
)
group
,
_
=
Group
.
objects
.
get_or_create
(
name
=
group_name
)
group
.
save
()
user
=
User
.
objects
.
get
(
username
=
username
)
user
.
groups
.
add
(
group
)
@world.absorb
def
clear_courses
():
...
...
lms/djangoapps/instructor/tests/test_email.py
View file @
fd54b060
...
...
@@ -54,7 +54,6 @@ class TestInstructorDashboardEmailView(ModuleStoreTestCase):
# Enabled and IS mongo
@patch.dict
(
settings
.
MITX_FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
})
def
test_email_flag_true
(
self
):
from
nose.tools
import
set_trace
;
set_trace
()
# Assert that the URL for the email view is in the response
response
=
self
.
client
.
get
(
self
.
url
)
self
.
assertTrue
(
self
.
email_link
in
response
.
content
)
...
...
lms/djangoapps/instructor/views/api.py
View file @
fd54b060
...
...
@@ -749,19 +749,19 @@ def list_forum_members(request, course_id):
@ensure_csrf_cookie
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
@require_level
(
'staff'
)
@require_
query
_params
(
send_to
=
"sending to whom"
,
subject
=
"subject line"
,
message
=
"message text"
)
@require_
post
_params
(
send_to
=
"sending to whom"
,
subject
=
"subject line"
,
message
=
"message text"
)
def
send_email
(
request
,
course_id
):
"""
Send an email to self, staff, or everyone involved in a course.
Query Param
a
ters:
Query Param
e
ters:
- 'send_to' specifies what group the email should be sent to
- 'subject' specifies email's subject
- 'message' specifies email's content
"""
course
=
get_course_by_id
(
course_id
)
send_to
=
request
.
GE
T
.
get
(
"send_to"
)
subject
=
request
.
GE
T
.
get
(
"subject"
)
message
=
request
.
GE
T
.
get
(
"message"
)
send_to
=
request
.
POS
T
.
get
(
"send_to"
)
subject
=
request
.
POS
T
.
get
(
"subject"
)
message
=
request
.
POS
T
.
get
(
"message"
)
text_message
=
html_to_text
(
message
)
email
=
CourseEmail
(
course_id
=
course_id
,
...
...
lms/static/sass/course/instructor/_instructor_2.scss
View file @
fd54b060
...
...
@@ -265,10 +265,13 @@ section.instructor-dashboard-content-2 {
margin-bottom
:
20px
;
font-weight
:
600
;
color
:
green
;
.copy
{
font-weight
:
600
;
}
}
.msg-confirm
{
border-top
:
2px
solid
green
;
background
:
tint
(
green
,
90%
);
display
:
none
;
}
...
...
lms/templates/instructor/instructor_dashboard_2/send_email.html
View file @
fd54b060
...
...
@@ -45,6 +45,5 @@
</ul>
</div>
<input
type=
"button"
name=
"send"
value=
"${_("
Send
Email
")}"
data-endpoint=
"${ section_data['send_email'] }"
>
<input
type=
"button"
name=
"send"
value=
"${_("
Send
")}"
data-endpoint=
"${ section_data['send_email'] }"
>
<div
class=
"request-response-error"
></div>
</div>
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