Skip to content

Commit

Permalink
馃悰 Fix file upload button properties when SD not enabled (#4953)
Browse files Browse the repository at this point in the history
* 馃悰 Fix file upload button properties when SD not enabled

Seemed like a lot of redundant code to just change one class name, so rather than duplicating I've condensed it.

* 馃悰 Fix typo leading to template error

---------

Co-authored-by: Gina H盲u脽ge <gina@octoprint.org>
  • Loading branch information
cp2004 and foosel committed Apr 16, 2024
1 parent f38e6a9 commit 43ed8f4
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/octoprint/templates/sidebar/files.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,17 @@
</span>
</div>
<div class="row-fluid upload-buttons">
<span class="btn btn-primary fileinput-button span{% if enableSdSupport %}6{% else %}12{% endif %}" style="margin-bottom: 10px">
<i class="fas fa-upload"></i>
<span>{{ _('Upload') }}</span>
<input id="gcode_upload" data-test-id="upload-local" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button" multiple>
</span>
{% if enableSdSupport %}
<span class="btn btn-primary fileinput-button span6" style="margin-bottom: 10px">
<i class="fas fa-upload"></i>
<span>{{ _('Upload') }}</span>
<input id="gcode_upload" data-test-id="upload-local" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button" multiple>
</span>
<span class="btn btn-primary fileinput-button span6" data-bind="enable: $root.isSdReady() && !$root.isPrinting(), css: {disabled: !$root.isSdReady() || $root.isPrinting()}" style="margin-bottom: 10px">
<i class="fas fa-upload"></i>
<span>{{ _('Upload to SD') }}</span>
<input id="gcode_upload_sd" data-test-id="upload-sd" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button" data-bind="enable: isSdReady()">
</span>
{% else %}
<span class="btn btn-primary fileinput-button span12" style="margin-bottom: 10px">
<i class="icon-upload-alt icon-white"></i>
<span>{{ _('Upload') }}</span>
<input id="gcode_upload" data-test-id="upload-local" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button">
</span>
<i class="fas fa-upload"></i>
<span>{{ _('Upload to SD') }}</span>
<input id="gcode_upload_sd" data-test-id="upload-sd" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button" data-bind="enable: isSdReady()">
</span>
{% endif %}
</div>
<div id="gcode_upload_progress" class="progress progress-text-centered">
Expand Down

0 comments on commit 43ed8f4

Please sign in to comment.