Coder Social home page Coder Social logo

edx-theme-codebase's Introduction

Overview

This directory stores the Appsembler custom codebase for theme authoring, developed and tested on Open edX Dogwood version. It enables advanced theme authoring, with improved flexibility, custom SASS codebase and utilizes our new architecture for Open edX themes, which relies on our custom SASS, "Design templates" which hold "building blocks" designs for creating pages, "Translator templates" which (where needed) serve as translators between Open edX standard templates and their variables and our Design templates, Discovery templates for Backbone rendered content that we customize and a main theme-variables.html template which directs other templates, defining the building blocks to be used/included on particular pages and their content.

Why this new architecture?

When doing advanced customizations of themes, especially creating a number of them that need to be maintaned, a problem occurs when updating edX platform on instances that these themes are used on - because of constant evolution/changes of Open edX platform, heavily customized templates are likely to create errors and need a hefty amount of debugging. When maintaining multiple heavily customized themes, that proves to be a problem that makes platfrom updates a time-consuming process. By separating custom design into its own templates that get non-changing variables passed to them through the main templates or translator templates, we keep debugging concentrated into same points on all themes - fixing main templates and translator templates (which are identical for all themes) in one theme, we can propagate them to all themes making them fully functional for the new edX version.

Warning

This new codebase is built custom to accommodate the development needs and long-term product development plans for Appsembler, meaning some of design choices are made with that in mind. Also, this codebase is currently still in development and not finished, so it's not recommended to use it in production. Theme-variables template is designed with internal future plans in mind - which is why it may not seem perfectly intuitive for all uses and purposes.

Usage - templates and content

Unlike standard Open edX theme development, all pages and shared page elements content is changed/defined through one file - theme-variables.html. It passes its variables to standard Open edX templates, telling them which design blocks to use, in which order, and what content they should display. For an example, you use it to tell which course tile design to use on which pages, set the paths to static content like brand logos, add additional links to theme's header or footer, etc. Since this is still in alpha, the documentation of all available building blocks and variables isn't available, but the default included theme-variables.html file includes a lot of examples so you can try to make changes. It's also well commented with instructions on how to define stuff and which variables need to be included.

Usage - styling

The theme doesn't use Open edX paver process to compile the SASS, so it needs to be pre-compiled into the "static/css/main.css" file. You can change the many variables included into the src/base/basic-branding.scss file to make changes - just remember to recompile it :) The reason why we do compiling on our own is because we include the main.css file manually after Open edX standard css, escaping the issue of Open edX styles overriding our own.

Screenshots

Alt text

Index page using the following blocks: hero-section-01, heading-plus-text-plus-cta, line-separator, course-listing-01 with course-tile-01 tile template, headig-plus-text-plus-cta, photo-grid-01

Alt text

Course catalogue page using the following blocks: hero-section-01, course-catalogue-01; with course tile set to course-tile-02, and discovery facet set to facet-01 and search input set to discovery-search-01.

Alt text

Single course about page using the following blocks: course-about-01, line separator, heading-plus-text-plus-cta

Alt text

Register page

Alt text

Dashboard page

Theme Authoring

To customize your theme:

  • Install Devstack either on your host or via Sultan.
  • Make a new branch in this repository e.g. omar/header-color
  • Change the files you'd like and make a pull request against the release branch e.g. juniper/main.

How to use on Devstack

  1. Go to your devstacks main directory and you should see the edx-theme-codebase directory besides the edx-platform
  2. To change to a specific customer's code:
  • Go to customer_specific directory
  • Checkout the customer's branch $ git checkout juniper/tahoe
  1. To compile the SCSS files run the following command in LMS:
    • $ make lms-shell
    • $ paver update_assets lms --skip-collect # Compiles lms
    • $ paver update_assets studio --skip-collect # Compiles Studio styles
  2. In another shell, use the following command to compile the SASS file:
  • $ cd edx-theme-codebase
  • $ sassc lms/static/sass/main.scss lms/static/css/main.css

Working with Translations

For information about working with translations, see the Internationalization Support section of the Open edX XBlock Tutorial.

The translation strings of this theme are split into two POEditor.com projects:

Working with POEditor

Also ensure that the POEditor client has the correct API access token by setting the environment variable POEDITOR_TOKEN to the value from your account settings.

Push new strings to POEditor:

$ tox -e i18n-push

To get the latest translations from POEditor:

$ tox -e i18n-pull

Upgrading to another release

  • The OPENEDX_RELEASE environment variable should be updated (hardcoded) in the tox.ini file, so the i18n scripts work properly.
  • The tox -e build-release-requirements should be run to update the release file. Other tox scripts will fail otherwise due to missing requirements file.

License

The code in this repo is licensed under the Apache 2.0 License. See LICENSE.txt for more info.

edx-theme-codebase's People

Contributors

grozdanowski avatar omarithawi avatar bezidejni avatar bryanlandia avatar melvinsoft avatar amirtds avatar jfaman avatar shadinaif avatar estherjsuh avatar iamjazzar avatar vladyslavty avatar tkeemon avatar thraxil avatar

Stargazers

 avatar

Watchers

John Baldwin avatar Jason Gilmore avatar James Cloos avatar  avatar  avatar Matthew Harrington avatar  avatar  avatar

edx-theme-codebase's Issues

Discovery course card organization doesn't obey Advanced Setting display override

We are seeing for Trinity Eucalyptus this discrepancy:
https://trello.com/c/7dtKHh2v/177-correct-organization-display-on-search-page-eucalyptus

Looks like course cards on dashboard obey 'Course Organization Display String', but cards from course discovery (/courses page) do not.

See:
https://github.com/appsembler/edx-theme-codebase/blob/eucalyptus/master/lms/templates/discovery/course_card.underscore#L11

(only org, not content.display_organization)

Add tests for the theme and basic quality checks

  • SCSS files compile correctly
  • Functions like _translate() are tested via unit tests
  • Make files compile correctly
  • All functions in the theme are translated correctly
  • Test integration with the SiteConfiguration.get_value() (needs a site config python package)
  • Translation files are in sync

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.