-
Notifications
You must be signed in to change notification settings - Fork 25
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
101 changed files
with
1,646 additions
and
19,033 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
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
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
6 changes: 3 additions & 3 deletions
6
creme/billing/templates/billing/forms/widgets/exporter-option.html
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
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
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,44 @@ | ||
import os | ||
|
||
from django.apps import apps | ||
from django.conf import settings | ||
from django.contrib.staticfiles import finders | ||
from django.core.management.base import BaseCommand | ||
|
||
from creme.creme_core.staticfiles import ( | ||
I18NCatalog, | ||
JavaScriptBundle, | ||
StyleSheetBundle, | ||
) | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Generate media files' | ||
|
||
BUNDLERS = { | ||
"javascript": JavaScriptBundle, | ||
"stylesheet": StyleSheetBundle, | ||
} | ||
|
||
def create_destination(self): | ||
os.makedirs(settings.CREME_STATICFILES_TMP_DIRECTORY, exist_ok=True) | ||
|
||
def bundle_i18n(self): | ||
for language_code, _ in settings.LANGUAGES: | ||
catalog = I18NCatalog(language_code) | ||
catalog.save(destination=settings.CREME_STATICFILES_TMP_DIRECTORY) | ||
|
||
def bundle_staticfiles(self): | ||
for bundle in settings.CREME_STATICFILES_BUNDLES: | ||
bundler_class = self.BUNDLERS[bundle["type"]] | ||
bundler = bundler_class(filename=bundle["filename"]) | ||
for app_name, filepaths in bundle["files"].items(): | ||
if apps.is_installed(app_name): | ||
for filepath in filepaths: | ||
bundler.add(filepath, finders.find(filepath)) | ||
bundler.save(destination=settings.CREME_STATICFILES_TMP_DIRECTORY) | ||
|
||
def handle(self, **options): | ||
self.create_destination() | ||
self.bundle_staticfiles() | ||
self.bundle_i18n() |
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
Oops, something went wrong.