Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Folders #6

Merged
merged 2 commits into from
Mar 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/elements/secret-create.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
<section>
CREATE SECRET
<paper-material elevation="1">
<paper-input label="Location" value="{{location}}"></paper-input>
<paper-input label="Location" value="{{createLocation}}"></paper-input>
<paper-input label="Value" value="{{stringValue}}"></paper-input>
<paper-button on-tap="createSecret">Submit</paper-button>
</paper-material>
</section>
<section>
FILE
<paper-input label="Location" value="{{location}}"></paper-input>
<paper-input label="Location" value="{{createLocation}}"></paper-input>
<granite-file-reader read-as="dataURL" on-file-read="_fileUpload">
<paper-button raised>
Upload File
Expand All @@ -75,7 +75,7 @@
properties: {
secrets: Object,
header: String,
location: {
createLocation: {
type: String,
value: '',
observer: 'watchLocation'
Expand All @@ -91,8 +91,8 @@
}
},
watchLocation: function() {
if (this.location !== '') {
this.secretURL = app.url + 'v1/' + this.location;
if (this.createLocation !== '') {
this.secretURL = app.url + 'v1/' + this.createLocation;
this.debounce('checkLocation', function () {
this.$.getSecret.generateRequest();
// Todo: Create more feedback here
Expand Down Expand Up @@ -126,4 +126,4 @@
}
});
</script>
</dom-module>
</dom-module>
48 changes: 44 additions & 4 deletions app/elements/secret-folder.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,59 @@

<dom-module id="secret-folder">
<style>

.flex {
@apply(--layout-flex);
}
.center {
height: calc(100vh - 64px);
@apply(--layout-horizontal);
@apply(--layout-center-center);
}
.horizontal {
@apply(--layout-horizontal);
}
.vertical {
@apply(--layout-vertical);
}
.shaded {
color: rgba(56, 67, 81, 0.65);
}
#folder {
color: rgba(56, 67, 81, 0.14);
width: 250px;
height: 250px;
}
</style>
<template>
Location: {{location}}
<div class="flex">
<div class="center">
<div class="vertical center">
<iron-icon id="folder" icon="folder-open"></iron-icon>
<div>
<paper-button class="shaded" on-tap="_create" raised>Create Secret Here</paper-button>
</div>
</div>
<!-- <div>
</div> -->
</div>
</div>
</template>

<script>
Polymer({
is: "secret-folder",
properties: {
secrets: Object,
location: String
location: String,
createLocation: {
notify: true,
value: ''
}
},
_create: function() {
this.createLocation = this.location;
page('/create');
}
});
</script>
</dom-module>
</dom-module>
27 changes: 18 additions & 9 deletions app/elements/secret-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
background-color: var(--accent-color);
min-width: 95px;
}
a {
color: black;
text-decoration: none;
}

</style>
<template>
<iron-ajax id="getSecret"
Expand Down Expand Up @@ -83,9 +88,9 @@ <h2>Delete?</h2>

<div class="flex">
<div class="center">
<paper-material class="items">
<paper-button on-tap="_confirmDelete">Delete</paper-button>
<paper-button on-tap="_updateKey">Update</paper-button>
<div>
<paper-button on-tap="_confirmDelete" raised>Delete</paper-button>
<paper-button on-tap="_updateKey" raised>Update</paper-button>
<div class="horizontal">
<paper-item>Location:</paper-item>
<paper-item>{{location}}</paper-item>
Expand All @@ -107,17 +112,21 @@ <h2>Delete?</h2>
</template>
</section>
<section>
<a download$="{{response.data.filename}}" href$="{{response.data.data}}">{{response.data.filename}}</a>
<granite-file-reader read-as="dataURL" on-file-read="_fileUpload">
{{response.data.filename}}
<a download$="{{response.data.filename}}" href$="{{response.data.data}}">
<paper-button raised>
Download
</paper-button>
</a>
<!-- <granite-file-reader read-as="dataURL" on-file-read="_fileUpload">
<paper-button raised>
Upload File
</paper-button>
</granite-file-reader>
</granite-file-reader> -->
</section>
<section></section>
</iron-pages>

</paper-material>
</div>
</div>
</div>
</template>
Expand Down Expand Up @@ -232,4 +241,4 @@ <h2>Delete?</h2>
}
});
</script>
</dom-module>
</dom-module>
4 changes: 2 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ <h2 class="page-title">Dashboard</h2>
<section data-route="create">
<paper-material elevation="1">
<h2 class="page-title">Create</h2>
<secret-create header="{{header}}"></secret-create>
<secret-create header="{{header}}" create-location="{{createLocation}}"></secret-create>
</paper-material>
</section>

<template is="dom-repeat" items="{{secrets}}" filter="filterFolders">
<section data-route="{{item.type}}/{{item.location}}" style="height: 100%">
<secret-folder secrets={{secrets}} header="{{header}}" route="{{route}}" location="{{item.location}}"></secret-folder>
<secret-folder secrets={{secrets}} header="{{header}}" route="{{route}}" location="{{item.location}}" create-location="{{createLocation}}"></secret-folder>
</section>
</template>

Expand Down