Skip to content

Commit

Permalink
feat: customize sock links
Browse files Browse the repository at this point in the history
  • Loading branch information
Anas12091101 committed Mar 7, 2024
1 parent c848767 commit a39b105
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 29 deletions.
29 changes: 29 additions & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2874,3 +2874,32 @@ def _should_send_xblock_events(settings):
REST_FRAMEWORK['DEFAULT_SCHEMA_CLASS'] = 'drf_spectacular.openapi.AutoSchema'

BEAMER_PRODUCT_ID = ""


################## Studio Sock URLs #####################

SHOW_SOCK_LINKS_BTN = True

SOCK_LINKS = [
{
'href': 'http://docs.edx.org',
'sr_mouseover_text': 'Access documentation on http://docs.edx.org',
'text': 'edX Documentation',
'condition': True
}, {
'href': 'https://open.edx.org',
'sr_mouseover_text': 'Access the Open edX Portal',
'text': 'Open edX Portal',
'condition': True
}, {
'href': 'https://www.edx.org/course/overview-creating-edx-course-edx-edx101#.VO4eaLPF-n1',
'sr_mouseover_text': 'Enroll in edX101: Overview of Creating an edX Course',
'text': 'Enroll in edX101',
'condition': True
}, {
'href': 'https://www.edx.org/course/creating-course-edx-studio-edx-studiox',
'sr_mouseover_text': 'Enroll in StudioX: Creating a Course with edX Studio',
'text': 'Enroll in StudioX',
'condition': True
}
]
4 changes: 3 additions & 1 deletion cms/templates/widgets/sock.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
%>
<%namespace file="sock_links.html" import="get_sock_links" />

% if settings.SHOW_SOCK_LINKS_BTN:
<div class="wrapper-sock wrapper">
<ul class="list-actions list-cta">
<li class="action-item">
Expand All @@ -26,7 +27,7 @@ <h2 id="sock-heading" class="title sr-only">${_("{studio_name} Documentation").f
% for link in links:
% if link['condition']:
<li class="action-item">
<a href="${link['href']}" title="${link['sr_mouseover_text']}" rel="external" class="action action-primary">${link['text']}</a>
<a href="${link['href']}" title="${link['sr_mouseover_text']}" rel="external" class="action action-primary">${_(link['text'])}</a>
<span class="tip">${link['sr_mouseover_text']}</span>
</li>
%endif
Expand All @@ -36,3 +37,4 @@ <h2 id="sock-heading" class="title sr-only">${_("{studio_name} Documentation").f
</section>
</div>
</div>
% endif
29 changes: 1 addition & 28 deletions cms/templates/widgets/sock_links.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,7 @@
<%def name="get_sock_links()">
<%
partner_email = settings.PARTNER_SUPPORT_EMAIL
links = [
{
'href': 'http://docs.edx.org',
'sr_mouseover_text': _('Access documentation on http://docs.edx.org'),
'text': _('edX Documentation'),
'condition': True
}, {
'href': 'https://open.edx.org',
'sr_mouseover_text': _('Access the Open edX Portal'),
'text': _('Open edX Portal'),
'condition': True
}, {
'href': 'https://www.edx.org/course/overview-creating-edx-course-edx-edx101#.VO4eaLPF-n1',
'sr_mouseover_text': _('Enroll in edX101: Overview of Creating an edX Course'),
'text': _('Enroll in edX101'),
'condition': True
}, {
'href': 'https://www.edx.org/course/creating-course-edx-studio-edx-studiox',
'sr_mouseover_text': _('Enroll in StudioX: Creating a Course with edX Studio'),
'text': _('Enroll in StudioX'),
'condition': True
}, {
'href': 'mailto:{email}'.format(email=partner_email),
'sr_mouseover_text': _('Send an email to {email}').format(email=partner_email),
'text': _('Contact Us'),
'condition': bool(partner_email)
}
]
links = settings.SOCK_LINKS
links_extra = get_sock_links_extra()
links += links_extra
return links
Expand Down

0 comments on commit a39b105

Please sign in to comment.