aboutsummaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/agents_helper.rb7
-rw-r--r--app/helpers/application_helper.rb14
2 files changed, 14 insertions, 7 deletions
diff --git a/app/helpers/agents_helper.rb b/app/helpers/agents_helper.rb
index 6b2ff82..bbaeeca 100644
--- a/app/helpers/agents_helper.rb
+++ b/app/helpers/agents_helper.rb
@@ -3,11 +3,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
module AgentsHelper
- # Form to select an Agent
- def agent_selector_form
- form_for current_agent, url: '/my/current_agent', method: :patch do |f|
- f.submit('select')
- f.select(:id, options_for_select(current_user.agents.map { |a| [a.name, a.id] }), selected: current_agent.id)
- end
- end
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 4689613..15d5082 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -12,6 +12,20 @@ module ApplicationHelper
end
end
+ def map_container(map = Map.first)
+ raw tag.div(
+ tag.div(id: 'map',
+ data: {
+ target: 'map.container'
+ }),
+ data: {
+ controller: 'map',
+ 'map-latitude': map.latitude,
+ 'map-longitude': map.longitude,
+ 'map-zoom': map.zoom
+ })
+ end
+
# Markdown helper
# Always use all extensions. Additional parser and render options may be
# passed as a second argument.