Skip to content

Commit

Permalink
Layout prices as simple table
Browse files Browse the repository at this point in the history
  • Loading branch information
mbjones committed Feb 11, 2022
1 parent 0f12590 commit 3fe5873
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
14 changes: 14 additions & 0 deletions app/purser/css/purser.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,17 @@ button {
display: none;
transition: all 0.5s;
}

section#ptable {
display: table;
width: 30%;
margin-bottom: 2rem;
}

section#ptable > * {
display: table-row;
}

section#ptable .col {
display: table-cell;
}
32 changes: 28 additions & 4 deletions app/purser/hosted-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,34 @@ <h1>Payment</h1>

<div class="product-select" id="products">
<p>Select products for payment:</p>
<input type="checkbox" id="dataoneplus" name="DataONEPlus">
<label for="DataONEPlus">DataONE Plus</label>
<input type="checkbox" id="hostedrepo" name="HostedRepo">
<label for="HostedRepo">Hosted Repository</label>
<section id="ptable">
<header>
<div class="col"></div>
<div class="col">Price</div>
</header>
<div class="row">
<div class="col">
<input type="checkbox" id="dataoneplus" name="DataONEPlus">
<label for="DataONEPlus">DataONE Plus</label>
</div>
<div class="col">$575.04</div>
</div>
<div class="row">
<div class="col">
<input type="checkbox" id="hostedrepo" name="HostedRepo">
<label for="HostedRepo">Hosted Repository</label>
</div>
<div class="col">$12,999.96</div>
</div>
<div class="row">
<div class="col">
<input type="checkbox" id="hastorage" name="HAStorage">
<label for="HAStorage">HA Storage (1 TB)</label>
</div>
<div class="col">$150.00</div>
</div>
</section>

<button id="checkout"><span>Checkout</span></button>
<script type="text/javascript" src="js/payment.js"></script>
</div>
Expand Down
3 changes: 3 additions & 0 deletions app/purser/js/payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ function calc_total() {
if (document.getElementById('dataoneplus').checked) {
total += prices().dataoneplus;
}
if (document.getElementById('hastorage').checked) {
total += prices().hastorage;
}
return(total);
}

Expand Down

0 comments on commit 3fe5873

Please sign in to comment.