diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt index 67afb2b..f8312dc 100644 --- a/docs/HISTORY.txt +++ b/docs/HISTORY.txt @@ -5,6 +5,8 @@ Changelog ---------------------- * Upgrade step: Within "Plone > Site setup > Add-ons" click on upgrade button available for eea.app.visualization +* Change: Cleanup old 'sections' code + [avoinea] * Feature: Added confirm dialog in order to prevent accidentally disable of visualizations [voineali refs #9572] diff --git a/eea/app/visualization/browser/app/view.py b/eea/app/visualization/browser/app/view.py index 18c2510..bac42bd 100644 --- a/eea/app/visualization/browser/app/view.py +++ b/eea/app/visualization/browser/app/view.py @@ -94,47 +94,6 @@ def tabs(self): tabs.extend(getattr(browser, 'tabs', [])) return tabs - @property - def sections(self): - """ Returns view sections - """ - views = self.accessor.views - - sections = {} - for view in views: - name = view.get('name') - browser = queryMultiAdapter( - (self.context, self.request), name=name) - section = getattr(browser, 'section', 'Default') - section_id = section.lower().replace(' ', '-') - sections[section_id] = section - return sections - - def section_views(self, section): - """ Returns views for a section - """ - views = self.accessor.views - myviews = [] - for view in views: - name = view.get('name') - browser = queryMultiAdapter( - (self.context, self.request), name=name) - section_name = getattr(browser, 'section', 'Default') - if section_name.lower().replace(' ', '-') != section: - continue - myviews.append(name) - return myviews - - def section(self, name): - """ Get section by name - """ - view = queryMultiAdapter((self.context, self.request), name=name) - if not view: - logger.warn('There is no %s view registered for %s', - name, self.context.absolute_url(1)) - return '' - return view() - def __call__(self, **kwargs): """ If daviz is not configured redirects to edit page. """ diff --git a/eea/app/visualization/browser/configure.zcml b/eea/app/visualization/browser/configure.zcml index 17a907c..02af4ae 100644 --- a/eea/app/visualization/browser/configure.zcml +++ b/eea/app/visualization/browser/configure.zcml @@ -13,14 +13,6 @@ provides="zope.formlib.namedtemplate.INamedTemplate" /> - - -
-
-
- - -
- - -
-
- - -
- - -
-
-
- diff --git a/eea/app/visualization/views/interfaces.py b/eea/app/visualization/views/interfaces.py index 3230e4a..cb52622 100644 --- a/eea/app/visualization/views/interfaces.py +++ b/eea/app/visualization/views/interfaces.py @@ -7,7 +7,6 @@ class IVisualizationView(Interface): """ Access / update visualization view configuration """ label = TextLine(title=u'Label for visualization view') - section = TextLine(title=u"Section of this view, e.g. Exhibit, Google, etc") class IViewDirective(Interface): """ diff --git a/eea/app/visualization/views/view.py b/eea/app/visualization/views/view.py index 0625587..834f3a7 100644 --- a/eea/app/visualization/views/view.py +++ b/eea/app/visualization/views/view.py @@ -9,8 +9,10 @@ class ViewForm(BrowserView): see implementation in eea.exhibit.views.map.view.View. """ label = '' - section = 'Exhibit' - _data = {} + + def __init__(self, context, request): + super(ViewForm, self).__init__(context, request) + self._data = {} @property def data(self):