Commit 1e11d1a4 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

Avoid undesired appearance of side boxes

They should only appear in the main tab.
parent 725812bce2c4
......@@ -27,8 +27,8 @@ from cubes.relationwidget import views as rwdg
from cubes.seda.xsd2yams import RULE_TYPES
from cubes.seda.entities import full_seda2_profile, simplified_profile, parent_and_container
from cubes.seda.views import rtags_from_xsd_element, rtags_from_rtype_role_targets
from cubes.seda.views import viewlib, clone, copy_rtag
from cubes.seda.views import rtags_from_xsd_element, rtags_from_rtype_role_targets, copy_rtag
from cubes.seda.views import clone, viewlib
from cubes.seda.views import uicfg as sedauicfg # noqa - ensure those rules are defined first
at_ordered_fields = [
......@@ -116,7 +116,7 @@ class ArchiveTransferTabbedPrimaryView(tabs.TabbedPrimaryView):
rwdg.boostrap_dialog(self.w, self._cw._, clone._import_div_id(entity), u'')
class ArchiveTransferCodeListVersionsTab(tabs.PrimaryTab):
class ArchiveTransferCodeListVersionsTab(viewlib.PrimaryTabWithoutBoxes):
"""Tab for code list versions information of an archive transfer."""
__regid__ = 'seda_at_code_list_versions_tab'
__select__ = is_instance('SEDAArchiveTransfer') & full_seda2_profile()
......@@ -124,7 +124,7 @@ class ArchiveTransferCodeListVersionsTab(tabs.PrimaryTab):
rsection, display_ctrl = rtags_from_xsd_element('SEDAArchiveTransfer', 'CodeListVersions')
class ArchiveTransferManagementTab(tabs.PrimaryTab):
class ArchiveTransferManagementTab(viewlib.PrimaryTabWithoutBoxes):
"""Main tab for management data of an archive transfer"""
__regid__ = 'seda_management_tab'
__select__ = is_instance('SEDAArchiveTransfer')
......
......@@ -185,7 +185,7 @@ class TitleBusinessValueEntityView(viewlib.BusinessValueEntityView):
return tags.a(entity.dc_title(), href=entity.absolute_url())
class ArchiveUnitManagementTab(tabs.PrimaryTab):
class ArchiveUnitManagementTab(viewlib.PrimaryTabWithoutBoxes):
"""Display management information about an archive unit."""
__regid__ = 'seda_management_tab'
......@@ -273,7 +273,7 @@ class SimplifiedArchiveUnitContentTab(tabs.TabsMixin, EntityView):
content.view('seda.simplified_au_content', w=self.w)
class SimplifiedArchiveUnitContentView(tabs.PrimaryTab):
class SimplifiedArchiveUnitContentView(viewlib.PrimaryTabWithoutBoxes):
"""SEDAContent view for underlying SimplifiedArchiveUnitContentTab."""
__regid__ = 'seda.simplified_au_content'
......
......@@ -126,7 +126,7 @@ class ContentTabbedPrimaryView(tabs.TabbedPrimaryView):
]
class ContentIdentificationTab(tabs.PrimaryTab):
class ContentIdentificationTab(viewlib.PrimaryTabWithoutBoxes):
"""Display identification data about an archive unit content."""
__regid__ = 'seda_content_identification_tab'
......@@ -144,7 +144,7 @@ class ContentIdentificationTab(tabs.PrimaryTab):
rsection, display_ctrl = rtags_from_rtype_role_targets('SEDAContent', rtype_role_targets)
class ContentRestrictionTab(tabs.PrimaryTab):
class ContentRestrictionTab(viewlib.PrimaryTabWithoutBoxes):
"""Display restrictions about an archive unit content."""
__regid__ = 'seda_content_restriction_tab'
......@@ -158,7 +158,7 @@ class ContentRestrictionTab(tabs.PrimaryTab):
rsection, display_ctrl = rtags_from_rtype_role_targets('SEDAContent', rtype_role_targets)
class ContentDateTab(tabs.PrimaryTab):
class ContentDateTab(viewlib.PrimaryTabWithoutBoxes):
"""Display date information about an archive unit content."""
__regid__ = 'seda_content_date_tab'
......@@ -177,7 +177,7 @@ class ContentDateTab(tabs.PrimaryTab):
rsection, display_ctrl = rtags_from_rtype_role_targets('SEDAContent', rtype_role_targets)
class ContentGpsTab(tabs.PrimaryTab):
class ContentGpsTab(viewlib.PrimaryTabWithoutBoxes):
"""Display GPS information about an archive unit content."""
__regid__ = 'seda_content_gps_tab'
......@@ -186,7 +186,7 @@ class ContentGpsTab(tabs.PrimaryTab):
rsection, display_ctrl = rtags_from_xsd_element('SEDAContent', 'Gps')
class ContentServiceTab(tabs.PrimaryTab):
class ContentServiceTab(viewlib.PrimaryTabWithoutBoxes):
"""Display service information about an archive unit content."""
__regid__ = 'seda_content_service_tab'
......
......@@ -178,7 +178,7 @@ class BinaryDataObjectTabbedPrimaryView(tabs.TabbedPrimaryView):
]
class BinaryDataObjectFormatIdentificationTab(tabs.PrimaryTab):
class BinaryDataObjectFormatIdentificationTab(viewlib.PrimaryTabWithoutBoxes):
"""Display format identification information of a binary data object"""
__regid__ = 'seda_bdo_format_identification'
......@@ -195,7 +195,7 @@ class SimplifiedBinaryDataObjectFormatIdentificationTab(BinaryDataObjectFormatId
rsection.tag_object_of(('*', 'seda_format_id_from', 'SEDABinaryDataObject'), 'hidden')
class BinaryDataObjectFileInfoTab(tabs.PrimaryTab):
class BinaryDataObjectFileInfoTab(viewlib.PrimaryTabWithoutBoxes):
"""Display file information of a binary data object"""
__regid__ = 'seda_bdo_file_information'
......@@ -214,7 +214,7 @@ class PhysicalDataObjectTabbedPrimaryView(tabs.TabbedPrimaryView):
]
class PhysicalDataObjectDimensionsTab(tabs.PrimaryTab):
class PhysicalDataObjectDimensionsTab(viewlib.PrimaryTabWithoutBoxes):
"""Display physical dimensions of a physical data object"""
__regid__ = 'seda_pdo_dimensions'
......@@ -223,7 +223,7 @@ class PhysicalDataObjectDimensionsTab(tabs.PrimaryTab):
rsection, display_ctrl = rtags_from_xsd_element('SEDAPhysicalDataObject', 'PhysicalDimensions')
class DataObjectRelationsTab(tabs.PrimaryTab):
class DataObjectRelationsTab(viewlib.PrimaryTabWithoutBoxes):
"""Display relations of a binary or physical data object"""
__regid__ = 'seda_do_relations'
......
......@@ -195,6 +195,16 @@ class TypeListItemView(ListItemView):
business_vid = 'seda.type_meta'
class PrimaryTabWithoutBoxes(tabs.PrimaryTab):
"""Abstract base class for tabs which rely on the primary view logic but don't want side boxes.
"""
__abstract__ = True
__regid__ = None # we don't want 'primary'
def is_primary(self):
return False
class SubObjectsTab(tabs.TabsMixin, EntityView):
"""Base class for tabs with a 'add' button and one or more list of subobjects, driven by the
`rtype_role_targets` class attribute
......
......@@ -22,7 +22,7 @@ from logilab.common.decorators import monkeypatch
from cubicweb import tags, utils
from cubicweb.uilib import js
from cubicweb.web import formfields as ff, formwidgets as fw
from cubicweb.web.views import ajaxcontroller, formrenderers, autoform
from cubicweb.web.views import ajaxcontroller, autoform, formrenderers
def configure_relation_widget(req, div, search_url, title, multiple, validate):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment