Exemple #1
0
    def __init__(self, *args, **kwargs):
        super(SaveModelForm, self).__init__(*args, **kwargs)

        self.helper = FormHelper()
        #self.helper.form_action = reverse("cyanodesign:upload", kwargs={'pk': 1})
        self.helper.layout = Layout(
            ModalHeader('Save model', ),
            ModalBody('save_summary', ),
            ModalFooter(
                FormActions(
                    Button('save-submit', 'Save', css_class='btn-primary'),
                    CancelButton('save-cancel', 'Cancel'))),
        )
    def __init__(self, *args, **kwargs):
        super(RenameBasketForm, self).__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.layout = Layout(
            ModalHeader('Rename Basket', ),
            ModalBody('name'),
            ModalFooter(
                FormActions(
                    Button('basket-create-submit',
                           'Rename Basket',
                           css_class='btn-primary'),
                    CancelButton('delete-cancel', 'Cancel'))),
        )
Exemple #3
0
    def __init__(self, *args, **kwargs):
        super(UploadModelForm, self).__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.form_action = reverse("cyanodesign:upload",
                                          kwargs={'pk': 1})
        self.helper.layout = Layout(
            ModalHeader('Create new model', ),
            ModalBody('name', 'file'),
            ModalFooter(
                FormActions(
                    Button('upload-submit',
                           'Create Model',
                           css_class='btn-primary'),
                    CancelButton('upload-cancel', 'Cancel'))),
        )
Exemple #4
0
    def __init__(self, choices, *args, **kwargs):
        super(ModelFromTemplateForm, self).__init__(*args, **kwargs)

        self.fields["choice"].choices = choices
        self.helper = FormHelper()
        self.helper.form_action = reverse("cyanodesign:upload",
                                          kwargs={'pk': 2})
        self.helper.layout = Layout(
            ModalHeader('Create new model from template', ),
            ModalBody('name', 'choice'),
            ModalFooter(
                FormActions(
                    Button('upload-submit',
                           'Create Model',
                           css_class='btn-primary'),
                    CancelButton('upload-cancel', 'Cancel'))),
        )
    def __init__(self, *args, **kwargs):
        super(DeleteForm, self).__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.layout = Layout(
            ModalHeader('Delete {{ object.wid }}', ),
            ModalBody(
                HTML(
                    "Are you sure you want to delete {{ model_verbose_name|lower }} {{ object.wid }}?"
                ),
                Fieldset(None, 'reason'),
            ),
            ModalFooter(
                FormActions(
                    Submit('delete-submit',
                           'Delete',
                           css_class='btn btn-danger'),
                    CancelButton('delete-cancel', 'Cancel'))),
        )