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
23460730
Commit
23460730
authored
Jul 18, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #201 from MITx/mm-registered
Display registered when already registered for a course.
parents
cae5c99e
44e8d747
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
lms/djangoapps/courseware/views.py
+8
-3
lms/static/sass/_course_about.scss
+14
-0
lms/templates/portal/course_about.html
+5
-1
No files found.
lms/djangoapps/courseware/views.py
View file @
23460730
...
...
@@ -250,12 +250,17 @@ def course_info(request, course_id):
course
=
check_course
(
course_id
)
return
render_to_response
(
'info.html'
,
{
'course'
:
course
})
@ensure_csrf_cookie
def
course_about
(
request
,
course_id
):
def
registered_for_course
(
course
,
user
):
if
user
.
is_authenticated
():
return
CourseEnrollment
.
objects
.
filter
(
user
=
user
,
course_id
=
course
.
id
)
.
exists
()
else
:
return
False
course
=
check_course
(
course_id
,
course_must_be_open
=
False
)
return
render_to_response
(
'portal/course_about.html'
,
{
'course'
:
course
})
registered
=
registered_for_course
(
course
,
request
.
user
)
return
render_to_response
(
'portal/course_about.html'
,
{
'course'
:
course
,
'registered'
:
registered
})
@login_required
...
...
lms/static/sass/_course_about.scss
View file @
23460730
...
...
@@ -97,6 +97,20 @@
color
:
rgb
(
255
,
255
,
255
);
}
}
span
.register
{
@include
button
(
shiny
,
lighten
(
grayscale
(
$blue
)
,
50%
));
@include
box-sizing
(
border-box
);
@include
border-radius
(
3px
);
color
:
#888
;
display
:
block
;
font
:
normal
1
.2rem
/
1
.6rem
$sans-serif
;
letter-spacing
:
1px
;
padding
:
10px
0px
;
text-transform
:
uppercase
;
text-align
:
center
;
width
:
flex-grid
(
12
);
}
}
}
...
...
lms/templates/portal/course_about.html
View file @
23460730
...
...
@@ -16,7 +16,11 @@
<div
class=
"main-cta"
>
%if user.is_authenticated():
<a
href=
"${reverse('enroll', args=[course.id])}"
class=
"register"
>
Register
</a>
%if registered:
<span
class=
"register disabled"
>
Registered
</span>
%else:
<a
href=
"${reverse('enroll', args=[course.id])}"
class=
"register"
>
Register
</a>
%endif
%else:
<a
href=
"#signup-modal"
class=
"register"
rel=
"leanModal"
data-notice=
"You must register in order to enroll"
>
Register
</a>
%endif
...
...
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