Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions lms/templates/courseware/course_about_sidebar_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,27 @@
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()
course_path = reverse('about_course', args=[text_type(course.id)])
course_url = f"{site_protocol}://{site_domain}{course_path}"

## Translators: This text will be automatically posted to the student's
## Twitter account. {url} should appear at the end of the text.
tweet_text = _("I just enrolled in {number} {title} through {account}: {url}").format(
tweet_text = _("I just enrolled in {number} {title} through {account} {url}").format(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this removal?

Copy link
Member Author

@ghassanmas ghassanmas May 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed because its confusing or lets say unusual to have the ':' char after mentioning an account on twitter.
Before applying this change the generated tweet would like:
I just enrolled ..etc through @platformtwitteraccount: https..etc and after it's I just enrolled ..etc through @platformtwitteraccount https..etc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rgraber is it okay now to merge, or do you still have notes? Since nutmeg is going to be released in a couple of days

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing again now

number=course.number,
title=course.display_name_with_default,
account=static.get_value('course_about_twitter_account', settings.PLATFORM_TWITTER_ACCOUNT),
url=u"{protocol}://{domain}{path}".format(
protocol=site_protocol,
domain=site_domain,
path=reverse('about_course', args=[text_type(course.id)])
)
url=course_url
)

tweet_action = u"https://twitter.com/intent/tweet?text={tweet_text}".format(tweet_text=six.moves.urllib.parse.quote(tweet_text))

facebook_link = static.get_value('course_about_facebook_link', settings.PLATFORM_FACEBOOK_ACCOUNT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this value passed in? can it be removed completely from there?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's passed as a href for for that tag below

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, confusing comment. what i meant was can we delete course_about_facebook_link from wherever it originates now? or is it used elsewhre?

Copy link
Member Author

@ghassanmas ghassanmas May 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think its defined somewhere... It tries to get it first from site configuration if its enabled, and (if not or if its not defined in site configuration) it will then cascade/default to settings.PLATFORM_FACEBOOK_ACCOUNT.

Copy link
Member Author

@ghassanmas ghassanmas May 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

facebook_link = f"https://www.facebook.com/sharer/sharer.php?u={six.moves.urllib.parse.quote(course_url)}"

email_body = _("I just enrolled in {number} {title} through {platform} {url}").format(
number=course.number,
title=course.display_name_with_default,
platform=platform_name,
url=u"{protocol}://{domain}{path}".format(
protocol=site_protocol,
domain=site_domain,
path=reverse('about_course', args=[text_type(course.id)]),
)
url=course_url
)

email_subject = _("Take a course with {platform} online").format(platform=platform_name)
Expand All @@ -59,7 +53,7 @@
<span class="icon fa fa-twitter" aria-hidden="true"></span><span class="sr">${_("Tweet that you've enrolled in this course")}</span>
</a>
<a href="${facebook_link}" class="share">
<span class="icon fa fa-thumbs-up" aria-hidden="true"></span><span class="sr">${_("Post a Facebook message to say you've enrolled in this course")}</span>
<span class="icon fa fa-facebook" aria-hidden="true"></span><span class="sr">${_("Post a Facebook message to say you've enrolled in this course")}</span>
</a>
<a href="${email_link}" class="share">
<span class="icon fa fa-envelope" aria-hidden="true"></span><span class="sr">${_("Email someone to say you've enrolled in this course")}</span>
Expand Down