Skip to content

Commit

Permalink
adds links between pages, #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Danwhy committed Aug 1, 2018
1 parent 60c1313 commit c2163ec
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
24 changes: 19 additions & 5 deletions lambda/templates/html-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,19 @@
border-spacing: 0;
border-radius: 2px;
}
.refresh-container {
.link-container {
width: 90%;
margin: auto;
}
.refresh-container {
width: 49%;
text-align: right;
display: inline-block;
}
.upload-container {
width: 50%;
text-align: left;
display: inline-block;
}
.thumbnail {
object-fit: cover;
Expand Down Expand Up @@ -65,10 +74,15 @@
</div>
{{/if}}
</div>
<div class="refresh-container">
<form>
<button type="submit">Refresh</button>
</form>
<div class="link-container">
<div class="upload-container">
<a href="/{{stage}}/">Upload File</a>
</div>
<div class="refresh-container">
<form>
<button type="submit">Refresh</button>
</form>
</div>
</div>
<table class="table-360">
<tr class="table-header">
Expand Down
1 change: 1 addition & 0 deletions lambda/templates/upload-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<input type="file" name="file"/>
<button type="submit">Submit</button>
</form>
<a href="/{{stage}}/list-objects">List uploaded objects</a>
</div>
</body>
</html>
3 changes: 2 additions & 1 deletion lambda/uploadForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ module.exports.handler = (event, context, callback) => {
callback(error);
} else {
data.fields.key = '${filename}';
body = handlebars.compile(fs.readFileSync(__dirname + '/../templates/upload-form.hbs', 'utf8'))(data);
const templateData = Object.assign({}, data, {stage: process.env.STAGE});
body = handlebars.compile(fs.readFileSync(__dirname + '/../templates/upload-form.hbs', 'utf8'))(templateData);
const response = {
statusCode: 200,
headers: {
Expand Down

0 comments on commit c2163ec

Please sign in to comment.