Added ability to upload a receipt from the user page

This commit is contained in:
Tom Bloor 2017-04-20 17:33:59 +01:00
parent 2cc670b58f
commit d1add8ee7c
6 changed files with 208 additions and 24 deletions

View file

@ -7,11 +7,11 @@
<!-- Bootstrap and jQuery js -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
%= content_for 'css';
%= stylesheet '/static/user/css/main.css';
</head>
<body>
<nav class="navbar navbar-toggleable-md fixed-top navbar-inverse bg-primary">
@ -38,7 +38,9 @@
</div>
</nav>
<%= content %>
<div class="container">
<%= content %>
</div>
%= content_for 'javascript';
</body>
</html>

View file

@ -1,25 +1,37 @@
% layout 'user';
% title 'Home';
% content_for css => begin
<style>
body {
background: whitesmoke;
padding-top: 54px;
}
.panel {
background: white;
padding: 16px;
-webkit-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.2);
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.2);
}
.login-form {
margin-top: 20%;
}
</style>
% end
% content_for javascript => begin
%= javascript '/static/user/js/home.js';
% end
<div>User Pages</div>
<div class="card">
<h3 class="card-header">Submit Receipt</h3>
<div class="card-block">
<form id="receipt-form" action="<%= url_for '/portal/upload' %>">
<input type="hidden" name="transaction_type" value="3" hidden>
<div class="form-group">
<label for="org-name">Organisation Name</label>
<input id="org-name" type="text" class="form-control" name="organisation_name" placeholder="Organisation Name" required>
</div>
<div class="form-group">
<label for="org-street">Street Address</label>
<input id="org-street" type="text" class="form-control" name="street_name" placeholder="eg. 7 High Street">
</div>
<div class="form-group">
<label for="org-town">Town</label>
<input id="org-town" type="text" class="form-control" name="town" placeholder="eg. Lancaster" required>
</div>
<div class="form-group">
<label for="org-postcode">Postcode</label>
<input id="org-postcode" type="text" class="form-control" name="postcode" placeholder="eg. LA1 1AA">
</div>
<div class="form-group">
<label for="tran-value">Receipt Value</label>
<input id="tran-value" type="number" step="any" class="form-control" name="transaction_value" placeholder="eg. 5.99">
</div>
<div class="form-group">
<label for="tran-file">Receipt Picture</label>
<input id="tran-file" type="file" class="form-control-file" name="file">
</div>
<button type="submit" class="btn btn-primary">Add Receipt</button>
</div>
</div>