From 3d4f9f2c280f9d85722951fa5850ca00a7e80aac Mon Sep 17 00:00:00 2001 From: hellekin Date: Thu, 29 Oct 2020 22:40:35 +0100 Subject: REUSE: Add AGPL-3.0-or-later to app/* --- app/helpers/agents_helper.rb | 4 ++++ app/helpers/application_helper.rb | 4 ++++ app/helpers/categories_helper.rb | 6 ++++++ app/helpers/resources_helper.rb | 4 ++++ app/helpers/taxonomies_helper.rb | 23 +++++++++++++++++++++++ app/helpers/users_helper.rb | 4 ++++ app/helpers/welcome_helper.rb | 4 ++++ 7 files changed, 49 insertions(+) create mode 100644 app/helpers/categories_helper.rb create mode 100644 app/helpers/taxonomies_helper.rb (limited to 'app/helpers') diff --git a/app/helpers/agents_helper.rb b/app/helpers/agents_helper.rb index a02fb7a..6b2ff82 100644 --- a/app/helpers/agents_helper.rb +++ b/app/helpers/agents_helper.rb @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 IN COMMON Collective +# +# SPDX-License-Identifier: AGPL-3.0-or-later + module AgentsHelper # Form to select an Agent def agent_selector_form diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2b6e109..4689613 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 IN COMMON Collective +# +# SPDX-License-Identifier: AGPL-3.0-or-later + module ApplicationHelper def current_agency current_user.agencies.where(agent: current_agent).first diff --git a/app/helpers/categories_helper.rb b/app/helpers/categories_helper.rb new file mode 100644 index 0000000..f6d7a86 --- /dev/null +++ b/app/helpers/categories_helper.rb @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2020 IN COMMON Collective +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +module CategoriesHelper +end diff --git a/app/helpers/resources_helper.rb b/app/helpers/resources_helper.rb index 157a8f5..a949311 100644 --- a/app/helpers/resources_helper.rb +++ b/app/helpers/resources_helper.rb @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 IN COMMON Collective +# +# SPDX-License-Identifier: AGPL-3.0-or-later + module ResourcesHelper # Return a SELECT tag to choose a section in a given taxonomy def section_select(taxonomy, selected = nil) diff --git a/app/helpers/taxonomies_helper.rb b/app/helpers/taxonomies_helper.rb new file mode 100644 index 0000000..a584177 --- /dev/null +++ b/app/helpers/taxonomies_helper.rb @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2020 IN COMMON Collective +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +# coding: utf-8 +# frozen_string_literal: true + +module TaxonomiesHelper + def taxonomy_filter + @taxonomy ||= Taxonomy.first + html = [] + @taxonomy.categories.each do |cat| + list = [] + cat.sections.each do |sec| + list << tag.li(h("#{sec.rank}. #{sec.name}"), id: "section-#{sec.id}", data: { action: "taxonomy#section" }) + end + html << tag.li(h("#{cat.rank}. #{cat.name}") << tag.ol(list.join.html_safe), + id: "category-#{cat.id}", + data: { action: "taxonomy#category" }) + end + raw(tag.nav(tag.ol(html.join.html_safe), id: "taxonomy-#{@taxonomy.uuid}")) + end +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 2310a24..0adb3be 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -1,2 +1,6 @@ +# SPDX-FileCopyrightText: 2020 IN COMMON Collective +# +# SPDX-License-Identifier: AGPL-3.0-or-later + module UsersHelper end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index eeead45..8e575f1 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -1,2 +1,6 @@ +# SPDX-FileCopyrightText: 2020 IN COMMON Collective +# +# SPDX-License-Identifier: AGPL-3.0-or-later + module WelcomeHelper end -- cgit v1.2.3