Ejemplo n.º 1
0
 def _vs_key(self) -> Dictionary:
     return Dictionary(
         title=_("Properties"),
         elements=[
             (
                 "alias",
                 TextInput(
                     title=_("Description or comment"),
                     size=64,
                     allow_empty=False,
                 ),
             ),
             (
                 "passphrase",
                 Password(
                     title=_("Passphrase"),
                     help=self._passphrase_help(),
                     allow_empty=False,
                     is_stored_plain=False,
                 ),
             ),
             (
                 "key_file",
                 CascadingDropdown(
                     title=_("Key"),
                     choices=[
                         ("upload", _("Upload CRT/PEM File"), FileUpload()),
                         ("text", _("Paste PEM Content"), TextAreaUnicode()),
                     ],
                 ),
             ),
         ],
         optional_keys=False,
         render="form",
     )
Ejemplo n.º 2
0
 def _vs_ical(self):
     return Dictionary(
         title=_('Import iCalendar File'),
         render="form",
         optional_keys=False,
         elements=[
             ('file',
              FileUpload(
                  title=_('iCalendar File'),
                  help=_("Select an iCalendar file (<tt>*.ics</tt>) from your PC"),
                  custom_validate=self._validate_ical_file,
              )),
             ('horizon',
              Integer(
                  title=_('Time horizon for repeated events'),
                  help=
                  _("When the iCalendar file contains definitions of repeating events, these repeating "
                    "events will be resolved to single events for the number of years you specify here."
                   ),
                  minvalue=0,
                  maxvalue=50,
                  default_value=10,
                  unit=_('years'),
              )),
             ('times',
              Optional(
                  ListOfTimeRanges(default_value=[None],),
                  title=_('Use specific times'),
                  label=_('Use specific times instead of whole day'),
                  help=
                  _("When you specify explicit time definitions here, these will be added to each "
                    "date which is added to the resulting time period. By default the whole day is "
                    "used."),
              )),
         ])