Example #1
0
def dashlet_vs_general_settings(dashlet_type: Type[Dashlet],
                                single_infos: List[str]):
    return Dictionary(
        title=_('General Settings'),
        render='form',
        optional_keys=['title', 'title_url'],
        elements=[
            ('type',
             FixedValue(
                 dashlet_type.type_name(),
                 totext=dashlet_type.title(),
                 title=_('Dashlet Type'),
             )),
            visuals.single_infos_spec(single_infos),
            ('background',
             Checkbox(
                 title=_('Colored Background'),
                 label=_('Render background'),
                 help=_(
                     'Render gray background color behind the dashlets content.'
                 ),
                 default_value=True,
             )),
            ('show_title',
             DropdownChoice(
                 title=_("Show title header"),
                 help=
                 _('Render the titlebar including title and link above the dashlet.'
                   ),
                 choices=[
                     (False, _("Don't show any header")),
                     (True, _("Show header with highlighted background")),
                     ("transparent", _("Show title without any background")),
                 ],
                 default_value=True,
             )),
            ('title',
             TextUnicode(
                 title=_('Custom Title') + '<sup>*</sup>',
                 help=" ".join((
                     _('Most dashlets have a hard coded static title and some are aware of its '
                       'content and set the title dynamically, like the view snapin, which '
                       'displays the title of the view. If you like to use any other title, set it '
                       'here.'),
                     _title_help_text_for_macros(dashlet_type),
                 )).rstrip(),
                 size=75,
             )),
            ('title_url',
             TextUnicode(
                 title=_('Link of Title'),
                 help=
                 _('The URL of the target page the link of the dashlet should link to.'
                   ),
                 size=50,
             )),
        ],
    )
Example #2
0
def dashlet_vs_general_settings(dashlet: Dashlet, single_infos: List[str]):
    return Dictionary(
        title=_('General Settings'),
        render='form',
        optional_keys=['title', 'title_url'],
        elements=[
            ('type',
             FixedValue(
                 dashlet.type_name(),
                 totext=dashlet.title(),
                 title=_('Dashlet Type'),
             )),
            visuals.single_infos_spec(single_infos),
            ('background',
             Checkbox(
                 title=_('Colored Background'),
                 label=_('Render background'),
                 help=_(
                     'Render gray background color behind the dashlets content.'
                 ),
                 default_value=True,
             )),
            ('show_title',
             DropdownChoice(
                 title=_("Show title header"),
                 help=
                 _('Render the titlebar including title and link above the dashlet.'
                   ),
                 choices=[
                     (False, _("Don't show any header")),
                     (True, _("Show header with highlighted background")),
                     ("transparent", _("Show title without any background")),
                 ],
                 default_value=True,
             )),
            ('title',
             TextUnicode(
                 title=_('Custom Title') + '<sup>*</sup>',
                 help=
                 _('Most dashlets have a hard coded default title. For example the view snapin '
                   'has even a dynamic title which defaults to the real title of the view. If you '
                   'like to use another title, set it here.'),
                 size=50,
             )),
            ("title_format", vs_title_infos()),
            ('title_url',
             TextUnicode(
                 title=_('Link of Title'),
                 help=
                 _('The URL of the target page the link of the dashlet should link to.'
                   ),
                 size=50,
             )),
        ],
    )
Example #3
0
def dashlet_vs_general_settings(dashlet_type: Type[Dashlet], single_infos: List[str]):
    return Dictionary(
        title=_("General Settings"),
        render="form",
        optional_keys=["title", "title_url"],
        elements=[
            (
                "type",
                FixedValue(
                    dashlet_type.type_name(),
                    totext=dashlet_type.title(),
                    title=_("Element type"),
                ),
            ),
            visuals.single_infos_spec(single_infos),
            (
                "background",
                Checkbox(
                    title=_("Colored background"),
                    label=_("Render background"),
                    help=_("Render gray background color behind the elements content."),
                    default_value=True,
                ),
            ),
            (
                "show_title",
                DropdownChoice(
                    title=_("Show title header"),
                    help=_("Render the titlebar including title and link above the element."),
                    choices=[
                        (False, _("Don't show any header")),
                        (True, _("Show header with highlighted background")),
                        ("transparent", _("Show title without any background")),
                    ],
                    default_value=True,
                ),
            ),
            (
                "title",
                TextInput(
                    title=_("Custom title") + "<sup>*</sup>",
                    placeholder=_(
                        "This option is macro-capable, please check the inline help for more "
                        "information."
                    ),
                    help=" ".join(
                        (
                            _(
                                "Most elements have a hard coded static title and some are aware of their "
                                "content and set the title dynamically, like the view snapin, which "
                                "displays the title of the view. If you like to use any other title, set it "
                                "here."
                            ),
                            _title_help_text_for_macros(dashlet_type),
                        )
                    ),
                    size=75,
                ),
            ),
            (
                "title_url",
                TextInput(
                    title=_("Link of Title"),
                    help=_("The URL of the target page the link of the element should link to."),
                    size=50,
                ),
            ),
        ],
    )