Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
61fea82d
Commit
61fea82d
authored
12 years ago
by
David Ormsbee
Browse files
Options
Downloads
Plain Diff
Merge pull request #214 from MITx/mm-course-columns
Display courses in university related columns.
parents
48ff2c9c
a64ddc77
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
common/djangoapps/student/views.py
+13
-5
13 additions, 5 deletions
common/djangoapps/student/views.py
lms/static/sass/shared/_course_object.scss
+11
-6
11 additions, 6 deletions
lms/static/sass/shared/_course_object.scss
lms/templates/index.html
+15
-3
15 additions, 3 deletions
lms/templates/index.html
with
39 additions
and
14 deletions
common/djangoapps/student/views.py
+
13
−
5
View file @
61fea82d
...
...
@@ -7,6 +7,7 @@ import sys
import
uuid
import
feedparser
import
urllib
import
itertools
from
django.conf
import
settings
from
django.contrib.auth
import
logout
,
authenticate
,
login
...
...
@@ -49,8 +50,13 @@ def csrf_token(context):
@ensure_csrf_cookie
@cache_if_anonymous
def
index
(
request
):
'''
Redirects to main page -- info page if user authenticated, or marketing if not
'''
if
settings
.
COURSEWARE_ENABLED
and
request
.
user
.
is_authenticated
():
return
redirect
(
reverse
(
'
dashboard
'
))
feed_data
=
cache
.
get
(
"
students_index_rss_feed_data
"
)
if
feed_data
==
None
:
if
hasattr
(
settings
,
'
RSS_URL
'
):
...
...
@@ -65,11 +71,13 @@ def index(request):
soup
=
BeautifulSoup
(
entry
.
description
)
entry
.
image
=
soup
.
img
[
'
src
'
]
if
soup
.
img
else
None
if
settings
.
COURSEWARE_ENABLED
and
request
.
user
.
is_authenticated
():
return
redirect
(
reverse
(
'
dashboard
'
))
else
:
# TODO: Clean up how 'error' is done.
return
render_to_response
(
'
index.html
'
,
{
'
courses
'
:
modulestore
().
get_courses
(),
'
entries
'
:
entries
})
courses
=
modulestore
().
get_courses
()
universities
=
dict
()
for
university
,
group
in
itertools
.
groupby
(
courses
,
lambda
course
:
course
.
org
):
universities
.
setdefault
(
university
,
[])
[
universities
[
university
].
append
(
course
)
for
course
in
group
]
return
render_to_response
(
'
index.html
'
,
{
'
universities
'
:
universities
,
'
entries
'
:
entries
})
@login_required
...
...
This diff is collapsed.
Click to expand it.
lms/static/sass/shared/_course_object.scss
+
11
−
6
View file @
61fea82d
...
...
@@ -3,22 +3,27 @@
@include
clearfix
;
padding
:
40px
0px
15px
;
.university-column
{
width
:
flex-grid
(
4
);
margin-right
:
flex-gutter
();
float
:
left
;
&
:nth-child
(
3n
+
3
)
{
margin-right
:
0
;
}
}
.course
{
background
:
rgb
(
250
,
250
,
250
);
border
:
1px
solid
rgb
(
180
,
180
,
180
);
@include
border-radius
(
2px
);
@include
box-sizing
(
border-box
);
@include
box-shadow
(
0
1px
10px
0
rgba
(
0
,
0
,
0
,
0
.15
)
,
inset
0
0
0
1px
rgba
(
255
,
255
,
255
,
0
.9
));
float
:
left
;
margin-right
:
flex-gutter
();
margin-bottom
:
30px
;
position
:
relative
;
width
:
flex-grid
(
4
)
;
width
:
100%
;
@include
transition
(
all
,
0
.15s
,
linear
);
&
:nth-child
(
3n
+
3
)
{
margin-right
:
0
;
}
.meta-info
{
background
:
rgba
(
0
,
0
,
0
,
0
.6
);
...
...
This diff is collapsed.
Click to expand it.
lms/templates/index.html
+
15
−
3
View file @
61fea82d
...
...
@@ -78,9 +78,21 @@
</section>
<section
class=
"courses"
>
%for course in courses:
<
%
include
file=
"course.html"
args=
"course=course"
/>
%endfor
<section
class=
'university-column'
>
%for course in universities['MITx']:
<
%
include
file=
"course.html"
args=
"course=course"
/>
%endfor
</section>
<section
class=
'university-column'
>
%for course in universities['HarvardX']:
<
%
include
file=
"course.html"
args=
"course=course"
/>
%endfor
</section>
<section
class=
'university-column'
>
%for course in universities['BerkeleyX']:
<
%
include
file=
"course.html"
args=
"course=course"
/>
%endfor
</section>
</section>
</section>
</section>
...
...
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