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 exporter page for Bootstrap 3 applications #928

Merged
merged 1 commit into from
Feb 19, 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
8 changes: 4 additions & 4 deletions app/assets/javascripts/bulkrax/exporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ function removeRequired(allSources) {

// hide all export_source
function hide(allSources) {
allSources.addClass('d-none');
allSources.find('#exporter_export_source').addClass('.d-none').attr('type', 'd-none');
allSources.addClass('d-none hidden');
allSources.find('#exporter_export_source').addClass('.d-none hidden').attr('type', 'd-none hidden');
}

// unhide selected export_source
function unhideSelected(selectedSource) {
selectedSource.removeClass('d-none').removeAttr('type');
selectedSource.parent().removeClass('d-none').removeAttr('type');
selectedSource.removeClass('d-none hidden').removeAttr('type');
selectedSource.parent().removeClass('d-none hidden').removeAttr('type');
};

// add the autocomplete javascript
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/bulkrax/datatables_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def importer_util_links(i)
def exporter_util_links(i)
links = []
links << view_context.link_to(view_context.raw('<span class="glyphicon glyphicon-info-sign"></span>'), exporter_path(i))
links << view_context.link_to(view_context.raw('<span class="glyphicon glyphicon-pencil"></span>'), edit_exporter_path(i))
links << view_context.link_to(view_context.raw('<span class="glyphicon glyphicon-pencil"></span>'), edit_exporter_path(i), data: { turbolinks: false })
links << view_context.link_to(view_context.raw('<span class="glyphicon glyphicon-remove"></span>'), i, method: :delete, data: { confirm: 'Are you sure?' })
links.join(" ")
end
Expand Down
20 changes: 10 additions & 10 deletions app/views/bulkrax/exporters/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@
label: t('bulkrax.exporter.labels.importer'),
required: true,
prompt: 'Select from the list',
label_html: { class: 'importer export-source-option d-none' },
input_html: { class: 'importer export-source-option d-none form-control' },
label_html: { class: 'importer export-source-option d-none hidden' },
input_html: { class: 'importer export-source-option d-none hidden form-control' },
collection: form.object.importers_list.sort %>

<%= form.input :export_source_collection,
prompt: 'Start typing ...',
label: t('bulkrax.exporter.labels.collection'),
required: true,
placeholder: @collection&.title&.first,
label_html: { class: 'collection export-source-option d-none' },
label_html: { class: 'collection export-source-option d-none hidden' },
input_html: {
class: 'collection export-source-option d-none form-control',
class: 'collection export-source-option d-none hidden form-control',
data: {
'autocomplete-url' => '/authorities/search/collections',
'autocomplete' => 'collection'
Expand All @@ -56,8 +56,8 @@
label: t('bulkrax.exporter.labels.worktype'),
required: true,
prompt: 'Select from the list',
label_html: { class: 'worktype export-source-option d-none' },
input_html: { class: 'worktype export-source-option d-none form-control' },
label_html: { class: 'worktype export-source-option d-none hidden' },
input_html: { class: 'worktype export-source-option d-none hidden form-control' },
collection: Bulkrax.curation_concerns.map { |cc| [cc.to_s, cc.to_s] } %>

<%= form.input :limit,
Expand All @@ -80,7 +80,7 @@
as: :boolean,
label: t('bulkrax.exporter.labels.filter_by_date') %>

<div id="date_filter_picker" class="d-none">
<div id="date_filter_picker" class="d-none hidden">
<%= form.input :start_date,
as: :date,
label: t('bulkrax.exporter.labels.start_date'),
Expand Down Expand Up @@ -136,13 +136,13 @@
// get the date filter option and show the corresponding date selectors
$('.exporter_date_filter').change(function () {
if ($('.exporter_date_filter').find(".boolean").is(":checked"))
$('#date_filter_picker').removeClass('d-none');
$('#date_filter_picker').removeClass('d-none hidden');
else
$('#date_filter_picker').addClass('d-none');
$('#date_filter_picker').addClass('d-none hidden');
});

if ($('.exporter_date_filter').find(".boolean").is(":checked"))
$('#date_filter_picker').removeClass('d-none');
$('#date_filter_picker').removeClass('d-none hidden');
});
});
</script>
Loading