Beispiel #1
0
    def __init__(self, conference=False, past=False):
        SemSearchArray.__init__(self)
        organizer = TextBox(
            name="organizer",
            label="Organizer",
            width=textwidth,
        )
        date = TextBox(
            name="daterange",
            id="daterange",
            label="Date",
            example=datetime.now(current_user.tz).strftime("%B %d, %Y -"),
            example_value=True,
            width=textwidth,
            extra=['autocomplete="off"'],
        )

        self.array = [
            [self.institution, self.audience],
            [organizer] if past else [organizer, self.recent],
        ]
        if conference:
            self.array.append([date])

        assert conference in [True, False]
        self.conference = conference
Beispiel #2
0
    def __init__(self, conference=False, past=False):
        ## pick institution where it is held
        institution = SelectBox(
            name="institution",
            label="Institution",
            options=[("", ""), ("None", "No institution",),]
            + [(elt["shortname"], elt["name"]) for elt in institutions_shortnames()],
            width=textwidth+10, # select boxes need 10px more than text areas
        )

        venue = SelectBox(
            name="venue",
            label=static_knowl("venue"),
            options=[("", ""),
                     ("online", "online"),
                     ("in-person", "in-person")
                     ]
        )
        assert venue

        organizer = TextBox(
            name="organizer",
            label="Organizer",
            width=textwidth,
        )
        date = TextBox(
            name="daterange",
            id="daterange",
            label="Date",
            example=datetime.now(current_user.tz).strftime("%B %d, %Y -"),
            example_value=True,
            width=textwidth,
            extra=['autocomplete="off"'],
        )
        self.array = [
            [institution],
            [organizer],
        ]
        if conference:
            self.array.append([date])

        assert conference in [True, False]
        self.conference = conference
Beispiel #3
0
    def __init__(self, past=False):
        SemSearchArray.__init__(self)
        speaker = TextBox(
            name="speaker",
            label="Speaker",
            width=textwidth,
            extra=['style="width:300px; margin-right:64px;"'],
        )
        affiliation = TextBox(
            name="affiliation",
            label="Affiliation",
            width=textwidth,
        )
        date = TextBox(
            name="daterange",
            id="daterange",
            label="Date",
            example=datetime.now(current_user.tz).strftime("%B %d, %Y -"),
            example_value=True,
            example_span=False,
            width=textwidth,
            extra=['autocomplete="off"'],
        )
        time = TextBox(
            name="timerange",
            label="Time",
            example="8:00 - 18:00",
            example_span=False,
            width=textwidth,
        )
        livestream_available = Toggle("access", "Livestream available")

        videoslidespaper = TripleToggle("video", "Has video", "slides",
                                        "slides", "paper", "paper")
        self.array = [
            [self.institution, self.audience],
            [speaker, videoslidespaper if past else self.recent],
            [affiliation] if past else [affiliation, livestream_available],
            [date, time],
        ]
Beispiel #4
0
 def _input(self, info):
     inp = TextBox._input(self, info)
     span = '<span{extras}>{text}</span>'.format(extras=self.spanextras,
                                                 text=self.spantext)
     return inp + span
Beispiel #5
0
 def __init__(self, name, label, spantext, spanextras="", **kwds):
     TextBox.__init__(self, name, label, **kwds)
     self.spantext = spantext
     self.spanextras = spanextras
Beispiel #6
0
    def __init__(self, past=False):
        ## pick institution where it is held
        institution = SelectBox(
            name="institution",
            label="Institution",
            options=[("", ""), ("None", "No institution",),]
            + [(elt["shortname"], elt["name"]) for elt in institutions_shortnames()],
            width=textwidth+10, # select boxes need 10px more than text areas
        )

        venue = SelectBox(
            name="venue",
            label=static_knowl("venue"),
            options=[("", ""),
                     ("online", "online"),
                     ("in-person", "in-person")
                     ]
        )
        assert venue

        speaker = TextBox(
            name="speaker",
            label="Speaker",
            width=textwidth,
            extra=['style="width:300px; margin-right:64px;"'],
        )
        affiliation = TextBox(
            name="affiliation",
            label="Affiliation",
            width=textwidth,
        )
        date = TextBox(
            name="daterange",
            id="daterange",
            label="Date",
            example=datetime.now(current_user.tz).strftime("%B %d, %Y -"),
            example_value=True,
            example_span=False,
            width=textwidth,
            extra=['autocomplete="off"'],
        )
        time = TextBox(
            name="timerange",
            label="Time",
            example="8:00 - 18:00",
            example_span=False,
            width=textwidth,
        )
        recent = ComboBox(
            name="recent",
            label="Edited within",
            spantext="hours",
            spanextras=' style="margin-left:5px;"',
            example="168",
            example_span=False,
            width=50,
        )

        video = Toggle(name="video", label="Has video")
        self.array = [
            [institution, video if past else recent],
            [speaker, affiliation],
            [date, time],
        ]