mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-09 08:47:11 -05:00
* fix: move foreman to global gems to fix startup crash (#1971) * Update exporting code to stream points data to file in batches to red… (#1980) * Update exporting code to stream points data to file in batches to reduce memory usage * Update changelog * Update changelog * Feature/maplibre frontend (#1953) * Add a plan to use MapLibre GL JS for the frontend map rendering, replacing Leaflet * Implement phase 1 * Phases 1-3 + part of 4 * Fix e2e tests * Phase 6 * Implement fog of war * Phase 7 * Next step: fix specs, phase 7 done * Use our own map tiles * Extract v2 map logic to separate manager classes * Update settings panel on v2 map * Update v2 e2e tests structure * Reimplement location search in maps v2 * Update speed routes * Implement visits and places creation in v2 * Fix last failing test * Implement visits merging * Fix a routes e2e test and simplify the routes layer styling. * Extract js to modules from maps_v2_controller.js * Implement area creation * Fix spec problem * Fix some e2e tests * Implement live mode in v2 map * Update icons and panel * Extract some styles * Remove unused file * Start adding dark theme to popups on MapLibre maps * Make popups respect dark theme * Move v2 maps to maplibre namespace * Update v2 references to maplibre * Put place, area and visit info into side panel * Update API to use safe settings config method * Fix specs * Fix method name to config in SafeSettings and update usages accordingly * Add missing public files * Add handling for real time points * Fix remembering enabled/disabled layers of the v2 map * Fix lots of e2e tests * Add settings to select map version * Use maps/v2 as main path for MapLibre maps * Update routing * Update live mode * Update maplibre controller * Update changelog * Remove some console.log statements * Pull only necessary data for map v2 points * Feature/raw data archive (#2009) * 0.36.2 (#2007) * fix: move foreman to global gems to fix startup crash (#1971) * Update exporting code to stream points data to file in batches to red… (#1980) * Update exporting code to stream points data to file in batches to reduce memory usage * Update changelog * Update changelog * Feature/maplibre frontend (#1953) * Add a plan to use MapLibre GL JS for the frontend map rendering, replacing Leaflet * Implement phase 1 * Phases 1-3 + part of 4 * Fix e2e tests * Phase 6 * Implement fog of war * Phase 7 * Next step: fix specs, phase 7 done * Use our own map tiles * Extract v2 map logic to separate manager classes * Update settings panel on v2 map * Update v2 e2e tests structure * Reimplement location search in maps v2 * Update speed routes * Implement visits and places creation in v2 * Fix last failing test * Implement visits merging * Fix a routes e2e test and simplify the routes layer styling. * Extract js to modules from maps_v2_controller.js * Implement area creation * Fix spec problem * Fix some e2e tests * Implement live mode in v2 map * Update icons and panel * Extract some styles * Remove unused file * Start adding dark theme to popups on MapLibre maps * Make popups respect dark theme * Move v2 maps to maplibre namespace * Update v2 references to maplibre * Put place, area and visit info into side panel * Update API to use safe settings config method * Fix specs * Fix method name to config in SafeSettings and update usages accordingly * Add missing public files * Add handling for real time points * Fix remembering enabled/disabled layers of the v2 map * Fix lots of e2e tests * Add settings to select map version * Use maps/v2 as main path for MapLibre maps * Update routing * Update live mode * Update maplibre controller * Update changelog * Remove some console.log statements --------- Co-authored-by: Robin Tuszik <mail@robin.gg> * Remove esbuild scripts from package.json * Remove sideEffects field from package.json * Raw data archivation * Add tests * Fix tests * Fix tests * Update ExceptionReporter * Add schedule to run raw data archival job monthly * Change file structure for raw data archival feature * Update changelog and version for raw data archival feature --------- Co-authored-by: Robin Tuszik <mail@robin.gg> * Set raw_data to an empty hash instead of nil when archiving * Fix storage configuration and file extraction * Consider MIN_MINUTES_SPENT_IN_CITY during stats calculation (#2018) * Consider MIN_MINUTES_SPENT_IN_CITY during stats calculation * Remove raw data from visited cities api endpoint * Use user timezone to show dates on maps (#2020) * Fix/pre epoch time (#2019) * Use user timezone to show dates on maps * Limit timestamps to valid range to prevent database errors when users enter pre-epoch dates. * Limit timestamps to valid range to prevent database errors when users enter pre-epoch dates. * Fix tests failing due to new index on stats table * Fix failing specs * Update redis client configuration to support unix socket connection * Update changelog * Fix kml kmz import issues (#2023) * Fix kml kmz import issues * Refactor KML importer to improve readability and maintainability * Implement moving points in map v2 and fix route rendering logic to ma… (#2027) * Implement moving points in map v2 and fix route rendering logic to match map v1. * Fix route spec * fix(maplibre): update date format to ISO 8601 (#2029) * Add verification step to raw data archival process (#2028) * Add verification step to raw data archival process * Add actual verification of raw data archives after creation, and only clear raw_data for verified archives. * Fix failing specs * Eliminate zip-bomb risk * Fix potential memory leak in js * Return .keep files * Use Toast instead of alert for notifications * Add help section to navbar dropdown * Update changelog * Remove raw_data_archival_job * Ensure file is being closed properly after reading in Archivable concern --------- Co-authored-by: Robin Tuszik <mail@robin.gg>
212 lines
12 KiB
Text
212 lines
12 KiB
Text
<div class="navbar bg-base-100 h-16">
|
||
<div class="navbar-start">
|
||
<div class="dropdown">
|
||
<label tabindex="0" class="btn btn-ghost lg:hidden">
|
||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h8m-8 6h16" /></svg>
|
||
</label>
|
||
<ul tabindex="0" class="menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-52">
|
||
<li><%= link_to 'Map', preferred_map_path, class: "#{active_class?(preferred_map_path)}" %></li>
|
||
<li><%= link_to 'Trips<sup>α</sup>'.html_safe, trips_url, class: "#{active_class?(trips_url)}" %></li>
|
||
<li><%= link_to 'Stats', stats_url, class: "#{active_class?(stats_url)}" %></li>
|
||
<% if user_signed_in? && DawarichSettings.family_feature_enabled? %>
|
||
<li>
|
||
<% if current_user.in_family? %>
|
||
<div data-controller="family-navbar-indicator"
|
||
data-family-navbar-indicator-enabled-value="<%= current_user.family_sharing_enabled? %>">
|
||
<%= link_to family_path, class: "#{active_class?(family_path)} flex items-center space-x-2" do %>
|
||
<span>Family</span>
|
||
<div data-family-navbar-indicator-target="indicator"
|
||
class="w-2 h-2 <%= current_user.family_sharing_enabled? ? 'bg-green-500 animate-pulse' : 'bg-gray-400' %> rounded-full"
|
||
title="<%= current_user.family_sharing_enabled? ? 'Location sharing enabled' : 'Location sharing disabled' %>"></div>
|
||
<% end %>
|
||
</div>
|
||
<% else %>
|
||
<%= link_to 'Family<sup>α</sup>'.html_safe, new_family_path, class: "#{active_class?(new_family_path)}" %>
|
||
<% end %>
|
||
</li>
|
||
<% end %>
|
||
<li>
|
||
<details>
|
||
<summary>My data</summary>
|
||
<ul class="p-2 bg-base-100">
|
||
<li><%= link_to 'Points', points_url, class: "#{active_class?(points_url)}" %></li>
|
||
<li><%= link_to 'Visits & Places<sup>α</sup>'.html_safe, visits_url(status: :confirmed), class: "#{active_class?(visits_url)}" %></li>
|
||
<li><%= link_to 'Imports', imports_url, class: "#{active_class?(imports_url)}" %></li>
|
||
<li><%= link_to 'Exports', exports_url, class: "#{active_class?(exports_url)}" %></li>
|
||
<li><%= link_to 'Tags', tags_url, class: "#{active_class?(tags_url)}" %></li>
|
||
</ul>
|
||
</details>
|
||
</li>
|
||
<% if user_signed_in? && current_user.can_subscribe? %>
|
||
<li>
|
||
<%= link_to 'Subscribe', "#{MANAGER_URL}/auth/dawarich?token=#{current_user.generate_subscription_token}", class: 'btn btn-sm btn-success' %>
|
||
</li>
|
||
<% end %>
|
||
</ul>
|
||
</div>
|
||
<%= link_to 'Dawarich<sup>α</sup>'.html_safe, (user_signed_in? ? preferred_map_path : root_path), class: 'btn btn-ghost normal-case text-xl'%>
|
||
<div class="badge mx-4 <%= 'badge-outline' if new_version_available? %>">
|
||
<a href="https://github.com/Freika/dawarich/releases/latest" target="_blank" class="inline-flex items-center">
|
||
<% if new_version_available? %>
|
||
<span class="tooltip tooltip-bottom" data-tip="New version available! Check out Github releases!">
|
||
<span class="hidden sm:inline"><%= APP_VERSION %> !</span>
|
||
</span>
|
||
<% else %>
|
||
<span class="hidden sm:inline"><%= APP_VERSION %></span>
|
||
<% end %>
|
||
</a>
|
||
</div>
|
||
|
||
<% if user_signed_in? %>
|
||
<% if current_user.theme == 'light' %>
|
||
<%= link_to settings_theme_path(theme: 'dark'), data: { turbo: false }, class: 'btn btn-ghost' do %>
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
|
||
<% end %>
|
||
<% else %>
|
||
<%= link_to settings_theme_path(theme: 'light'), data: { turbo: false }, class: 'btn btn-ghost' do %>
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><path d="M12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4"/></svg>
|
||
<% end %>
|
||
<% end %>
|
||
<% end %>
|
||
</div>
|
||
<div class="navbar-center hidden lg:flex">
|
||
<ul class="menu menu-horizontal px-1">
|
||
<li><%= link_to 'Map', preferred_map_path, class: "mx-1 #{active_class?(preferred_map_path)}" %></li>
|
||
<li><%= link_to 'Trips<sup>α</sup>'.html_safe, trips_url, class: "mx-1 #{active_class?(trips_url)}" %></li>
|
||
<li><%= link_to 'Stats', stats_url, class: "mx-1 #{active_class?(stats_url)}" %></li>
|
||
<% if user_signed_in? && DawarichSettings.family_feature_enabled? %>
|
||
<li>
|
||
<% if current_user.in_family? %>
|
||
<div data-controller="family-navbar-indicator"
|
||
data-family-navbar-indicator-enabled-value="<%= current_user.family_sharing_enabled? %>"
|
||
class="<%= active_class?(family_path) %>">
|
||
<%= link_to family_path, class: "mx-1 flex items-center space-x-2" do %>
|
||
<span>Family<sup>α</sup></span>
|
||
<div data-family-navbar-indicator-target="indicator"
|
||
class="w-2 h-2 <%= current_user.family_sharing_enabled? ? 'bg-green-500 animate-pulse' : 'bg-gray-400' %> rounded-full"
|
||
title="<%= current_user.family_sharing_enabled? ? 'Location sharing enabled' : 'Location sharing disabled' %>"></div>
|
||
<% end %>
|
||
</div>
|
||
<% else %>
|
||
<%= link_to 'Family<sup>α</sup>'.html_safe, new_family_path, class: "mx-1 #{active_class?(new_family_path)}" %>
|
||
<% end %>
|
||
</li>
|
||
<% end %>
|
||
<li>
|
||
<details>
|
||
<summary>My data</summary>
|
||
<ul class="p-2 bg-base-100 rounded-box shadow-md z-10">
|
||
<li><%= link_to 'Points', points_url, class: "mx-1 #{active_class?(points_url)}" %></li>
|
||
<li><%= link_to 'Visits & Places<sup>α</sup>'.html_safe, visits_url(status: :confirmed), class: "mx-1 #{active_class?(visits_url)}" %></li>
|
||
<li><%= link_to 'Imports', imports_url, class: "#{active_class?(imports_url)}" %></li>
|
||
<li><%= link_to 'Exports', exports_url, class: "#{active_class?(exports_url)}" %></li>
|
||
<li><%= link_to 'Tags', tags_url, class: "#{active_class?(tags_url)}" %></li>
|
||
</ul>
|
||
</details>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
<div class="navbar-end">
|
||
<ul class="menu menu-horizontal bg-base-100 rounded-box px-1">
|
||
<% if user_signed_in? %>
|
||
<% if current_user.can_subscribe? %>
|
||
<div class="join">
|
||
<%= link_to "#{MANAGER_URL}/auth/dawarich?token=#{current_user.generate_subscription_token}" do %>
|
||
<span class="join-item btn btn-sm <%= trial_button_class(current_user) %>">
|
||
<% expiry = current_user.active_until %>
|
||
<% if expiry.blank? || expiry.past? %>
|
||
<span class="tooltip tooltip-bottom" data-tip="Trial expired" title="Trial expired">Trial expired 🥺</span>
|
||
<% else %>
|
||
<% days_left = [(expiry.to_date - Time.zone.today).to_i, 0].max %>
|
||
<span class="tooltip tooltip-bottom"
|
||
data-tip="Your trial will end in <%= distance_of_time_in_words(expiry, Time.current) %>"
|
||
title="Your trial will end in <%= distance_of_time_in_words(expiry, Time.current) %>">
|
||
<%= pluralize(days_left, 'day') %> remaining
|
||
</span>
|
||
<% end %>
|
||
</span><span class="join-item btn btn-sm btn-success">
|
||
Subscribe
|
||
</span>
|
||
<% end %>
|
||
</div>
|
||
<% end %>
|
||
|
||
<li data-controller="notifications"
|
||
data-notifications-user-id-value="<%= current_user.id %>">
|
||
<details>
|
||
<summary class="relative">
|
||
<%= icon 'bell' %>
|
||
<% if @unread_notifications.present? %>
|
||
<span class="badge badge-xs badge-primary absolute top-0 right-0" data-notifications-target="badge">
|
||
<%= @unread_notifications.size %>
|
||
</span>
|
||
<% end %>
|
||
</summary>
|
||
<ul class="p-2 bg-base-100 rounded-t-none z-10 min-w-52" data-notifications-target="list">
|
||
<li><%= link_to 'See all', notifications_path %></li>
|
||
<% @unread_notifications.first(10).each do |notification| %>
|
||
<div class="divider p-0 m-0"></div>
|
||
<li class='notification-item'>
|
||
<%= link_to notification do %>
|
||
<%= notification.title %>
|
||
<div class="badge badge-xs justify-self-end badge-<%= notification.kind %>"></div>
|
||
<% end %>
|
||
</li>
|
||
<% end %>
|
||
</ul>
|
||
</details>
|
||
</li>
|
||
<li>
|
||
<details>
|
||
<summary><%= icon 'message-circle-question-mark' %></summary>
|
||
<ul class="p-2 bg-base-100 rounded-box shadow-md z-10 w-52">
|
||
<li><p>Need help? Ping us! <%= icon 'arrow-big-down' %></p></li>
|
||
<li><%= link_to 'X (Twitter)', 'https://x.com/freymakesstuff', target: '_blank', rel: 'noopener noreferrer' %></li>
|
||
<li><%= link_to 'Mastodon', 'https://mastodon.social/@dawarich', target: '_blank', rel: 'noopener noreferrer' %></li>
|
||
<li><%= link_to 'Email', 'mailto:hi@dawarich.app' %></li>
|
||
<li><%= link_to 'Forum', 'https://discourse.dawarich.app', target: '_blank', rel: 'noopener noreferrer' %></li>
|
||
<li><%= link_to 'Discord', 'https://discord.gg/pHsBjpt5J8', target: '_blank', rel: 'noopener noreferrer' %></li>
|
||
</ul>
|
||
</details>
|
||
</li>
|
||
<li>
|
||
<details>
|
||
<summary>
|
||
<span class="inline"><%= icon 'user' %></span>
|
||
<% if onboarding_modal_showable?(current_user) %>
|
||
<span class="indicator-item badge badge-secondary badge-xs"></span>
|
||
<% end %>
|
||
<% if current_user.admin? %>
|
||
<span class='tooltip tooltip-bottom' data-tip="You're an admin, Harry!">
|
||
<%= icon 'star' %>
|
||
</span>
|
||
<% end %>
|
||
</summary>
|
||
<ul class="p-2 bg-base-100 rounded-t-none z-10">
|
||
<li><%= link_to 'Account', edit_user_registration_path %></li>
|
||
<li><%= link_to 'Settings', settings_path %></li>
|
||
<% if !DawarichSettings.self_hosted? %>
|
||
<li><%= link_to 'Subscription', "#{MANAGER_URL}/auth/dawarich?token=#{current_user.generate_subscription_token}" %></li>
|
||
<% end %>
|
||
<li>
|
||
<a onclick="getting_started.showModal()" class="relative">
|
||
Get started
|
||
<% if onboarding_modal_showable?(current_user) %>
|
||
<span class="indicator-item badge badge-secondary badge-xs"></span>
|
||
<% end %>
|
||
</a>
|
||
</li>
|
||
|
||
<li><%= link_to 'Logout', destroy_user_session_path, method: :delete, data: { turbo: false } %></li>
|
||
</ul>
|
||
</details>
|
||
</li>
|
||
<% else %>
|
||
<li><%= link_to 'Login', new_user_session_path %></li>
|
||
<% if !SELF_HOSTED && defined?(devise_mapping) && devise_mapping&.registerable? %>
|
||
<li><%= link_to 'Register', new_user_registration_path %></li>
|
||
<% end %>
|
||
<% end %>
|
||
</ul>
|
||
</div>
|
||
</div>
|