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
c18d911c
Commit
c18d911c
authored
Oct 03, 2017
by
George Song
Committed by
GitHub
Oct 03, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16102 from open-craft/clemente/twitter-url
Encode share course URLs and use the right protocol
parents
39671b8e
adb6a5ac
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
lms/templates/courseware/course_about_sidebar_header.html
+13
-4
No files found.
lms/templates/courseware/course_about_sidebar_header.html
View file @
c18d911c
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%!
<
%!
import
urllib
from
django
.
utils
.
translation
import
ugettext
as
_
from
django
.
utils
.
translation
import
ugettext
as
_
from
django
.
core
.
urlresolvers
import
reverse
from
django
.
core
.
urlresolvers
import
reverse
from
django
.
conf
import
settings
from
django
.
conf
import
settings
...
@@ -14,6 +16,7 @@ from django.conf import settings
...
@@ -14,6 +16,7 @@ from django.conf import settings
## want here (and on this whole page, really).
## want here (and on this whole page, really).
<
%
<
%
site_domain =
static.get_value('site_domain',
settings
.
SITE_NAME
)
site_domain =
static.get_value('site_domain',
settings
.
SITE_NAME
)
site_protocol =
'https'
if
settings
.
HTTPS =
=
'
on
'
else
'
http
'
platform_name =
static.get_platform_name()
platform_name =
static.get_platform_name()
##
Translators:
This
text
will
be
automatically
posted
to
the
student
'
s
##
Translators:
This
text
will
be
automatically
posted
to
the
student
'
s
...
@@ -22,9 +25,12 @@ from django.conf import settings
...
@@ -22,9 +25,12 @@ from django.conf import settings
number=
course.number,
number=
course.number,
title=
course.display_name_with_default_escaped,
title=
course.display_name_with_default_escaped,
account=
static.get_value('course_about_twitter_account',
settings
.
PLATFORM_TWITTER_ACCOUNT
),
account=
static.get_value('course_about_twitter_account',
settings
.
PLATFORM_TWITTER_ACCOUNT
),
url=
u"http://{domain}{path}".format(
url=
u"{protocol}://{domain}{path}".format(
protocol=
site_protocol,
domain=
site_domain,
domain=
site_domain,
path=
reverse('about_course',
args=
[course.id.to_deprecated_string()])
path=
urllib.quote_plus(
reverse
('
about_course
',
args=
[course.id.to_deprecated_string()])
)
)
)
).
replace
(
u
"
",
u
"+")
).
replace
(
u
"
",
u
"+")
tweet_action =
u"http://twitter.com/intent/tweet?text={tweet_text}".format(tweet_text=tweet_text)
tweet_action =
u"http://twitter.com/intent/tweet?text={tweet_text}".format(tweet_text=tweet_text)
...
@@ -37,9 +43,12 @@ from django.conf import settings
...
@@ -37,9 +43,12 @@ from django.conf import settings
number=
course.number,
number=
course.number,
title=
course.display_name_with_default_escaped,
title=
course.display_name_with_default_escaped,
platform=
platform_name,
platform=
platform_name,
url=
u"http://{domain}{path}".format(
url=
u"{protocol}://{domain}{path}".format(
protocol=
site_protocol,
domain=
site_domain,
domain=
site_domain,
path=
reverse('about_course',
args=
[course.id.to_deprecated_string()]),
path=
urllib.quote_plus(
reverse
('
about_course
',
args=
[course.id.to_deprecated_string()]),
)
)
)
)
)
).
replace
(
u
"
",
u
"%
20
")
).
replace
(
u
"
",
u
"%
20
")
...
...
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