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
b6a90e0b
Commit
b6a90e0b
authored
May 19, 2014
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed register button on edge homepage.
LMS-2719
parent
18ee082c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
76 deletions
+20
-76
lms/djangoapps/branding/tests.py
+19
-0
lms/djangoapps/branding/views.py
+1
-4
lms/static/coffee/src/main.coffee
+0
-2
lms/templates/university_profile/edge.html
+0
-70
No files found.
lms/djangoapps/branding/tests.py
View file @
b6a90e0b
...
...
@@ -2,6 +2,7 @@
Tests for branding page
"""
import
datetime
from
django.http
import
HttpResponseRedirect
from
pytz
import
UTC
from
django.conf
import
settings
from
django.contrib.auth.models
import
AnonymousUser
...
...
@@ -13,6 +14,7 @@ from xmodule.modulestore.django import editable_modulestore
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
courseware.tests.tests
import
TEST_DATA_MONGO_MODULESTORE
import
student.views
from
branding.views
import
index
FEATURES_WITH_STARTDATE
=
settings
.
FEATURES
.
copy
()
FEATURES_WITH_STARTDATE
[
'DISABLE_START_DATES'
]
=
False
...
...
@@ -72,3 +74,20 @@ class AnonymousIndexPageTest(ModuleStoreTestCase):
# check to see that the override value is honored
resp
=
self
.
client
.
get
(
'/'
)
self
.
assertEquals
(
resp
[
'X-Frame-Options'
],
'DENY'
)
def
test_edge_redirect_to_login
(
self
):
"""
Test edge homepage redirect to lms login.
"""
request
=
self
.
factory
.
get
(
'/'
)
request
.
user
=
AnonymousUser
()
# HTTP Host changed to edge.
request
.
META
[
"HTTP_HOST"
]
=
"edge.edx.org"
response
=
index
(
request
)
# Response should be instance of HttpResponseRedirect.
self
.
assertIsInstance
(
response
,
HttpResponseRedirect
)
# Location should be "/login".
self
.
assertEqual
(
response
.
_headers
.
get
(
"location"
)[
1
],
"/login"
)
lms/djangoapps/branding/views.py
View file @
b6a90e0b
...
...
@@ -46,10 +46,7 @@ def index(request):
# keep specialized logic for Edge until we can migrate over Edge to fully use
# microsite definitions
if
domain
and
'edge.edx.org'
in
domain
:
context
=
{
'suppress_toplevel_navigation'
:
True
}
return
render_to_response
(
'university_profile/edge.html'
,
context
)
return
redirect
(
reverse
(
"signin_user"
))
# we do not expect this case to be reached in cases where
# marketing and edge are enabled
...
...
lms/static/coffee/src/main.coffee
View file @
b6a90e0b
...
...
@@ -32,12 +32,10 @@ $ ->
$
(
'#login'
).
click
->
$
(
'#login_form input[name="email"]'
).
focus
()
_gaq
.
push
([
'_trackPageview'
,
'/login'
])
false
$
(
'#signup'
).
click
->
$
(
'#signup-modal input[name="email"]'
).
focus
()
_gaq
.
push
([
'_trackPageview'
,
'/signup'
])
false
# fix for ie
...
...
lms/templates/university_profile/edge.html
deleted
100644 → 0
View file @
18ee082c
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%
inherit
file=
"../main.html"
/>
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
block
name=
"pagetitle"
>
${_("edX edge")}
</
%
block>
<
%
block
name=
"bodyclass"
>
no-header edge-landing
</
%
block>
<
%
block
name=
"content"
>
<div
class=
"main-wrapper"
>
<div
class=
"edx-edge-logo-large"
>
${_("edX edge")}
</div>
<div
class=
"content"
>
<div
class=
"log-in-form"
>
<h2>
${_("Log in to your courses")}
</h2>
<form
id=
"login_form"
data-remote=
"true"
method=
"post"
action=
"/login_ajax"
>
<div
class=
"row"
>
<label>
${_("Email")}
</label>
<input
name=
"email"
type=
"email"
class=
"email-field"
tabindex=
"1"
>
</div>
<div
class=
"row"
>
<label>
${_("Password")}
</label>
<input
name=
"password"
type=
"password"
class=
"password-field"
tabindex=
"2"
>
</div>
<div
class=
"row submit"
>
<input
name=
"submit"
type=
"submit"
value=
"${_("
Log
In
")}"
class=
"log-in-submit-button"
tabindex=
"3"
>
<a
href=
"#forgot-password-modal"
rel=
"leanModal"
class=
"pwd-reset forgot-button"
>
${_("Forgot password?")}
</a>
</div>
</form>
</div>
<div
class=
"sign-up"
>
<h3>
${_("Register for classes")}
</h3>
<p>
${_("Take free online courses from today's leading universities.")}
</p>
<p><a
href=
"#signup-modal"
id=
"signup"
rel=
"leanModal"
class=
"register-button"
>
${_("Register")}
</a></p>
</div>
</div>
</div>
</
%
block>
<
%
block
name=
"js_extra"
>
<script
type=
"text/javascript"
>
(
function
()
{
$
(
document
).
ready
(
function
()
{
if
(
$
.
deparam
.
fragment
()[
'forgot-password-modal'
]
!==
undefined
)
{
$
(
'.pwd-reset'
).
click
();
}
})
$
(
document
).
delegate
(
'#login_form'
,
'ajax:success'
,
function
(
data
,
json
,
xhr
)
{
if
(
json
.
success
)
{
next
=
getParameterByName
(
'next'
);
if
(
next
)
{
location
.
href
=
next
;
}
else
{
location
.
href
=
"${reverse('dashboard')}"
;
}
}
else
{
if
(
$
(
'#login_error'
).
length
==
0
)
{
$
(
'#login_form'
).
prepend
(
'<div id="login_error" class="modal-form-error"></div>'
);
}
$
(
'#login_error'
).
html
(
json
.
value
).
stop
().
css
(
"display"
,
"block"
);
}
});
})(
this
)
</script>
</
%
block>
<
%
include
file=
"../signup_modal.html"
/>
<
%
include
file=
"../forgot_password_modal.html"
/>
\ No newline at end of file
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