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
e048b325
Commit
e048b325
authored
Jun 14, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get dropdown working
parent
73372753
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
3 deletions
+57
-3
lms/djangoapps/student/views.py
+0
-1
lms/static/coffee/src/main.coffee
+1
-1
lms/static/js/vendor/jquery.cookie.js
+47
-0
lms/templates/main.html
+1
-0
lms/templates/navigation.html
+8
-1
No files found.
lms/djangoapps/student/views.py
View file @
e048b325
...
@@ -46,7 +46,6 @@ def index(request):
...
@@ -46,7 +46,6 @@ def index(request):
@ensure_csrf_cookie
@ensure_csrf_cookie
def
dashboard
(
request
):
def
dashboard
(
request
):
user
=
request
.
user
csrf_token
=
csrf
(
request
)[
'csrf_token'
]
csrf_token
=
csrf
(
request
)[
'csrf_token'
]
return
render_to_response
(
'dashboard.html'
,
{
'csrf'
:
csrf_token
})
return
render_to_response
(
'dashboard.html'
,
{
'csrf'
:
csrf_token
})
...
...
lms/static/coffee/src/main.coffee
View file @
e048b325
...
@@ -14,7 +14,7 @@ $ ->
...
@@ -14,7 +14,7 @@ $ ->
$
(
'body'
).
addClass
'touch-based-device'
if
onTouchBasedDevice
()
$
(
'body'
).
addClass
'touch-based-device'
if
onTouchBasedDevice
()
$
(
"a[rel*=leanModal]"
).
leanModal
()
#
$("a[rel*=leanModal]").leanModal()
$
(
'#csrfmiddlewaretoken'
).
attr
'value'
,
$
.
cookie
(
'csrftoken'
)
$
(
'#csrfmiddlewaretoken'
).
attr
'value'
,
$
.
cookie
(
'csrftoken'
)
if
$
(
'body'
).
hasClass
(
'courseware'
)
if
$
(
'body'
).
hasClass
(
'courseware'
)
...
...
lms/static/js/vendor/jquery.cookie.js
0 → 100644
View file @
e048b325
/*!
* jQuery Cookie Plugin
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2011, Klaus Hartl
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/GPL-2.0
*/
(
function
(
$
)
{
$
.
cookie
=
function
(
key
,
value
,
options
)
{
// key and at least value given, set cookie...
if
(
arguments
.
length
>
1
&&
(
!
/Object/
.
test
(
Object
.
prototype
.
toString
.
call
(
value
))
||
value
===
null
||
value
===
undefined
))
{
options
=
$
.
extend
({},
options
);
if
(
value
===
null
||
value
===
undefined
)
{
options
.
expires
=
-
1
;
}
if
(
typeof
options
.
expires
===
'number'
)
{
var
days
=
options
.
expires
,
t
=
options
.
expires
=
new
Date
();
t
.
setDate
(
t
.
getDate
()
+
days
);
}
value
=
String
(
value
);
return
(
document
.
cookie
=
[
encodeURIComponent
(
key
),
'='
,
options
.
raw
?
value
:
encodeURIComponent
(
value
),
options
.
expires
?
'; expires='
+
options
.
expires
.
toUTCString
()
:
''
,
// use expires attribute, max-age is not supported by IE
options
.
path
?
'; path='
+
options
.
path
:
''
,
options
.
domain
?
'; domain='
+
options
.
domain
:
''
,
options
.
secure
?
'; secure'
:
''
].
join
(
''
));
}
// key and possibly options given, get cookie...
options
=
value
||
{};
var
decode
=
options
.
raw
?
function
(
s
)
{
return
s
;
}
:
decodeURIComponent
;
var
pairs
=
document
.
cookie
.
split
(
'; '
);
for
(
var
i
=
0
,
pair
;
pair
=
pairs
[
i
]
&&
pairs
[
i
].
split
(
'='
);
i
++
)
{
if
(
decode
(
pair
[
0
])
===
key
)
return
decode
(
pair
[
1
]
||
''
);
// IE saves cookies with empty string as "c; ", e.g. without "=" as opposed to EOMB, thus pair[1] may be undefined
}
return
null
;
};
})(
jQuery
);
lms/templates/main.html
View file @
e048b325
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/jquery-1.6.2.min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/jquery-1.6.2.min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/jquery-ui-1.8.16.custom.min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/jquery-ui-1.8.16.custom.min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/jquery.cookie.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/swfobject/swfobject.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/swfobject/swfobject.js')}"
></script>
% if settings.MITX_FEATURES['USE_DJANGO_PIPELINE']:
% if settings.MITX_FEATURES['USE_DJANGO_PIPELINE']:
...
...
lms/templates/navigation.html
View file @
e048b325
<
%
page
args=
"active_page"
/>
<
%
page
args=
"active_page"
/>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%
block
name=
"js_extra"
>
<script
src=
"${static.url('js/my_courses_dropdown.js')}"
></script>
</
%
block>
<header
class=
"app"
aria-label=
"Global Navigation"
>
<header
class=
"app"
aria-label=
"Global Navigation"
>
<nav>
<nav>
<a
href=
"${ MITX_ROOT_URL }/mitxhome"
class=
"logo"
>
<a
href=
"${ MITX_ROOT_URL }/mitxhome"
class=
"logo"
>
...
@@ -6,11 +11,12 @@
...
@@ -6,11 +11,12 @@
</a>
</a>
<h1>
${ settings.COURSE_TITLE }
</h1>
<h1>
${ settings.COURSE_TITLE }
</h1>
%if user.is_authenticated():
<ol
class=
"user"
>
<ol
class=
"user"
>
<li>
<li>
<a
href=
"/dashboard"
class=
"user-dashboard"
>
<a
href=
"/dashboard"
class=
"user-dashboard"
>
<span
class=
"avatar"
><img
src=
"/static/images/profile.jpg"
/></span>
<span
class=
"avatar"
><img
src=
"/static/images/profile.jpg"
/></span>
Neil deGrasse Tyson
${ user.username }
</a>
</a>
</li>
</li>
<li>
<li>
...
@@ -21,6 +27,7 @@
...
@@ -21,6 +27,7 @@
</ol>
</ol>
</li>
</li>
</ol>
</ol>
%endif
</nav>
</nav>
</header>
</header>
...
...
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