def get_detail_persistent_attr(self, module, detail_module, detail_type="case_short"): detail, detail_enabled = self._get_detail_from_module(module, detail_type) if detail_enabled: if self._has_persistent_tile(detail): return id_strings.detail(detail_module, detail_type) if detail.persist_case_context and detail_type == "case_short": # persistent_case_context will not work on product lists. return id_strings.persistent_case_context_detail(detail_module) return None
def _get_persistent_case_context_detail(module): return Detail( id=id_strings.persistent_case_context_detail(module), title=Text(), fields=[ Field( style=Style( horz_align="center", font_size="large", grid_height=2, grid_width=12, grid_x=0, grid_y=0 ), header=Header(text=Text()), template=Template(text=Text(xpath_function="case_name")), ) ], )
def _get_persistent_case_context_detail(module, xml): return Detail(id=id_strings.persistent_case_context_detail(module), title=Text(), fields=[ Field( style=Style( horz_align="center", font_size="large", grid_height=1, grid_width=12, grid_x=0, grid_y=0, ), header=Header(text=Text()), template=Template(text=Text(xpath_function=xml)), ) ])
def get_detail_persistent_attr(self, module, detail_module, detail_type="case_short"): detail, detail_enabled = self._get_detail_from_module(module, detail_type) if detail_enabled: # if configured to use persisted case tile context from another module which has case tiles # configured then get id_string for that module if detail.persistent_case_tile_from_module: module_for_persistent_context = self._get_module_for_persistent_context( module, detail.persistent_case_tile_from_module ) if module_for_persistent_context: return id_strings.detail(module_for_persistent_context, detail_type) if self._has_persistent_tile(detail): return id_strings.detail(detail_module, detail_type) if detail.persist_case_context and detail_type == "case_short": # persistent_case_context will not work on product lists. return id_strings.persistent_case_context_detail(detail_module) return None