-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
573 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
Images Gallery Django application initialization. | ||
""" | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class ImagesGalleryConfig(AppConfig): | ||
""" | ||
Configuration for the Images Gallery Django application. | ||
""" | ||
|
||
name = "imagesgallery" | ||
|
||
plugin_app = { | ||
"settings_config": { | ||
"lms.djangoapp": { | ||
"common": {"relative_path": "settings.common"}, | ||
"test": {"relative_path": "settings.test"}, | ||
"production": {"relative_path": "settings.production"}, | ||
}, | ||
"cms.djangoapp": { | ||
"common": {"relative_path": "settings.common"}, | ||
"test": {"relative_path": "settings.test"}, | ||
"production": {"relative_path": "settings.production"}, | ||
}, | ||
}, | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
""" | ||
Contentstore module definitions for Open edX Redwood release. | ||
""" | ||
|
||
# pylint: disable=import-error, unused-import | ||
from xmodule.contentstore.content import StaticContent | ||
from xmodule.contentstore.django import contentstore | ||
from cms.djangoapps.contentstore.views.assets import update_course_run_asset |
6 changes: 6 additions & 0 deletions
6
imagesgallery/edxapp_wrapper/backends/site_configuration_r_v1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
""" | ||
Site Configuration module definitions for Open edX Redwood release. | ||
""" | ||
|
||
# pylint: disable=import-error, unused-import | ||
from openedx.core.djangoapps.site_configuration import helpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
""" | ||
Contentstore module generalized definitions. | ||
""" | ||
|
||
from importlib import import_module | ||
|
||
from django.conf import settings | ||
|
||
|
||
def get_static_content(): | ||
""" | ||
Wrapper for `xmodule.contentstore.content.StaticContent` in edx-platform. | ||
""" | ||
backend_function = settings.IMAGES_GALLERY_CONTENTSTORE_BACKEND | ||
backend = import_module(backend_function) | ||
|
||
return backend.StaticContent | ||
|
||
|
||
def contentstore(*args, **kwargs): | ||
""" | ||
Wrapper method of `xmodule.contentstore.django.contentstore` in edx-platform. | ||
""" | ||
backend_function = settings.IMAGES_GALLERY_CONTENTSTORE_BACKEND | ||
backend = import_module(backend_function) | ||
|
||
return backend.contentstore(*args, **kwargs) | ||
|
||
|
||
def update_course_run_asset(*args, **kwargs): | ||
""" | ||
Wrapper method of `cms.djangoapps.contentstore.views.assets.update_course_run_asset` in edx-platform. | ||
""" | ||
backend_function = settings.IMAGES_GALLERY_CONTENTSTORE_BACKEND | ||
backend = import_module(backend_function) | ||
|
||
return backend.update_course_run_asset(*args, **kwargs) | ||
|
||
|
||
StaticContent = get_static_content() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Site Configuration module generalized definitions. | ||
""" | ||
|
||
from importlib import import_module | ||
|
||
from django.conf import settings | ||
|
||
|
||
def get_configuration_helpers(): | ||
""" | ||
Wrapper for `openedx.core.djangoapps.site_configuration.helpers` function in edx-platform. | ||
""" | ||
backend_function = settings.IMAGES_GALLERY_SITE_CONFIGURATION_BACKEND | ||
backend = import_module(backend_function) | ||
|
||
return backend.helpers | ||
|
||
|
||
configuration_helpers = get_configuration_helpers() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
""" | ||
Settings for the Images Gallery XBlock. | ||
""" | ||
|
||
|
||
def plugin_settings(settings): | ||
""" | ||
Read / Update necessary common project settings. | ||
""" | ||
settings.IMAGES_GALLERY_SITE_CONFIGURATION_BACKEND = "imagesgallery.edxapp_wrapper.backends.site_configuration_r_v1" | ||
settings.IMAGES_GALLERY_CONTENTSTORE_BACKEND = "imagesgallery.edxapp_wrapper.backends.contentstore_r_v1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
""" | ||
Settings for the Images Gallery XBlock. | ||
""" | ||
|
||
|
||
def plugin_settings(settings): | ||
""" | ||
Read / Update necessary common project settings. | ||
""" | ||
settings.IMAGES_GALLERY_SITE_CONFIGURATION_BACKEND = getattr(settings, "ENV_TOKENS", {}).get( | ||
"IMAGES_GALLERY_SITE_CONFIGURATION_BACKEND", | ||
settings.IMAGES_GALLERY_SITE_CONFIGURATION_BACKEND, | ||
) | ||
settings.IMAGES_GALLERY_CONTENTSTORE_BACKEND = getattr(settings, "ENV_TOKENS", {}).get( | ||
"IMAGES_GALLERY_CONTENTSTORE_BACKEND", | ||
settings.IMAGES_GALLERY_CONTENTSTORE_BACKEND, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
""" | ||
Django settings for imagesgallery project. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/3.2/topics/settings/ | ||
For the full list of settings and their values, see | ||
https://docs.djangoproject.com/en/3.2/ref/settings/ | ||
""" | ||
|
||
import os | ||
|
||
SECRET_KEY = os.getenv("DJANGO_SECRET", "open_secret") | ||
|
||
# Application definition | ||
|
||
INSTALLED_APPS = ( | ||
"statici18n", | ||
"imagesgallery", | ||
) | ||
|
||
# Internationalization | ||
# https://docs.djangoproject.com/en/3.2/topics/i18n/ | ||
|
||
LANGUAGE_CODE = "en-us" | ||
|
||
TIME_ZONE = "UTC" | ||
|
||
USE_I18N = True | ||
|
||
USE_L10N = True | ||
|
||
USE_TZ = True | ||
|
||
|
||
# Static files (CSS, JavaScript, Images) | ||
# https://docs.djangoproject.com/en/3.2/howto/static-files/ | ||
|
||
STATIC_URL = "/static/" | ||
|
||
# statici18n | ||
# https://django-statici18n.readthedocs.io/en/latest/settings.html | ||
|
||
STATICI18N_DOMAIN = "text" | ||
STATICI18N_PACKAGES = ("imagesgallery.translations",) | ||
STATICI18N_ROOT = "imagesgallery/public/js" | ||
STATICI18N_OUTPUT_DIR = "translations" | ||
|
||
# XBlock settings | ||
IMAGES_GALLERY_SITE_CONFIGURATION_BACKEND = "imagesgallery.edxapp_wrapper.backends.site_configuration_r_v1" | ||
IMAGES_GALLERY_CONTENTSTORE_BACKEND = "imagesgallery.edxapp_wrapper.backends.contentstore_r_v1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ edx-i18n-tools | |
Mako | ||
XBlock | ||
xblock-utils | ||
edx-opaque-keys |
Oops, something went wrong.