Skip to content

Commit

Permalink
fix popover
Browse files Browse the repository at this point in the history
  • Loading branch information
njaeggi committed Oct 5, 2023
1 parent 0ef7ebb commit c9a7b8c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 34 deletions.
5 changes: 2 additions & 3 deletions app/views/events/courses/_buttons_youth.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
= action_button(t('event.lists.bsv_export_button'),
'#',
nil,
:download,
title: t('event.lists.bsv_export_button'),
data: { toggle: 'popover', content: render('popover_bsv_export').to_str })
data: { bs_toggle: 'popover', bs_title: t('event.lists.bsv_export_button'), bs_content: render('popover_bsv_export').to_str })
27 changes: 9 additions & 18 deletions app/views/events/courses/_popover_bsv_export.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,18 @@
= hidden_field_tag(:advanced, true) if defined?(advanced) && advanced

= f.labeled(t('event.lists.popover_bsv_export.event_kinds'), help: 'f00') do
= select_tag('filter[kinds]', options_from_collection_for_select(Event::Kind.includes(:translations).without_deleted, :id, :label), multiple: true)
= f.help_block do
%span.muted= t('event.lists.popover_bsv_export.event_kinds_hint')
= select_tag('filter[kinds]', options_from_collection_for_select(Event::Kind.includes(:translations).without_deleted, :id, :label), multiple: true, class: 'form-select tom-select')

= f.labeled(t('event.lists.popover_bsv_export.date_from')) do
.input-prepend{style: 'margin: 0 0.5rem 0.5rem 0'}
%span.add-on= icon(:'calendar-alt')
= text_field_tag('filter[bsv_since]', f(Date.today.beginning_of_year), class: 'date span2')
.input-group.w-50
.input-prepend
%span.input-group-text= icon(:'calendar-alt')
= text_field_tag('filter[bsv_since]', f(Date.today.beginning_of_year), class: 'date form-control form-control-sm')

= f.labeled(t('event.lists.popover_bsv_export.date_to')) do
.input-prepend{style: 'margin: 0 0.5rem 0.5rem 0'}
%span.add-on= icon(:'calendar-alt')
= text_field_tag('filter[bsv_until]', f(Date.today.end_of_year), class: 'date span2')
.input-group.w-50
.input-prepend
%span.input-group-text= icon(:'calendar-alt')
= text_field_tag('filter[bsv_until]', f(Date.today.end_of_year), class: 'date form-control form-control-sm')

= form_buttons(f, submit_label: t('event.lists.bsv_export_button'), cancel_url: :list_courses)

:javascript
(function() {
$('body').on('click', '.popover :submit', function(e) {
return setTimeout((function() {
return $('a[data-toggle=popover]').popover('hide');
}), 100);
});
});
14 changes: 7 additions & 7 deletions app/views/people/manageds/_fields.html.haml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
- # Copyright (c) 2023, CEVI Schweiz, Pfadibewegung Schweiz,
- # Jungwacht Blauring Schweiz, Pro Natura, Stiftung für junge Auslandschweizer.
- # This file is part of hitobito_youth and licensed under the Affero General Public License version 3
- # or later. See the COPYING file at the top-level directory or at
- # https://github.com/hitobito/hitobito_youth.
-# Copyright (c) 2023, CEVI Schweiz, Pfadibewegung Schweiz,
-# Jungwacht Blauring Schweiz, Pro Natura, Stiftung für junge Auslandschweizer.
-# This file is part of hitobito_youth and licensed under the Affero General Public License version 3
-# or later. See the COPYING file at the top-level directory or at
-# https://github.com/hitobito/hitobito_youth.
- if f.object.new_record?
= f.person_field(:managed, { data: { url: query_people_path(limit_by_permission: :change_managers) } })
- else
.span4
= f.object.managed.full_name
.col-4
= f.object.managed.full_name
12 changes: 6 additions & 6 deletions app/views/people/managers/_fields.html.haml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
- # Copyright (c) 2023, CEVI Schweiz, Pfadibewegung Schweiz,
- # Jungwacht Blauring Schweiz, Pro Natura, Stiftung für junge Auslandschweizer.
- # This file is part of hitobito_youth and licensed under the Affero General Public License version 3
- # or later. See the COPYING file at the top-level directory or at
- # https://github.com/hitobito/hitobito_youth.
-# Copyright (c) 2023, CEVI Schweiz, Pfadibewegung Schweiz,
-# Jungwacht Blauring Schweiz, Pro Natura, Stiftung für junge Auslandschweizer.
-# This file is part of hitobito_youth and licensed under the Affero General Public License version 3
-# or later. See the COPYING file at the top-level directory or at
-# https://github.com/hitobito/hitobito_youth.
- if f.object.new_record?
= f.person_field(:manager)
- else
.span4
.col-4
= f.object.manager.full_name

0 comments on commit c9a7b8c

Please sign in to comment.