-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2351 from hitobito/feature/2329-abo-settings-cleanup
fixes #2329
- Loading branch information
Showing
15 changed files
with
266 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) 2024, Schweizer Alpen-Club. This file is part of | ||
# hitobito 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. | ||
# | ||
module TabsHelper | ||
|
||
def tab_header(label, id, default_active: false) | ||
tab = params[:active_tab] | ||
classes = %w(nav-link) | ||
classes += %w(active) if default_active && tab.blank? || tab == id.to_s | ||
link_to(label, "##{id}", data: { bs_toggle: 'tab' }, class: classes) | ||
end | ||
|
||
def tab_content(id, default_active: false, &block) | ||
tab = params[:active_tab] | ||
classes = %w(tab-pane) | ||
classes += %w(active) if default_active && tab.blank? || tab == id.to_s | ||
content_tag(:div, capture(&block), id: id, class: classes) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-# Copyright (c) 2023, Schweizer Alpen-Club. This file is part of | ||
-# hitobito 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 | ||
%ul.nav.nav-tabs | ||
%li.nav-item= tab_header(t('mailing_lists.form_tabs.general'), :general, default_active: true) | ||
%li.nav-item= tab_header(t('mailing_lists.form_tabs.email'), :email) | ||
%li.nav-item= tab_header(t('mailing_lists.form_tabs.mailchimp'), :mailchimp) | ||
|
||
= render_extensions :form_tabs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.