Skip to content
Open
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
1 change: 1 addition & 0 deletions app/controllers/map_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class MapController < ApplicationController
before_action :authenticate_user!
layout 'map', only: :index

def index
@points = filtered_points
Expand Down
49 changes: 49 additions & 0 deletions app/views/layouts/map.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html data-theme="<%= app_theme %>" data-self-hosted="<%= @self_hosted %>">
<head>
<title><%= full_title(yield(:title)) %></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= action_cable_meta_tag %>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.css"/>

<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>
<%= javascript_include_tag "https://unpkg.com/protomaps-leaflet@5.0.0/dist/protomaps-leaflet.js" %>

<%= render 'application/favicon' %>
<%= Sentry.get_trace_propagation_meta.html_safe if Sentry.initialized? %>
<% if !DawarichSettings.self_hosted? %>
<script async src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
<% end %>
</head>

<body class='h-screen overflow-hidden relative'>
<!-- Fixed Navbar -->
<div class='fixed w-full z-50 bg-base-100 shadow-md h-16'>
<div class='container mx-auto h-full w-full flex items-center'>
<%= render 'shared/navbar' %>
</div>
</div>

<!-- Flash Messages - Fixed below navbar -->
<div class='fixed top-16 w-full z-40 h-8'>
<div class='container mx-auto px-5'>
<%= render 'shared/flash' %>
</div>
</div>

<!-- Date Navigation - Fixed below flash messages -->

<!-- Full Screen Map Container -->
<div class='absolute top-40 left-0 right-0 bottom-0 w-full z-10 overflow-auto'>
<%= yield %>
</div>

<%= render 'map/onboarding_modal' %>
</body>
</html>
4 changes: 2 additions & 2 deletions app/views/map/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<% content_for :title, 'Map' %>

<div class="flex flex-col lg:flex-row lg:space-x-4 my-5 w-full">
<div class="flex flex-col lg:flex-row lg:space-x-4 w-full">
<div class='w-full'>
<div class="flex flex-col space-y-4 mb-4 w-full">
<div class="flex flex-col space-y-4 mb-4 w-full" style="margin-top: 5rem;">
<%= form_with url: map_path(import_id: params[:import_id]), method: :get do |f| %>
<div class="flex flex-col space-y-4 sm:flex-row sm:space-y-0 sm:space-x-4 sm:items-end">
<div class="w-full sm:w-1/12 md:w-1/12 lg:w-1/12">
Expand Down