Skip to content

Commit 7b42222

Browse files
authored
Merge branch 'master' into issue-2445
2 parents 2d88de5 + e1b7f3f commit 7b42222

11 files changed

Lines changed: 1887 additions & 49 deletions

File tree

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ gem 'pagy', '~> 43.2'
4949
gem 'icalendar'
5050
gem 'tzinfo-data'
5151

52-
gem 'chosen-rails', github: 'olleolleolle/chosen-rails', branch: 'support-rails-8'
52+
# Chosen JavaScript and CSS loaded from vendor/assets/ instead of gem
53+
# The chosen-rails gem has broken CoffeeScript compilation on Rails 8.1
5354
gem 'commonmarker'
5455

5556
gem 'faraday'

Gemfile.lock

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ GIT
66
sitemap_generator (6.3.0)
77
builder (~> 3.0)
88

9-
GIT
10-
remote: https://github.com/olleolleolle/chosen-rails.git
11-
revision: cfef31cb30ed6d0dfd65cae0ff6f4a2943812df0
12-
branch: support-rails-8
13-
specs:
14-
chosen-rails (2.0.0)
15-
coffee-rails (>= 3.2)
16-
dartsass-rails (>= 0.5.0)
17-
railties (>= 3.0)
18-
199
GEM
2010
remote: https://rubygems.org/
2111
specs:
@@ -164,13 +154,6 @@ GEM
164154
logger (~> 1.5)
165155
cocoon (1.2.15)
166156
coderay (1.1.3)
167-
coffee-rails (5.0.0)
168-
coffee-script (>= 2.2.0)
169-
railties (>= 5.2.0)
170-
coffee-script (2.4.1)
171-
coffee-script-source
172-
execjs
173-
coffee-script-source (1.12.2)
174157
commonmarker (2.6.3-aarch64-linux)
175158
commonmarker (2.6.3-arm64-darwin)
176159
commonmarker (2.6.3-x86_64-darwin)
@@ -184,9 +167,6 @@ GEM
184167
css_parser (1.14.0)
185168
addressable
186169
csv (3.3.5)
187-
dartsass-rails (0.5.1)
188-
railties (>= 6.0.0)
189-
sass-embedded (~> 1.63)
190170
database_cleaner (2.1.0)
191171
database_cleaner-active_record (>= 2, < 3)
192172
database_cleaner-active_record (2.2.2)
@@ -234,18 +214,6 @@ GEM
234214
activerecord (>= 4.0.0)
235215
globalid (1.3.0)
236216
activesupport (>= 6.1)
237-
google-protobuf (4.33.2-aarch64-linux-gnu)
238-
bigdecimal
239-
rake (>= 13)
240-
google-protobuf (4.33.2-arm64-darwin)
241-
bigdecimal
242-
rake (>= 13)
243-
google-protobuf (4.33.2-x86_64-darwin)
244-
bigdecimal
245-
rake (>= 13)
246-
google-protobuf (4.33.2-x86_64-linux-gnu)
247-
bigdecimal
248-
rake (>= 13)
249217
haml (7.2.0)
250218
temple (>= 0.8.2)
251219
thor
@@ -544,14 +512,6 @@ GEM
544512
ruby-vips (2.3.0)
545513
ffi (~> 1.12)
546514
logger
547-
sass-embedded (1.97.0-aarch64-linux-gnu)
548-
google-protobuf (~> 4.31)
549-
sass-embedded (1.97.0-arm64-darwin)
550-
google-protobuf (~> 4.31)
551-
sass-embedded (1.97.0-x86_64-darwin)
552-
google-protobuf (~> 4.31)
553-
sass-embedded (1.97.0-x86_64-linux-gnu)
554-
google-protobuf (~> 4.31)
555515
sassc (2.4.0)
556516
ffi (~> 1.9)
557517
sassc-rails (2.1.2)
@@ -655,7 +615,6 @@ DEPENDENCIES
655615
capybara-playwright-driver
656616
carrierwave
657617
carrierwave-aws (~> 1.6)
658-
chosen-rails!
659618
cocoon
660619
commonmarker
661620
csv

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ Before you start, you will need to have Docker installed and running. You can [d
6868

6969
Run `bin/dup` to build and create the docker container. This will also set up the Rails application within the container and start the container. You will only have to run this command once. After initial setup, use `bin/dstart` to start an existing container - using `bin/dup` will recreate an existing container and reset the database.
7070

71+
**Note:** The Docker setup includes ImageMagick automatically. If you're using native installation, you must install ImageMagick separately (see [native-installation-instructions.md](./native-installation-instructions.md)).
72+
7173
### 4. Start the app
7274

7375
Run `bin/dserver` to start the Rails server.

app/assets/javascripts/application.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
1111
// about supported directives.
1212
//
13+
//= require jquery
1314
//= require popper
1415
//= require bootstrap
15-
//= require jquery
1616
//= require rails-ujs
1717
//= require activestorage
18-
//= require chosen-jquery
18+
//= require chosen.jquery
1919
//= require 'jsimple-star-rating.min.js'
2020
//= require pickadate/picker
2121
//= require pickadate/picker.date
@@ -57,12 +57,12 @@ $(function() {
5757
}).show();
5858
});
5959

60-
$('select').chosen(function(){
61-
allow_single_deselect: true
60+
$('select').chosen({
61+
allow_single_deselect: true,
6262
no_results_text: 'No results matched'
6363
});
6464

65-
$('#member_lookup_id').chosen().change(function(e) {
65+
$('#member_lookup_id').change(function(e) {
6666
$('#view_profile').attr('href', '/admin/members/' + $(this).val())
6767
});
6868

app/views/admin/members/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
%h1 Members Directory
55
.row.mb-4
66
.col-12.col-md-6
7-
= select_tag 'member_lookup_id', options_for_select(@members.collect{ |u| ["#{u.full_name} (#{u.email})", u.id] }), { class: 'chosen-select' }
7+
= select_tag 'member_lookup_id', options_for_select([['Select a member...', '']] + @members.collect{ |u| ["#{u.full_name} (#{u.email})", u.id] }), { class: 'chosen-select' }
88
.row
99
.col
1010
= link_to 'View Profile', '#', { class: 'btn btn-primary', id: 'view_profile' }

db/seeds.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
if Rails.env.development?
2+
# Check for ImageMagick before seeding
3+
imagemagick_available = system('convert --version > /dev/null 2>&1') ||
4+
system('magick --version > /dev/null 2>&1')
5+
6+
unless imagemagick_available
7+
Rails.logger.error "=" * 80
8+
Rails.logger.error "ERROR: ImageMagick is required to run db:seed"
9+
Rails.logger.error "=" * 80
10+
Rails.logger.error ""
11+
Rails.logger.error "The seed task processes sponsor logo images, which requires ImageMagick."
12+
Rails.logger.error ""
13+
Rails.logger.error "Install ImageMagick:"
14+
Rails.logger.error " macOS: brew install imagemagick"
15+
Rails.logger.error " Ubuntu/Debian: apt-get install imagemagick"
16+
Rails.logger.error " Windows: https://imagemagick.org/script/download.php"
17+
Rails.logger.error ""
18+
Rails.logger.error "See native-installation-instructions.md for details."
19+
Rails.logger.error "=" * 80
20+
exit 1
21+
end
22+
223
begin
324
Rails.logger.info 'Running migrations...'
425
Rails.application.config.log_level = :info

native-installation-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ brew install postgresql
4747
brew services start postgresql
4848
```
4949

50-
Install other dependencies:
50+
Install required dependencies:
5151
```
5252
brew install imagemagick
5353
```
538 Bytes
Loading
738 Bytes
Loading

0 commit comments

Comments
 (0)