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
a64ddc77
Commit
a64ddc77
authored
Jul 18, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display courses in university related columns.
parent
9ec8c993
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
14 deletions
+39
-14
common/djangoapps/student/views.py
+13
-5
lms/static/sass/shared/_course_object.scss
+11
-6
lms/templates/index.html
+15
-3
No files found.
common/djangoapps/student/views.py
View file @
a64ddc77
...
@@ -7,6 +7,7 @@ import sys
...
@@ -7,6 +7,7 @@ import sys
import
uuid
import
uuid
import
feedparser
import
feedparser
import
urllib
import
urllib
import
itertools
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib.auth
import
logout
,
authenticate
,
login
from
django.contrib.auth
import
logout
,
authenticate
,
login
...
@@ -49,8 +50,13 @@ def csrf_token(context):
...
@@ -49,8 +50,13 @@ def csrf_token(context):
@ensure_csrf_cookie
@ensure_csrf_cookie
@cache_if_anonymous
@cache_if_anonymous
def
index
(
request
):
def
index
(
request
):
''' Redirects to main page -- info page if user authenticated, or marketing if not
''' 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"
)
feed_data
=
cache
.
get
(
"students_index_rss_feed_data"
)
if
feed_data
==
None
:
if
feed_data
==
None
:
if
hasattr
(
settings
,
'RSS_URL'
):
if
hasattr
(
settings
,
'RSS_URL'
):
...
@@ -65,11 +71,13 @@ def index(request):
...
@@ -65,11 +71,13 @@ def index(request):
soup
=
BeautifulSoup
(
entry
.
description
)
soup
=
BeautifulSoup
(
entry
.
description
)
entry
.
image
=
soup
.
img
[
'src'
]
if
soup
.
img
else
None
entry
.
image
=
soup
.
img
[
'src'
]
if
soup
.
img
else
None
if
settings
.
COURSEWARE_ENABLED
and
request
.
user
.
is_authenticated
():
courses
=
modulestore
()
.
get_courses
()
return
redirect
(
reverse
(
'dashboard'
))
universities
=
dict
()
else
:
for
university
,
group
in
itertools
.
groupby
(
courses
,
lambda
course
:
course
.
org
):
# TODO: Clean up how 'error' is done.
universities
.
setdefault
(
university
,
[])
return
render_to_response
(
'index.html'
,
{
'courses'
:
modulestore
()
.
get_courses
(),
'entries'
:
entries
})
[
universities
[
university
]
.
append
(
course
)
for
course
in
group
]
return
render_to_response
(
'index.html'
,
{
'universities'
:
universities
,
'entries'
:
entries
})
@login_required
@login_required
...
...
lms/static/sass/shared/_course_object.scss
View file @
a64ddc77
...
@@ -3,22 +3,27 @@
...
@@ -3,22 +3,27 @@
@include
clearfix
;
@include
clearfix
;
padding
:
40px
0px
15px
;
padding
:
40px
0px
15px
;
.university-column
{
width
:
flex-grid
(
4
);
margin-right
:
flex-gutter
();
float
:
left
;
&
:nth-child
(
3n
+
3
)
{
margin-right
:
0
;
}
}
.course
{
.course
{
background
:
rgb
(
250
,
250
,
250
);
background
:
rgb
(
250
,
250
,
250
);
border
:
1px
solid
rgb
(
180
,
180
,
180
);
border
:
1px
solid
rgb
(
180
,
180
,
180
);
@include
border-radius
(
2px
);
@include
border-radius
(
2px
);
@include
box-sizing
(
border-box
);
@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
));
@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
;
margin-bottom
:
30px
;
position
:
relative
;
position
:
relative
;
width
:
flex-grid
(
4
)
;
width
:
100%
;
@include
transition
(
all
,
0
.15s
,
linear
);
@include
transition
(
all
,
0
.15s
,
linear
);
&
:nth-child
(
3n
+
3
)
{
margin-right
:
0
;
}
.meta-info
{
.meta-info
{
background
:
rgba
(
0
,
0
,
0
,
0
.6
);
background
:
rgba
(
0
,
0
,
0
,
0
.6
);
...
...
lms/templates/index.html
View file @
a64ddc77
...
@@ -78,9 +78,21 @@
...
@@ -78,9 +78,21 @@
</section>
</section>
<section
class=
"courses"
>
<section
class=
"courses"
>
%for course in courses:
<section
class=
'university-column'
>
<
%
include
file=
"course.html"
args=
"course=course"
/>
%for course in universities['MITx']:
%endfor
<
%
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>
</section>
</section>
</section>
...
...
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