Ejemplo n.º 1
0
class EditPolicyEventAssignments(ControlExplorerView):
    title = Text("#explorer_title_text")
    events = BootstrapSwitchSelect("policy_info_div")
    cancel_button = Button("Cancel")
    save_button = Button("Save")

    supposed_title = 'Editing {} {} Policy "{}" Event Assignments'

    @property
    def is_displayed(self):
        return (self.in_control_explorer
                and self.title.text == self.supposed_title.format(
                    self.context["object"].PRETTY, self.context["object"].TYPE,
                    self.context["object"].description))
Ejemplo n.º 2
0
class EditPolicyEventAssignments(ControlExplorerView):
    title = Text("#explorer_title_text")

    events = VersionPick({
        Version.lowest(): CheckboxSelect("policy_info_div"),
        "5.8.1": BootstrapSwitchSelect("policy_info_div")
    })

    cancel_button = Button("Cancel")
    save_button = Button("Save")

    @property
    def is_displayed(self):
        return (self.in_control_explorer and self.title.text
                == 'Editing {} {} Policy "{}" Event Assignments'.format(
                    self.context["object"].PRETTY, self.context["object"].TYPE,
                    self.context["object"].description))