Skip to content

Commit

Permalink
feat: complete redesign and overhaul
Browse files Browse the repository at this point in the history
An internal Edly team has completely redesigned Indigo: the theme now
covers more pages, and includes the MFE footer and header. The site is
more beautiful than ever, and usable out of the box by everyone.
  • Loading branch information
TanveerAhmed authored and regisb committed Dec 13, 2023
1 parent ea08b58 commit ecc0a08
Show file tree
Hide file tree
Showing 38 changed files with 3,430 additions and 176 deletions.
3 changes: 2 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
variables:
TUTOR_PLUGIN: indigo
TUTOR_EXTRA_ENABLED_PLUGINS: mfe
TUTOR_PYPI_PACKAGE: tutor-indigo
TUTOR_IMAGES: openedx
TUTOR_IMAGES: openedx mfe
OPENEDX_RELEASE: quince
GITHUB_REPO: overhangio/tutor-indigo

Expand Down
1 change: 1 addition & 0 deletions changelog.d/20231213_100433_regis_indigo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- 💥[Improvement] Complete overhaul and redesign: the Indigo theme now covers more pages, including the MFE footer and header, and they are more beautiful than ever! (by @hinakhadim and @TanveerAhmed)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def load_about():
packages=find_packages(exclude=["tests*"]),
include_package_data=True,
python_requires=">=3.8",
install_requires=["tutor>=17.0.0,<18.0.0"],
install_requires=["tutor>=17.0.0,<18.0.0", "tutor-mfe>=17.0.0,<18.0.0"],
extras_require={"dev": "tutor[dev]>=17.0.0,<18.0.0"},
entry_points={"tutor.plugin.v1": ["indigo = tutorindigo.plugin"]},
classifiers=[
Expand Down
46 changes: 38 additions & 8 deletions tutorindigo/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
# To remove all links, run:
# tutor config save --set INDIGO_FOOTER_NAV_LINKS=[] --set INDIGO_FOOTER_LEGAL_LINKS=[]
"FOOTER_NAV_LINKS": [
{"title": "About", "url": "/about"},
{"title": "Contact", "url": "/contact"},
{"title": "About Us", "url": "/about"},
{"title": "Blog", "url": "/blog"},
{"title": "Donate", "url": "/donate"},
{"title": "Terms of Sevice", "url": "/tos"},
{"title": "Privacy Policy", "url": "/privacy"},
{"title": "Help", "url": "/help"},
{"title": "Contact Us", "url": "/contact"},
],
"FOOTER_LEGAL_LINKS": [
{"title": "Terms of service", "url": "/tos"},
Expand Down Expand Up @@ -69,17 +74,22 @@
hooks.Filters.CLI_DO_INIT_TASKS.add_item(("lms", task_file.read()))


# Override openedx docker image name
@hooks.Filters.CONFIG_DEFAULTS.add()
# Override openedx & mfe docker image names
@hooks.Filters.CONFIG_DEFAULTS.add(priority=hooks.priorities.LOW)
def _override_openedx_docker_image(
items: list[tuple[str, t.Any]]
) -> list[tuple[str, t.Any]]:
image = ""
openedx_image = ""
mfe_image = ""
for k, v in items:
if k == "DOCKER_IMAGE_OPENEDX":
image = v
if image:
items.append(("DOCKER_IMAGE_OPENEDX", f"{image}-indigo"))
openedx_image = v
elif k == "MFE_DOCKER_IMAGE":
mfe_image = v
if openedx_image:
items.append(("DOCKER_IMAGE_OPENEDX", f"{openedx_image}-indigo"))
if mfe_image:
items.append(("MFE_DOCKER_IMAGE", f"{mfe_image}-indigo"))
return items


Expand All @@ -91,3 +101,23 @@ def _override_openedx_docker_image(
[(f"INDIGO_{key}", value) for key, value in config["unique"].items()]
)
hooks.Filters.CONFIG_OVERRIDES.add_items(list(config["overrides"].items()))


hooks.Filters.ENV_PATCHES.add_items(
[
(
"mfe-dockerfile-post-npm-install-learning",
"""
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^1.0.0'
RUN npm install '@edx/frontend-component-header@npm:@edly-io/indigo-frontend-component-header@^1.0.0'
RUN npm install '@edx/frontend-component-footer@npm:@edly-io/indigo-frontend-component-footer@^1.0.0'
""",
),
(
"mfe-dockerfile-post-npm-install-authn",
"""
RUN npm install '@edx/brand@npm:@edly-io/indigo-brand-openedx@^1.0.0'
""",
),
]
)
Binary file modified tutorindigo/templates/indigo/cms/static/images/favicon.ico
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorindigo/templates/indigo/lms/static/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions tutorindigo/templates/indigo/lms/static/images/profile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorindigo/templates/indigo/lms/static/images/tutor-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions tutorindigo/templates/indigo/lms/static/images/unenroll.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ecc0a08

Please sign in to comment.