Ejemplo n.º 1
0
 def render(self):
     return (Elem(
         'div',
         {
             'class': 'col-md-6',
         },
         ' ',
         Elem(
             'label',
             {
                 'class': 'sr-only',
             },
             'Email',
         ),
         ' ',
         Elem(
             'input',
             {
                 'type': 'text',
                 'id': 'form_text_input',
                 'class': 'form-control-plaintext',
                 'placeholder': 'Enter a to do',
             },
         ),
         ' ',
         Elem(SubmitButton),
         ' ',
     ))
Ejemplo n.º 2
0
 def render(self):
     return (Elem(
         'div',
         {
             'class': 'col-md-6',
         },
         ' ',
         Elem(ToDoList),
         ' ',
     ))
Ejemplo n.º 3
0
    def render(self):
        self.prerender()

        if self.to_do_items:
            todos = list(map(self.to_link, self.to_do_items))

            return (Elem(
                'ul',
                {
                    'class': 'list-group',
                },
                ' ',
                todos,
                ' ',
            ))
        return (Elem('ul'))
Ejemplo n.º 4
0
 def render(self):
     return Elem(
         'ul',
         {
             'className': self.props['className'],
         },
     )
Ejemplo n.º 5
0
 def render(self):
    return Elem(
      'li',
      {
          'class': self.props['class'],
      },
      self.props['text'],
  )
Ejemplo n.º 6
0
def todo_item(self):
    text = 'get milk'
    return Elem(
        ToDoItem,
        {
            'text': text,
        },
    )
Ejemplo n.º 7
0
    def to_link(self, to_do_item):

        return (Elem(
            ToDoItem,
            {
                'item': to_do_item['text'],
            },
        ))
Ejemplo n.º 8
0
def todo_list(self):
    className = 'todo_list'
    return Elem(
        ToDoList,
        {
            'className': className,
        },
    )
Ejemplo n.º 9
0
 def render(self):
     return (Elem(
         'input',
         {
             'type': 'button',
             'id': 'form_submit',
             'class': 'btn btn-primary mb-2',
             'value': 'Add',
         },
     ))
Ejemplo n.º 10
0
 def render(self):
     return (Elem(
         'input',
         {
             'type': 'button',
             'id': 'GET_button',
             'class': 'btn btn-primary mb-2',
             'value': 'GET',
         },
     ))
Ejemplo n.º 11
0
 def render(self):
     return (Elem(
         'input',
         {
             'type': 'button',
             'onclick': 'print()',
             'id': 'print_button',
             'class': 'btn btn-primary mb-2',
             'value': 'Print',
         },
     ))
Ejemplo n.º 12
0
    def render(self):

        item = self.props['item']
        return (Elem(
            'li',
            {
                'class': 'list-group-item',
            },
            ' ',
            item,
            ' ',
        ))
Ejemplo n.º 13
0
def app():
    return (Elem(
        'div',
        {
            'class': 'container-fluid',
        },
        ' ',
        Elem(
            'div',
            {
                'class': 'row',
            },
            ' ',
            Elem(ToDoForm),
            ' ',
            Elem(ToDoContainer),
            ' ',
            Elem(PrintButton),
            ' ',
            Elem(GETButton),
            ' ',
        ),
        ' ',
    ))