Skip to content

Commit 8ac0493

Browse files
authored
Merge branch 'dev' into feature/github-integration
Signed-off-by: Robert Smith <[email protected]>
2 parents 71a142d + b7c0c68 commit 8ac0493

File tree

61 files changed

+2546
-1157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2546
-1157
lines changed

.rubocop.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ AllCops:
22
Exclude:
33
- 'bin/*'
44
- 'node_modules/**/*'
5-
- 'spec/dummy/db/schema.rb'
5+
# - 'spec/dummy/db/schema.rb'
66
- 'vendor/**/*'
77
NewCops: enable
8-
Style/StringLiterals:
9-
Exclude:
10-
- 'db/migrate/*'
8+
# Style/StringLiterals:
9+
# Exclude:
10+
# - 'db/migrate/*'

Gemfile.lock

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ PATH
2424
active_storage_validations
2525
activerecord-import
2626
activerecord-postgis-adapter
27+
acts_as_tenant
2728
bootstrap (~> 5.3.2)
2829
dartsass-sprockets (~> 3.1)
2930
devise
@@ -117,7 +118,7 @@ GEM
117118
rails-html-sanitizer (~> 1.6)
118119
active_storage_svg_sanitizer (0.1.0)
119120
rails (>= 5.2)
120-
active_storage_validations (1.4.0)
121+
active_storage_validations (2.0.2)
121122
activejob (>= 6.1.4)
122123
activemodel (>= 6.1.4)
123124
activestorage (>= 6.1.4)
@@ -156,6 +157,8 @@ GEM
156157
mutex_m
157158
securerandom (>= 0.3)
158159
tzinfo (~> 2.0)
160+
acts_as_tenant (1.0.1)
161+
rails (>= 6.0)
159162
addressable (2.8.7)
160163
public_suffix (>= 2.0.2, < 7.0)
161164
asset_sync (2.19.2)
@@ -424,7 +427,7 @@ GEM
424427
logger
425428
mime-types-data (~> 3.2015)
426429
mime-types-data (3.2025.0107)
427-
mini_magick (5.1.2)
430+
mini_magick (5.2.0)
428431
benchmark
429432
logger
430433
mini_mime (1.1.5)
@@ -450,7 +453,7 @@ GEM
450453
net-protocol
451454
net-protocol (0.2.2)
452455
timeout
453-
net-smtp (0.5.0)
456+
net-smtp (0.5.1)
454457
net-protocol
455458
nio4r (2.7.4)
456459
nokogiri (1.18.3-x86_64-linux-gnu)
@@ -511,7 +514,7 @@ GEM
511514
pundit (2.4.0)
512515
activesupport (>= 3.0.0)
513516
racc (1.8.1)
514-
rack (3.1.10)
517+
rack (3.1.11)
515518
rack-cors (2.0.2)
516519
rack (>= 2.0.0)
517520
rack-mini-profiler (3.3.1)
@@ -661,11 +664,11 @@ GEM
661664
ffi (~> 1.12)
662665
logger
663666
rubyzip (2.4.1)
664-
sass-embedded (1.83.4-x86_64-linux-gnu)
667+
sass-embedded (1.85.1-x86_64-linux-gnu)
665668
google-protobuf (~> 4.29)
666669
sassc (2.4.0)
667670
ffi (~> 1.9)
668-
sassc-embedded (1.80.1)
671+
sassc-embedded (1.80.4)
669672
sass-embedded (~> 1.80)
670673
sawyer (0.9.2)
671674
addressable (>= 2.3.5)
@@ -716,7 +719,7 @@ GEM
716719
stackprof (0.2.27)
717720
stimulus-rails (1.3.4)
718721
railties (>= 6.0.0)
719-
stringio (3.1.2)
722+
stringio (3.1.5)
720723
sync (0.5.0)
721724
term-ansicolor (1.11.2)
722725
tins (~> 1.0)
@@ -733,17 +736,17 @@ GEM
733736
trailblazer-option (0.1.2)
734737
translate_enum (0.2.0)
735738
activesupport
736-
turbo-rails (2.0.11)
737-
actionpack (>= 6.0.0)
738-
railties (>= 6.0.0)
739+
turbo-rails (2.0.13)
740+
actionpack (>= 7.1.0)
741+
railties (>= 7.1.0)
739742
tzinfo (2.0.6)
740743
concurrent-ruby (~> 1.0)
741744
uber (0.1.0)
742745
uglifier (4.2.1)
743746
execjs (>= 0.3.0, < 3)
744747
unf (0.2.0)
745748
unicode-display_width (2.6.0)
746-
uri (1.0.2)
749+
uri (1.0.3)
747750
version_gem (1.1.4)
748751
virtus (2.0.0)
749752
axiom-types (~> 0.1)
@@ -768,7 +771,7 @@ GEM
768771
websocket-extensions (0.1.5)
769772
xpath (3.2.0)
770773
nokogiri (~> 1.8)
771-
zeitwerk (2.7.1)
774+
zeitwerk (2.7.2)
772775

773776
PLATFORMS
774777
x86_64-linux

app/assets/stylesheets/better_together/theme.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
// New to NL colour palette
2+
$blue-1: #004BA8;
3+
$blue-2: #3E78B2;
4+
$beige: #EAF0CE;
5+
$teal: #5a8f9b;
6+
$beige-light: lighten($beige, 10%);
7+
$green-2: #70A288;
8+
$green-1: #42b983; // variant
9+
10+
// Override the color variables in the host application
11+
$primary: $green-1; /* Change to a different blue */
12+
$secondary: $green-2; /* Change to a different green */
13+
$success: $green-2;
14+
$info: $green-1;
15+
$warning: #C9B947;
16+
$danger: #BF4A47;
17+
$text-opposite-theme-color: #222; /* Darker text */
18+
$background-opposite-theme-color: #f0f0f0; /* Lighter background */
19+
$light-background-text-color: #222;
20+
$dark-background-text-color: #f0f0f0;
21+
122
@import "bootstrap/functions";
223
@import "bootstrap/variables";
324

app/controllers/better_together/pages_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ module BetterTogether
55
class PagesController < FriendlyResourceController # rubocop:todo Metrics/ClassLength
66
before_action :set_page, only: %i[show edit update destroy]
77

8+
skip_before_action :check_platform_setup, unless: -> { ::BetterTogether::Platform.where(host: true).any? }
9+
810
before_action only: %i[new edit], if: -> { Rails.env.development? } do
911
# Make sure that all BLock subclasses are loaded in dev to generate new block buttons
1012
BetterTogether::Content::Block.load_all_subclasses
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# frozen_string_literal: true
2+
3+
module BetterTogether
4+
# CRUD for Seed records
5+
class SeedsController < ApplicationController
6+
before_action :set_seed, only: %i[show edit update destroy]
7+
8+
# GET /seeds
9+
def index
10+
@seeds = Seed.all
11+
end
12+
13+
# GET /seeds/1
14+
def show; end
15+
16+
# GET /seeds/new
17+
def new
18+
@seed = Seed.new
19+
end
20+
21+
# GET /seeds/1/edit
22+
def edit; end
23+
24+
# POST /seeds
25+
def create
26+
@seed = Seed.new(seed_params)
27+
28+
if @seed.save
29+
redirect_to @seed, notice: 'Seed was successfully created.'
30+
else
31+
render :new, status: :unprocessable_entity
32+
end
33+
end
34+
35+
# PATCH/PUT /seeds/1
36+
def update
37+
if @seed.update(seed_params)
38+
redirect_to @seed, notice: 'Seed was successfully updated.', status: :see_other
39+
else
40+
render :edit, status: :unprocessable_entity
41+
end
42+
end
43+
44+
# DELETE /seeds/1
45+
def destroy
46+
@seed.destroy!
47+
redirect_to seeds_url, notice: 'Seed was successfully destroyed.', status: :see_other
48+
end
49+
50+
private
51+
52+
# Use callbacks to share common setup or constraints between actions.
53+
def set_seed
54+
@seed = Seed.find(params[:id])
55+
end
56+
57+
# Only allow a list of trusted parameters through.
58+
def seed_params
59+
params.fetch(:seed, {})
60+
end
61+
end
62+
end

app/controllers/concerns/better_together/wizard_methods.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def determine_wizard_outcome # rubocop:todo Metrics/AbcSize
1616

1717
if wizard.completed?
1818
flash[:notice] = wizard.success_message
19+
# TODO: This needs to be adjusted for private platforms. Flash message is not retained after wizard completion
1920
redirect_to wizard.success_path
2021
else
2122
next_step_path, flash_key, message = wizard_next_step_info

app/helpers/better_together/form_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def language_select_field(form: nil, field_name: :locale, selected_locale: I18n.
2323

2424
def locale_options_for_select(selected_locale = I18n.locale)
2525
options_for_select(
26-
I18n.available_locales.map { |locale| [I18n.t("locales.#{locale}", locale:), locale] },
26+
I18n.available_locales.map { |locale| [I18n.t("better_together.languages.#{locale}", locale:), locale] },
2727
selected_locale
2828
)
2929
end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
module BetterTogether
4+
module SeedsHelper # rubocop:todo Style/Documentation
5+
end
6+
end

app/helpers/better_together/translatable_fields_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def tab_button(locale, unique_locale_attribute, translation_present) # rubocop:t
4040
type: 'button',
4141
aria: { controls: "#{unique_locale_attribute}-field",
4242
selected: locale.to_s == I18n.locale.to_s }) do
43-
(t("locales.#{locale}") + translation_indicator(translation_present)).html_safe
43+
(t("better_together.languages.#{locale}") + translation_indicator(translation_present)).html_safe
4444
end
4545
end
4646

@@ -73,7 +73,7 @@ def dropdown_menu(_attribute, locale, unique_locale_attribute, base_url) # ruboc
7373
content_tag(:ul, class: 'dropdown-menu') do
7474
I18n.available_locales.reject { |available_locale| available_locale == locale }.map do |available_locale|
7575
content_tag(:li) do
76-
link_to "AI Translate from #{I18n.t("locales.#{available_locale}")}", '#ai-translate',
76+
link_to "AI Translate from #{I18n.t("better_together.languages.#{available_locale}")}", '#ai-translate',
7777
class: 'dropdown-item',
7878
data: {
7979
'better_together--translation-target' => 'aiTranslate',
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Controller } from "stimulus"
2+
3+
export default class extends Controller {
4+
static targets = [ "select" ]
5+
6+
connect() {
7+
// Called when the controller is initialized and the element is in the DOM
8+
const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
9+
10+
if (this.hasSelectTarget) {
11+
const options = this.selectTarget.options;
12+
for (let i = 0; i < options.length; i++) {
13+
if (options[i].value === userTimeZone) {
14+
this.selectTarget.selectedIndex = i;
15+
break;
16+
}
17+
}
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)