Skip to content

Upgrade to Bootstrap v5 #780

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

Merged
merged 24 commits into from
Mar 22, 2025
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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ gem 'active_storage_validations', '~> 1.1.3'

# Assets
gem 'jquery-rails', '~> 4.4.0'
gem 'bootstrap-sass', '~> 3.4'
gem 'bootstrap', '~> 5.3.3'
gem 'sassc-rails', '~> 2.1.2'
gem 'select2-rails', '~> 4.0.13'

Expand Down
9 changes: 5 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ GEM
bindex (0.8.1)
bootsnap (1.18.4)
msgpack (~> 1.2)
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
bootstrap (5.3.3)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 2.11.8, < 3)
builder (3.3.0)
byebug (11.1.3)
capybara (3.40.0)
Expand Down Expand Up @@ -261,6 +261,7 @@ GEM
pg_search (2.3.7)
activerecord (>= 6.1)
activesupport (>= 6.1)
popper_js (2.11.8)
prawn (2.5.0)
matrix (~> 0.4)
pdf-core (~> 0.10.0)
Expand Down Expand Up @@ -448,7 +449,7 @@ DEPENDENCIES
activeadmin (~> 2.14)
aws-sdk-s3 (~> 1.94)
bootsnap (~> 1.12)
bootstrap-sass (~> 3.4)
bootstrap (~> 5.3.3)
byebug (~> 11.0)
capybara (~> 3.29)
database_cleaner (~> 2.0)
Expand Down
1 change: 1 addition & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//= link_tree ../images
//= link_tree ../fonts
//= link_directory ../stylesheets .css
//= link_directory ../javascripts .js
Binary file added app/assets/fonts/glyphicons-halflings-regular.eot
Binary file not shown.
288 changes: 288 additions & 0 deletions app/assets/fonts/glyphicons-halflings-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/fonts/glyphicons-halflings-regular.ttf
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ $(document).on('click', 'a[data-popup]', function(event) {
window.open($(this).attr('href'), 'popup', 'width=800,height=600');
});

$(document).on('click', 'a[data-remote][data-bs-toggle="modal"]', async function(event) {
event.preventDefault();
const url = event.currentTarget.href;
const target = event.currentTarget.dataset.bsTarget;
const response = await fetch(url);
const html = await response.text();

document.querySelector(target).querySelector('.modal-content').innerHTML = html;
});

$(document).on('click', 'span.show-password', function(event) {
event.preventDefault();

Expand Down
5 changes: 2 additions & 3 deletions app/assets/javascripts/application/avatar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
$(function () {
$('#avatar-js').on("change", () => {
$('#dialog').modal({
show: true
});
const modal = new bootstrap.Modal(document.getElementById('dialog'));
modal.show();

preview_image_modal();

Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/application/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ $(function() {
$('.alpha_tag_list').html(data);
}
});
document.querySelector('.switch-tags-js .active').classList.remove('active');
document.querySelector(`.switch_${type == 'user' ? 'member' : type}-js`).classList.add('active');
}

$('#tags-js').select2({
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/libs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//= require jquery2
//= require jquery_ujs
//= require vendor/jquery.validate
//= require popper
//= require bootstrap
//= require vendor/highcharts
//= require vendor/highcharts-exporting
Expand Down
4 changes: 1 addition & 3 deletions app/assets/stylesheets/active_admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ $table-stripe-color: #f5f5f5;
@import "active_admin/mixins";
@import "active_admin/base";
@import "select2";
@import "bootstrap-sprockets";
@import "bootstrap/variables";
@import "bootstrap/glyphicons";
@import "application/glyphicons";

.global_stats_panel div {
display: flex;
Expand Down
Loading
Loading