Skip to content

Commit

Permalink
fix: Refactor file upload components and simplify CSS styles
Browse files Browse the repository at this point in the history
- Replaced uppy with a simple form with a file input and a preview template.
- Updated CSS styles to simplify styling and remove unnecessary code.
  • Loading branch information
frankpagan committed Jun 22, 2023
1 parent 086284d commit 52f2671
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 26 deletions.
31 changes: 18 additions & 13 deletions src/builder/components/left-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@
class="builder-tab-round"
selected-value="active"
selected-target="#uploader"
selected-group="left-panels"
toggle="uppy"
toggle-target="#uppy"
toggle-attribute="uploader">
selected-group="left-panels">
<i
class="height:16px fill:#505050"
src="/assets/svg/cloud-upload-alt.svg"></i>
Expand Down Expand Up @@ -265,15 +262,23 @@

<!-- uploader -->
<div id="uploader" class="left-panel display:none">
<style>
.uppy-Dashboard-inner {
background-color: whitesmoke !important;
}
.uppy-DashboardTab-btn {
justify-content: flex-start;
}
</style>
<div id="uppy" uploader="uppy" collection="files"></div>
<form>
<input
type="file"
directory
template_id="file-preview"
collection="files" />

<button actions="upload">upload</button>
</form>

<div template="file-preview">
<input file="name" value="{{name}}" />
<input file="directory" value="{{directory}}" />
<input file="content-type" value="{{content-type}}" />

<textarea file="src" value-type="string">{{src}}</textarea>
</div>
</div>

<!-- Files -->
Expand Down
8 changes: 0 additions & 8 deletions src/builder/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ a {
display: block
}

.uppy-Dashboard-inner {
background-color: whitesmoke!important;
}

.uppy-DashboardTab-btn {
justify-content: flex-start;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
opacity: 1;
Expand Down
24 changes: 19 additions & 5 deletions src/files/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,25 @@ <h4>{{document.name}}</h4>
</floating-label>
</div>
<div id="uploader" class="uploader" hidden>
<div
uploader="uppy"
collection="files"
document_id=""
pass_id="form-fields"></div>
<form>
<input
type="file"
directory
template_id="file-preview"
collection="files" />

<button actions="upload">upload</button>
</form>

<div template="file-preview">
<input file="name" value="{{name}}" />
<input file="directory" value="{{directory}}" />
<input file="content-type" value="{{content-type}}" />

<textarea file="src" value-type="string">
{{src}}
</textarea>
</div>
</div>
<button
show=".uploader, .form-fields"
Expand Down

0 comments on commit 52f2671

Please sign in to comment.