layerOptions.apikey = OSM[value];
} else if (property === "leafletOsmId") {
layerConstructor = L.OSM[value];
+ } else if (property === "leafletOsmDarkId" && OSM.isDarkMap() && L.OSM[value]) {
+ layerConstructor = L.OSM[value];
} else {
layerOptions[property] = value;
}
}
});
+OSM.isDarkMap = function () {
+ var mapTheme = $("body").attr("data-map-theme");
+ if (mapTheme) return mapTheme === "dark";
+ var siteTheme = $("html").attr("data-bs-theme");
+ if (siteTheme) return siteTheme === "dark";
+ return window.matchMedia("(prefers-color-scheme: dark)").matches;
+};
+
OSM.getUserIcon = function (url) {
return L.icon({
iconUrl: url || OSM.MARKER_RED,
body {
font-size: $typeheight;
- --dark-mode-map-filter: brightness(.8);
+ --dark-mode-map-filter: none;
}
time[title] {
<small class="form-text text-body-secondary">(<a href="<%= t ".openid.link" %>" target="_new"><%= t ".openid.link text" %></a>)</small>
</fieldset>
- <div class="mb-3">
- <label class="form-label"><%= t ".public editing.heading" %></label>
- <span class="form-text text-body-secondary">
- <% if current_user.data_public? %>
- <%= t ".public editing.enabled" %>
- (<a href="<%= t ".public editing.enabled link" %>" target="_new"><%= t ".public editing.enabled link text" %></a>)
- <% else %>
- <%= t ".public editing.disabled" %>
- (<a href="#public"><%= t ".public editing.disabled link text" %></a>)
- <% end %>
- </span>
- </div>
-
<div class="mb-3">
<label class="form-label"><%= t ".contributor terms.heading" %></label>
<span class="form-text text-body-secondary">
href: "https://www.thunderforest.com/"
- leafletOsmId: "TransportMap"
+ leafletOsmDarkId: "TransportDarkMap"
code: "T"
layerId: "transportmap"
nameId: "transport_map"
openid:
link: "https://wiki.openstreetmap.org/wiki/OpenID"
link text: "what is this?"
- public editing:
- heading: "Public editing"
- enabled: "Enabled. Not anonymous and can edit data."
- enabled link: "https://wiki.openstreetmap.org/wiki/Anonymous_edits"
- enabled link text: "what is this?"
- disabled: "Disabled and cannot edit data, all previous edits are anonymous."
- disabled link text: "why can't I edit?"
contributor terms:
heading: "Contributor Terms"
agreed: "You have agreed to the new Contributor Terms."
--- /dev/null
+class ValidateForeignKeyOnNotes < ActiveRecord::Migration[7.2]
+ def change
+ validate_foreign_key :notes, :users
+ end
+end
--
ALTER TABLE ONLY public.notes
- ADD CONSTRAINT notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) NOT VALID;
+ ADD CONSTRAINT notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
--
('23'),
('22'),
('21'),
+('20250105154621'),
('20250104140952'),
('20241023004427'),
('20241022141247'),