Esempio n. 1
0
    def plugin_class(self):
        """
        Get the actual plugin class for this cell, or None if the plugin class isn't available.

        :return: Plugin or None.
        :rtype: Plugin|None
        """
        return Plugin.load(self.plugin_identifier, self.theme)
Esempio n. 2
0
    def plugin_class(self):
        """
        Get the actual plugin class for this cell, or None if the plugin class isn't available.

        :return: Plugin or None.
        :rtype: Plugin|None
        """
        return Plugin.load(self.plugin_identifier)
Esempio n. 3
0
    def populate(self):
        """
        Populate the form with fields for size and plugin selection.
        """

        initial_cell_width = self.layout_cell.sizes.get("sm") or self.CELL_FULL_WIDTH

        self.fields["cell_width"] = forms.ChoiceField(
            label=_("Cell width"), choices=self.CELL_WIDTH_CHOICES, initial=initial_cell_width)

        plugin_choices = Plugin.get_plugin_choices(empty_label=_("No Plugin"))
        plugin_field = self.fields["plugin"]
        plugin_field.choices = plugin_field.widget.choices = plugin_choices
        plugin_field.initial = self.layout_cell.plugin_identifier
Esempio n. 4
0
    def populate(self):
        """
        Populate the form with fields for size and plugin selection.
        """

        initial_cell_width = self.layout_cell.sizes.get(
            "sm") or self.CELL_FULL_WIDTH

        self.fields["cell_width"] = forms.ChoiceField(
            label=_("Cell width"),
            choices=self.CELL_WIDTH_CHOICES,
            initial=initial_cell_width)

        plugin_choices = Plugin.get_plugin_choices(empty_label=_("No Plugin"))
        plugin_field = self.fields["plugin"]
        plugin_field.choices = plugin_field.widget.choices = plugin_choices
        plugin_field.initial = self.layout_cell.plugin_identifier