Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix blueimp file upload progress bars #6735

Merged
merged 1 commit into from
Mar 29, 2024
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
6 changes: 6 additions & 0 deletions app/assets/stylesheets/hyrax/_file_upload.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@
padding-bottom: 10px;
}
}

// fix blueimp jQuery-File-Upload display problems under Bootstrap 4+
// found here: https://stackoverflow.com/a/48162651
.fade.in {
opacity: 1
}
18 changes: 9 additions & 9 deletions app/views/hyrax/uploads/_js_templates.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!-- The template to display files available for upload -->
<% fade_class_if_not_test = Rails.env.test? ? 'show' : 'fade show' %>
<% fade_class_if_not_test = Rails.env.test? ? '' : 'fade' %>
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload <%= fade_class_if_not_test %>">
<span>
<td>
<span class="preview"></span>
</span>
<span>
</td>
<td>
<p class="name">{%=file.name%}</p>
<strong class="error text-danger"></strong>
</span>
<span>
</td>
<td>
<p class="size">Processing...</p>
<div class="progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-striped progress-bar-animated bg-success" style="width:0%;"></div></div>
</span>
<span class="text-right">
</td>
<td class="text-right">
{% if (!i && !o.options.autoUpload) { %}
<button class="btn btn-primary start" disabled>
<span class="fa fa-upload"></span>
Expand All @@ -27,7 +27,7 @@
<span><%= t('helpers.action.cancel') %></span>
</button>
{% } %}
</span>
</td>
</tr>
{% } %}
</script>
Expand Down
6 changes: 3 additions & 3 deletions app/views/hyrax/uploads/_js_templates_branding.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade show">
<tr class="template-upload fade">
<td>
<span class="preview"></span>
</td>
Expand Down Expand Up @@ -37,7 +37,7 @@
<!-- The template to display the banner once upload is complete -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<span class="template-download fade show">
<span class="template-download fade">
<div id="banner">
<div class="row branding-banner-row">
<div class="col-sm-3">
Expand Down Expand Up @@ -69,7 +69,7 @@
<!-- The template to display logo in the table once upload is complete -->
<script id="logo-template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<span class="template-download fade show">
<span class="template-download fade">
<div class="row branding-logo-row">
<div class="col-sm-3">
<span class="preview">
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/uploads/_js_templates_versioning.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- The template to display files available for upload -->
<% fade_class_if_not_test = Rails.env.test? ? 'show' : 'fade show' %>
<% fade_class_if_not_test = Rails.env.test? ? '' : 'fade' %>
<script id="versioning-template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload <%= fade_class_if_not_test %>">
Expand Down