def __init__(self, plan, repo, user, *args, **kwargs):
self.plan = plan
self.repo = repo
self.user = user
super(RunPlanForm, self).__init__(*args, **kwargs)
self.fields['branch'].choices = self._get_branch_choices()
self.helper = FormHelper()
self.helper.form_class = 'form-vertical'
self.helper.form_id = 'run-build-form'
self.helper.form_method = 'post'
self.helper.layout = Layout(
Fieldset(
'Choose the branch you want to build',
Field('branch', css_class='slds-input'),
css_class='slds-form-element',
),
Fieldset(
'Enter the commit you want to build. The HEAD commit on the branch will be used if you do not specify a commit',
Field('commit', css_class='slds-input'),
css_class='slds-form-element',
),
Fieldset(
'Keep org? (scratch orgs only)',
Field('keep_org', css_class='slds-checkbox'),
css_class='slds-form-element',
),
FormActions(
Submit('submit', 'Submit',
css_class='slds-button slds-button--brand')
),
)
评论列表
文章目录