Initialer Wagon hitobito_kjv 🤖

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
KJV Bautzen 2026-10-07 14:32:02 +02:00
commit d3b74c9030
30 changed files with 1346 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View file

@ -0,0 +1,113 @@
// Copyright (c) 2012-2026, hitobito AG, Kreisjagdverband Bautzen e.V. This file is part of
// hitobito_kjv and licensed under the Affero General Public License version 3
// or later. See the COPYING file at the top-level directory.
// Kopie von hitobito/app/assets/stylesheets/hitobito/customizable/_variables.scss,
// die diese Datei vollständig ersetzt. Nur die Farben sind angepasst. Nach Core-Updates
// prüfen, ob dort neue Variablen hinzugekommen sind.
/* Bootstrap variable definition here */
// KJV-Farben (von www.kreisjagdverband-bautzen.de)
// -------------------------
$kjv-olive: #365902; // Navigation, Kopf- und Fußzeile der Website
$kjv-olive-dark: #2B4702;
$kjv-green: #3C6302; // Link-Hover der Website
$kjv-green-light: #76A60F; // Link- und Akzentfarbe der Website
// Linktext: dunkler als #76A60F, das auf Weiß nur Kontrast 2,9:1 erreicht (WCAG: 4,5:1)
$kjv-green-text: #4F7A0A;
$kjv-yellow: #F2D21B; // Wappen
$kjv-blue: #2C5DAA; // Wappen
// GLOBAL VALUES
// --------------------------------------------------
// Suppress the vast amount of color contrast warnings for now
$min-contrast-ratio: 1;
// Grays
// -------------------------
$black: #474E5D !default;
$gray-darker: #696E79 !default;
$gray-dark: #8b8b8b !default;
$gray: #979CA6 !default;
$gray-light: #E8EBF0 !default;
$gray-lighter: #F8F9FA !default;
$white: #fff !default;
// Colors
// ----------------------------
// $blue ist die Primärfarbe (Buttons), $purple die Farbe für aktive/hover Elemente.
$blue: $kjv-green-text;
$blue-dark: $kjv-olive;
$green: $kjv-green-light;
$green-dark: $kjv-green;
$orange: #DC795B;
$orange-dark: #C75B3B;
$purple: $kjv-green;
$purple-dark: $kjv-olive-dark;
$text-color: $black !default;
$border-color: $gray-light !default;
$page-background: #E6EBDC;
$content-background: #ECEFE6;
$footer-background: $kjv-olive;
$body-background: $kjv-olive;
$focus-color: $kjv-blue;
$shadow-color: darken($page-background, 10%);
$link-color: $kjv-green-text;
$link-hover-color: $kjv-olive;
$footer-color: $white;
$footer-color-hover: $kjv-yellow;
$table-color-hover: #EEF4E0;
// Typography
// -------------------------
$sans-font-family: 'Noto Sans', sans-serif;
$heading-font-family: 'Noto Sans', sans-serif; //'Quicksand', $sans-font-family !default;
$font-family-base: 'Noto Sans', sans-serif; //'Varela Round', $sans-font-family !default;
$headings-font-weight: normal !default; // instead of browser default, bold
// Decoration
// -------------------------
$border-radius: 6px;
// Rhythm
// -------------------------
$v-space: 24px;
// FLUID GRID
// --------------------------------------------------
// Default
// -------------------------
$fluid-grid-column-width: 6.382978723% !default;
$fluid-grid-gutter-width: 2.127659574% !default;
// Portrait tablet to default desktop
// -------------------------
$fluid-grid-column-width-tablet: 5.801104972% !default;
$fluid-grid-gutter-width-tablet: 2.762430939% !default;
// Large desktop and up
// -------------------------
$fluid-grid-column-width-large: 5.982905983% !default;
$fluid-grid-gutter-width-large: 2.564102564% !default;
// RESPONSIVE DESIGN
// --------------------------------------------------
// Media widths
// -------------------------
$media-phone: 480px !default;
$media-tablet: 768px !default;
$media-desktop: 980px !default;
$media-large: 1200px !default; // and upper

View file

@ -0,0 +1,18 @@
// Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of
// hitobito_kjv and licensed under the Affero General Public License version 3
// or later. See the COPYING file at the top-level directory.
// Seitenüberschriften im Grün der Website
.content-header h1 {
color: $kjv-olive;
}
// Gelbe Akzentlinie aus dem Wappen unter dem Kopfbereich
.main-header {
border-bottom: 3px solid $kjv-yellow;
}
#page-footer a:hover,
#page-footer a:focus {
color: $footer-color-hover;
}

View file

@ -0,0 +1,13 @@
# frozen_string_literal: true
# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of
# hitobito_kjv and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory.
module Kjv::PeopleController
extend ActiveSupport::Concern
included do
self.permitted_attrs += Kjv::Person::KJV_ATTRS
end
end

View file

@ -0,0 +1,12 @@
# frozen_string_literal: true
# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of
# hitobito_kjv and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory.
module Kjv::PersonDecorator
# Social-Media-Konten werden beim KJV nicht verwendet und in der Detailansicht ausgeblendet.
def all_social_accounts(*)
"".html_safe
end
end

View file

@ -0,0 +1,20 @@
# frozen_string_literal: true
# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of
# hitobito_kjv and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory.
# Wird in PeopleAddress (Adressliste) und PeopleFull (alle Angaben) eingebunden.
# Die neuen KJV-Felder kommen im Export "alle Angaben" automatisch über die
# Datenbankspalten hinzu.
module Kjv::Export::Tabular::People::PeopleAddress
def person_attributes
super - Kjv::Person::HIDDEN_ATTRS
end
private
def account_attribute_types
super - [SocialAccount]
end
end

View file

@ -0,0 +1,19 @@
# frozen_string_literal: true
# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of
# hitobito_kjv and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory.
# Klassenmethoden von Import::Person: ausgeblendete Felder und Social-Media-Konten
# stehen beim CSV-Import nicht zur Auswahl. Die neuen KJV-Felder kommen automatisch
# über die Datenbankspalten hinzu.
module Kjv::Import::Person
def relevant_attributes
super - Kjv::Person::HIDDEN_ATTRS.map(&:to_s)
end
def fields
social_account_keys = Import::ContactAccountFields.new(SocialAccount).fields.pluck(:key)
super.reject { |field| social_account_keys.include?(field[:key]) }
end
end

View file

@ -0,0 +1,15 @@
# frozen_string_literal: true
# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of
# hitobito_kjv and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory.
module Kjv::StandardFormBuilder
# Social-Media-Konten im Personenformular ausblenden, ohne das Core-Partial
# contactable/_fields zu kopieren. Gruppen behalten das Feld.
def labeled_inline_fields_for(assoc, *args, &block)
return "".html_safe if assoc.to_sym == :social_accounts && object.is_a?(Person)
super
end
end

36
app/models/kjv/person.rb Normal file
View file

@ -0,0 +1,36 @@
# frozen_string_literal: true
# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of
# hitobito_kjv and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory.
module Kjv::Person
extend ActiveSupport::Concern
# Zusätzliche Personenfelder des KJV.
KJV_ATTRS = %i[ljv_membership_number hunter_since joined_on].freeze
# Felder aus dem Core, die beim KJV nicht verwendet werden. Die Spalten bleiben in der
# Datenbank, werden aber in Formular, Detailansicht, Filtern, Export und Import ausgeblendet.
HIDDEN_ATTRS = %i[nickname canton].freeze
included do
Person.used_attributes -= HIDDEN_ATTRS
Person.used_attributes += KJV_ATTRS
Person::FILTER_ATTRS.reject! { |key, _type| HIDDEN_ATTRS.include?(key) }
Person::FILTER_ATTRS.concat(KJV_ATTRS - Person::FILTER_ATTRS)
Person::SEARCHABLE_ATTRS.unshift(:ljv_membership_number) unless
Person::SEARCHABLE_ATTRS.include?(:ljv_membership_number)
self._date_year_validated_attrs += [:hunter_since, :joined_on]
# Leere Eingaben als NULL speichern, damit der eindeutige Index nur echte Nummern prüft.
normalizes :ljv_membership_number, with: ->(value) { value.strip.presence }
validates :ljv_membership_number, uniqueness: {allow_nil: true, case_sensitive: false}
validates :hunter_since, :joined_on,
timeliness: {type: :date, allow_blank: true, before: Date.new(10_000, 1, 1)}
end
end

View file

@ -0,0 +1,5 @@
-# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of
-# hitobito_kjv and licensed under the Affero General Public License version 3
-# or later. See the COPYING file at the top-level directory.
-# Überschreibt das Core-Partial bewusst leer: Das Feld "Kanton" wird beim KJV nicht verwendet.

View file

@ -0,0 +1,5 @@
-# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of
-# hitobito_kjv and licensed under the Affero General Public License version 3
-# or later. See the COPYING file at the top-level directory.
= render_attrs(entry, :ljv_membership_number, :hunter_since, :joined_on)

View file

@ -0,0 +1,9 @@
-# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of
-# hitobito_kjv and licensed under the Affero General Public License version 3
-# or later. See the COPYING file at the top-level directory.
= field_set_tag do
= f.labeled_input_field :ljv_membership_number,
help_inline: t('people.fields_kjv.ljv_membership_number_help')
= f.labeled_input_field :hunter_since, help_inline: t('people.fields_kjv.date_format')
= f.labeled_input_field :joined_on, help_inline: t('people.fields_kjv.date_format')