Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Modal for Deployment Selection #174

Merged
merged 9 commits into from
Jun 17, 2024
44 changes: 32 additions & 12 deletions views/builder/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,6 @@ function checkPercentageIntervals(dependency){
<label>Description</label>
<textarea class="form-control" rows="8" name="description" placeholder="Description"><?php echo $data['copyData']['description']; ?></textarea>
</div>
<div class="form-group">
<label>Select deployment</label>
<select id="environment" name="deployment" class="form-control" required>
<option value="" disabled selected>Please select a deployment</option>
<?php if(!empty($data['deployments'])) { ?>
<?php foreach ($data['deployments'] as $deployment) { ?>
<option value="<?php echo $deployment->getItem(); ?>" <?php if($data['copyData']['deployment'] == $deployment->getItem()) echo 'selected'; ?>><?php echo $deployment->getItem(); ?></option>
<?php } ?>
<?php } ?>
</select>
</div>
<div class="form-group">
<div class="checkbox-inline">
<label style="font-weight: normal">
Expand All @@ -220,7 +209,7 @@ function checkPercentageIntervals(dependency){
<div class="box-body">
<div class="row">
<div class="col-xs-12">
<button type="submit" class="btn btn-block btn-success btn-lg">Create</button>
<button data-toggle="modal" data-target="#modal-deployment" type="button" class="btn btn-block btn-success btn-lg">Create</button>
</div>
</div>
</div>
Expand All @@ -232,5 +221,36 @@ function checkPercentageIntervals(dependency){
</div>
</section>
</div>
</div>
<div class="modal fade" id="modal-deployment">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"
onclick="document.getElementById('form').reset()">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Select Deployment</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label>Deployment</label>
<select class="form-control" name="deployment" title="deployment" required>
<?php if(!empty($data['deployments'])) { ?>
<?php foreach ($data['deployments'] as $deployment) { ?>
<option value="<?php echo $deployment->getItem(); ?>" <?php if($data['copyData']['deployment'] == $deployment->getItem()) echo 'selected'; ?>><?php echo $deployment->getItem(); ?></option>
<?php } ?>
<?php } ?>
</select>
</div>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="document.getElementById('form').submit();">Confirm</button>
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"
onclick="document.getElementById('form').reset()">Cancel
</button>
</div>
</div>
</div>
</form>
</div>