Skip to content
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
18 changes: 13 additions & 5 deletions app/controllers/admin/activities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,19 @@ def weekoverzicht(locale)
header = "\n*#{ t('admin.activities.weekoverzicht.borrel', locale: locale) }*"
borrels = Activity.where("start_date >= ? AND start_date <= ? \
AND is_borrel = TRUE", week_start, week_start + 7.days)
res += if borrels.empty?
"#{ header }\n#{ t('admin.activities.weekoverzicht.no_borrel', locale: locale) }"
else
header + "\n#{ locale == :nl ? 'Op' : 'On' } #{ l(borrels[0].start_date, format: '%A', locale: locale) }!"
end
if borrels.empty?
res += "#{ header }\n#{ t('admin.activities.weekoverzicht.no_borrel', locale: locale) }"
else
res += "#{ header }\n"
res += if borrels[0].include_in_weekoverzicht?
borrels[0].name
else
t('admin.activities.weekoverzicht.borrel', locale: locale)
end
res += " #{ locale == :nl ? 'op' : 'on' } \
#{ l(borrels[0].start_date, format: '%A', locale: locale) } #{ locale == :nl ? 'in' : 'at' } \
#{ borrels[0].location }!"
end
res
end
helper_method :weekoverzicht
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/activities/partials/_edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
.col
%hr
.col-auto
= I18n.t('admin.activities.borrels')
= I18n.t('admin.activities.weekoverzicht.header')
.col
%hr
.row
Expand Down
1 change: 0 additions & 1 deletion config/locales/admin.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ en:
admin:
activities:
added_reservist: has been placed on the participants list
borrels: Drinks
copy_wa_msg: Copy for WhatsApp
ended: Ended
filters: Filters
Expand Down
1 change: 0 additions & 1 deletion config/locales/admin.nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ nl:
admin:
activities:
added_reservist: is op de deelnemerslijst geplaatst
borrels: Borrels
copy_wa_msg: Kopieer voor WhatsApp
ended: Afgelopen
filters: Filters
Expand Down
5 changes: 2 additions & 3 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ CREATE TABLE public.activities (
is_seniors boolean,
payable_updated_at date,
payment_deadline date,
cost_unit character varying,
is_borrel boolean,
include_in_weekoverzicht boolean DEFAULT true,
cost_unit character varying
include_in_weekoverzicht boolean DEFAULT true
);


Expand Down Expand Up @@ -1750,4 +1750,3 @@ INSERT INTO "schema_migrations" (version) VALUES
('20251013182502'),
('20251013221303'),
('20251113134139');

Loading