Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: let the platform decide for login and registration #91

Merged
merged 4 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions changelog.d/20240614_162236_codewithemad_cleanup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Improvement] Instead of forcing users to use Authentication MFe, the platform decides how users should log in. (by @CodeWithEmad)
4 changes: 2 additions & 2 deletions tutorindigo/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{"title": "About Us", "url": "/about"},
{"title": "Blog", "url": "/blog"},
{"title": "Donate", "url": "/donate"},
{"title": "Terms of Sevice", "url": "/tos"},
{"title": "Terms of Service", "url": "/tos"},
{"title": "Privacy Policy", "url": "/privacy"},
{"title": "Help", "url": "/help"},
{"title": "Contact Us", "url": "/contact"},
Expand Down Expand Up @@ -116,7 +116,7 @@ def _override_openedx_docker_image(
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^1.0.0'
""",
),
# Tutor-Indigo v2.1 targets the styling updations in discussions and learner-dashboard MFE
# Tutor-Indigo v2.1 targets the styling updates in discussions and learner-dashboard MFE
# brand-openedx is related to styling updates while others are for header and footer updates
(
"mfe-dockerfile-post-npm-install-discussions",
Expand Down
2 changes: 1 addition & 1 deletion tutorindigo/templates/indigo/lms/static/fonts/OFL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
.courses-listing {
letter-spacing: -.32em;
margin: 0 -2.5%;
@media only screen and (min-width: $big-screen) {
@media only screen and (min-width: $big-screen) {
margin: 0 -1.5%;
}
li {
Expand All @@ -34,7 +34,7 @@
@include media-breakpoint-up(md) {
width: 28.33% !important;
}
@media only screen and (min-width: $big-screen) {
@media only screen and (min-width: $big-screen) {
width: calc(25% - 3%) !important;
margin: 0 1.5% 25px !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
padding: 100px 0;
}
}
.wrapper-header-courses { display: none; }
.wrapper-header-courses { display: none; }
}
.course-heading-area {
margin: 0 0 20px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,9 @@ body.view-instructordash {
box-shadow: none;
}
}
.course-wrapper .course-content .xblock.xblock-student_view-vertical,
.course-wrapper .course-content .xblock.xblock-public_view-vertical,
.course-wrapper .courseware-results-wrapper .xblock.xblock-student_view-vertical,
.course-wrapper .course-content .xblock.xblock-student_view-vertical,
.course-wrapper .course-content .xblock.xblock-public_view-vertical,
.course-wrapper .courseware-results-wrapper .xblock.xblock-student_view-vertical,
.course-wrapper .courseware-results-wrapper .xblock.xblock-public_view-vertical {
max-width: 100% !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ $f-sans-serif: Crimson, 'Open Sans','Helvetica Neue', Helvetica, Arial, sans-ser
@import 'edx-bootstrap/sass/open-edx/theme';


// Introducing new variables
// Introducing new variables

$dark: #111827;
$dark: #111827;
$light-dark: #374151;
$big-screen: 1200px;
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
@include media-breakpoint-up(md) {
width: calc(100% - 32% - 40px);
}
@media only screen and (min-width: $big-screen) {
@media only screen and (min-width: $big-screen) {
max-width: calc(100% - 24% - 40px);
}
}
Expand All @@ -260,7 +260,7 @@
@include media-breakpoint-up(md) {
max-width: calc(100% - 32% - 40px);
}
@media only screen and (min-width: $big-screen) {
@media only screen and (min-width: $big-screen) {
max-width: calc(100% - 24% - 40px);
}
.program-heading {
Expand Down Expand Up @@ -334,7 +334,7 @@
.run-period {
font-size: 12px;
line-height: 16px;
color: #0F8B8D;
color: #0F8B8D;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h1>
</div>
</div>
</%block>

<!-- NEW IN INDIGO sidebar is improved with better icons -->

<div class="course-sidebar">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ <h2 class="header-search-facets">${_('Refine Your Search')}</h2>
</div>
</div>
% endif


<div class="course-holder courses${'' if course_discovery_enabled else ' no-course-discovery'}" role="region" aria-label="${_('List of Courses')}">
<ul class="courses-listing courses-list">
Expand Down
2 changes: 1 addition & 1 deletion tutorindigo/templates/indigo/lms/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ <h3>${course_dir}</h3>
% endif
</div>
</div>

<div class="side-container" role="complementary" aria-label="messages">
<%block name="skip_links">
% if settings.FEATURES.get('ENABLE_ANNOUNCEMENTS'):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ <h2 class="hd hd-2 sr" id="details-heading-${enrollment.course_id}">${_('Course
% endif
% if show_email_settings:
<li class="actions-item" id="actions-item-email-settings-${dashboard_index}" role="menuitem">

<a href="#email-settings-modal" class="action action-email-settings" rel="leanModal" data-course-id="${course_overview.id}" data-course-number="${course_overview.number}" data-dashboard-index="${dashboard_index}" data-optout="${course_overview.id in course_optouts}">${_('Email Settings')}</a>

</li>
% endif
</ul>
Expand All @@ -200,18 +200,18 @@ <h2 class="hd hd-2 sr" id="details-heading-${enrollment.course_id}">${_('Course
</div>
% if show_courseware_link and not is_unfulfilled_entitlement:
% if not is_course_expired:

<img src="${course_overview.image_urls['small']}" class="course-image" alt="${_('{course_number} {course_name} Home Page').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default)}" />

% else:

<img src="${course_overview.image_urls['small']}" class="course-image" alt="${_('{course_number} {course_name} Cover Image').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default)}" />

% endif
% else:

<img src="${course_overview.image_urls['small']}" class="course-image" alt="${_('{course_number} {course_name} Cover Image').format(course_number=course_overview.number, course_name=course_overview.display_name_with_default)}" />

% endif
% if display_course_modes_on_dashboard and course_verified_certs.get('display_mode') != 'audit':
<span class="sts-enrollment" title="${course_verified_certs.get('enrollment_title')}">
Expand Down Expand Up @@ -329,7 +329,7 @@ <h3 id="course-title-${enrollment.course_id}">
</div>
</div>


</div>
</div>
</section>
Expand Down
4 changes: 2 additions & 2 deletions tutorindigo/templates/indigo/lms/templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<span class="copyright-site">Copyrights ©${datetime.now().year}. All Rights Reserved.</span>
% endif
<div class="colophon">

% if context.get('include_language_selector', footer_language_selector_is_enabled()):
<%include file="${static.get_template_path('widgets/footer-language-selector.html')}"/>
% endif
Expand Down Expand Up @@ -121,7 +121,7 @@
<span class="copyright-site">Copyrights ©${datetime.now().year}. All Rights Reserved.</span>
% endif
<div class="colophon">

% if context.get('include_language_selector', footer_language_selector_is_enabled()):
<%include file="${static.get_template_path('widgets/footer-language-selector.html')}"/>
% endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from django.conf import settings
from django.urls import reverse
from django.utils.translation import gettext as _

from openedx.core.djangoapps.user_authn.toggles import should_redirect_to_authn_microfrontend
%>

<%
Expand All @@ -19,7 +17,6 @@
allows_login = not settings.FEATURES['DISABLE_LOGIN_BUTTON'] and not combined_login_and_register
can_discover_courses = settings.FEATURES.get('ENABLE_COURSE_DISCOVERY')
allow_public_account_creation = static.get_value('ALLOW_PUBLIC_ACCOUNT_CREATION', settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION')) and settings.FEATURES.get('SHOW_REGISTRATION_LINKS', True)
should_redirect_to_authn_mfe = should_redirect_to_authn_microfrontend()
%>
<!-- NEW IN INDIGO update nav -->
<nav class="nav-links" aria-label=${_("Supplemental Links")}>
Expand Down Expand Up @@ -49,25 +46,13 @@
<div class="btn-holder">
% if allows_login:
% if allow_public_account_creation and not disable_register_button:
% if should_redirect_to_authn_mfe:
<div class="mobile-nav-item hidden-mobile nav-item">
<a class="register-btn btn" href="${settings.AUTHN_MICROFRONTEND_URL}/register${login_query()}">${_("Register for free")}</a>
</div>
% else:
<div class="mobile-nav-item hidden-mobile nav-item">
<a class="register-btn btn" href="/register${login_query()}">${_("Register for free")}</a>
</div>
% endif
% endif
% if should_redirect_to_authn_mfe:
<div class="mobile-nav-item hidden-mobile nav-item">
<a class="sign-in-btn btn" href="${settings.AUTHN_MICROFRONTEND_URL}/login${login_query()}">${_("Sign in")}</a>
</div>
% else:
<div class="mobile-nav-item hidden-mobile nav-item">
<a class="sign-in-btn btn" href="/login${login_query()}">${_("Sign in")}</a>
</div>
% endif
<div class="mobile-nav-item hidden-mobile nav-item">
<a class="sign-in-btn btn" href="/login${login_query()}">${_("Sign in")}</a>
</div>
% endif
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<source srcset="<%- smallBannerUrl %>" media="(max-width: <%- breakpoints.max.small %>)">
<source srcset="<%- mediumBannerUrl %>" media="(max-width: <%- breakpoints.max.medium %>)">
<source srcset="<%- xsmallBannerUrl %>" media="(max-width: <%- breakpoints.max.large %>)">

<!-- NEW IN INDIGO: Add fallback image in case of no course-image using onerror -->
<img class="banner-image" srcset="<%- smallBannerUrl %>" src="/theming/asset/images/no_course_image.png" alt="<%- interpolate(gettext('%(programName)s Home Page.'), {programName: title}, true)%>">
</picture>
Expand Down
Loading