Prechádzať zdrojové kódy

Refactor modules statics

Denis K 9 rokov pred
rodič
commit
2aab763cf3

+ 3 - 3
jet/dashboard_modules/google_analytics.py

@@ -207,9 +207,6 @@ class GoogleAnalyticsBase(DashboardModule):
     error = None
     storage = None
 
-    class Media:
-        js = ('jet/vendor/chart.js/Chart.min.js', 'jet/modules/google_analytics.js')
-
     def __init__(self, title=None, period=None, **kwargs):
         kwargs.update({'period': period})
         super(GoogleAnalyticsBase, self).__init__(title, **kwargs)
@@ -325,6 +322,9 @@ class GoogleAnalyticsVisitorsChart(GoogleAnalyticsBase):
     group = None
     settings_form = GoogleAnalyticsChartSettingsForm
 
+    class Media:
+        js = ('jet/vendor/chart.js/Chart.min.js', 'jet/dashboard_modules/google_analytics.js')
+
     def __init__(self, title=None, period=None, show=None, group=None, **kwargs):
         kwargs.update({'period': period, 'show': show, 'group': group})
         super(GoogleAnalyticsVisitorsChart, self).__init__(title, **kwargs)

+ 3 - 3
jet/dashboard_modules/yandex_metrika.py

@@ -159,9 +159,6 @@ class YandexMetrikaBase(DashboardModule):
     counter = None
     error = None
 
-    class Media:
-        js = ('jet/vendor/chart.js/Chart.min.js', 'jet/modules/yandex_metrika.js')
-
     def settings_dict(self):
         return {
             'period': self.period,
@@ -260,6 +257,9 @@ class YandexMetrikaVisitorsChart(YandexMetrikaBase):
     group = None
     settings_form = YandexMetrikaChartSettingsForm
 
+    class Media:
+        js = ('jet/vendor/chart.js/Chart.min.js', 'jet/dashboard_modules/yandex_metrika.js')
+
     def __init__(self, title=None, period=None, show=None, group=None, **kwargs):
         kwargs.update({'period': period, 'show': show, 'group': group})
         super(YandexMetrikaVisitorsChart, self).__init__(title, **kwargs)

+ 0 - 0
jet/static/jet/modules/google_analytics.js → jet/static/jet/dashboard_modules/google_analytics.js


+ 0 - 0
jet/static/jet/modules/yandex_metrika.js → jet/static/jet/dashboard_modules/yandex_metrika.js