forked from MapComplete/MapComplete
Merge develop
This commit is contained in:
commit
07bc5d6a6d
88 changed files with 3284 additions and 2363 deletions
|
@ -9,12 +9,11 @@ import {DownloadPanel} from "./DownloadPanel";
|
|||
import {SubtleButton} from "../Base/SubtleButton";
|
||||
import Svg from "../../Svg";
|
||||
import ExportPDF from "../ExportPDF";
|
||||
import {FixedUiElement} from "../Base/FixedUiElement";
|
||||
|
||||
export default class AllDownloads extends ScrollableFullScreen {
|
||||
|
||||
constructor(isShown: UIEventSource<boolean>) {
|
||||
super(AllDownloads.GenTitle, AllDownloads.GeneratePanel, "layers", isShown);
|
||||
super(AllDownloads.GenTitle, AllDownloads.GeneratePanel, "downloads", isShown);
|
||||
}
|
||||
|
||||
private static GenTitle(): BaseUIElement {
|
||||
|
|
|
@ -40,20 +40,16 @@ export default class FilterView extends VariableUiElement {
|
|||
const iconUnselected = new Combine([Svg.checkbox_empty]).SetStyle(
|
||||
iconStyle
|
||||
);
|
||||
const name: Translation = config.config.name.Clone();
|
||||
const name: Translation = config.config.name;
|
||||
|
||||
const styledNameChecked = name
|
||||
.Clone()
|
||||
.SetStyle("font-size:large;padding-left:1.25rem");
|
||||
const styledNameChecked = name.Clone().SetStyle("font-size:large;padding-left:1.25rem");
|
||||
|
||||
const styledNameUnChecked = name
|
||||
.Clone()
|
||||
.SetStyle("font-size:large;padding-left:1.25rem");
|
||||
const styledNameUnChecked = name.Clone().SetStyle("font-size:large;padding-left:1.25rem");
|
||||
|
||||
const zoomStatus =
|
||||
new Toggle(
|
||||
undefined,
|
||||
Translations.t.general.layerSelection.zoomInToSeeThisLayer.Clone()
|
||||
Translations.t.general.layerSelection.zoomInToSeeThisLayer
|
||||
.SetClass("alert")
|
||||
.SetStyle("display: block ruby;width:min-content;"),
|
||||
State.state.locationControl.map(location => location.zoom >= config.config.minzoom)
|
||||
|
@ -97,20 +93,16 @@ export default class FilterView extends VariableUiElement {
|
|||
|
||||
const name: Translation = Translations.WT(
|
||||
filteredLayer.layerDef.name
|
||||
)?.Clone();
|
||||
);
|
||||
|
||||
const styledNameChecked = name
|
||||
.Clone()
|
||||
.SetStyle("font-size:large;padding-left:1.25rem");
|
||||
const styledNameChecked = name.Clone().SetStyle("font-size:large;padding-left:1.25rem");
|
||||
|
||||
const styledNameUnChecked = name
|
||||
.Clone()
|
||||
.SetStyle("font-size:large;padding-left:1.25rem");
|
||||
const styledNameUnChecked = name.Clone().SetStyle("font-size:large;padding-left:1.25rem");
|
||||
|
||||
const zoomStatus =
|
||||
new Toggle(
|
||||
undefined,
|
||||
Translations.t.general.layerSelection.zoomInToSeeThisLayer.Clone()
|
||||
Translations.t.general.layerSelection.zoomInToSeeThisLayer
|
||||
.SetClass("alert")
|
||||
.SetStyle("display: block ruby;width:min-content;"),
|
||||
State.state.locationControl.map(location => location.zoom >= filteredLayer.layerDef.minzoom)
|
||||
|
|
|
@ -30,7 +30,8 @@ export default class FullWelcomePaneWithTabs extends ScrollableFullScreen {
|
|||
super(
|
||||
() => layoutToUse.title.Clone(),
|
||||
() => FullWelcomePaneWithTabs.GenerateContents(state, currentTab, isShown),
|
||||
undefined, isShown
|
||||
"welcome",
|
||||
isShown
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -49,7 +50,7 @@ export default class FullWelcomePaneWithTabs extends ScrollableFullScreen {
|
|||
{header: `<img src='${state.layoutToUse.icon}'>`, content: welcome},
|
||||
{
|
||||
header: Svg.osm_logo_img,
|
||||
content: Translations.t.general.openStreetMapIntro.Clone().SetClass("link-underline")
|
||||
content: Translations.t.general.openStreetMapIntro.SetClass("link-underline")
|
||||
},
|
||||
|
||||
]
|
||||
|
@ -63,7 +64,7 @@ export default class FullWelcomePaneWithTabs extends ScrollableFullScreen {
|
|||
header: Svg.add_img,
|
||||
content:
|
||||
new Combine([
|
||||
Translations.t.general.morescreen.intro.Clone(),
|
||||
Translations.t.general.morescreen.intro,
|
||||
new MoreScreen(state)
|
||||
]).SetClass("flex flex-col")
|
||||
});
|
||||
|
@ -85,7 +86,7 @@ export default class FullWelcomePaneWithTabs extends ScrollableFullScreen {
|
|||
|
||||
tabsWithAboutMc.push({
|
||||
header: Svg.help,
|
||||
content: new Combine([Translations.t.general.aboutMapcomplete.Clone()
|
||||
content: new Combine([Translations.t.general.aboutMapcomplete
|
||||
.Subs({"osmcha_link": Utils.OsmChaLinkFor(7)}), "<br/>Version " + Constants.vNumber])
|
||||
.SetClass("link-underline")
|
||||
}
|
||||
|
|
|
@ -26,12 +26,12 @@ export default class LeftControls extends Combine {
|
|||
featureSwitchEnableExport: UIEventSource<boolean>,
|
||||
featureSwitchExportAsPdf: UIEventSource<boolean>,
|
||||
filteredLayers: UIEventSource<FilteredLayer[]>,
|
||||
featureSwitchFilter: UIEventSource<boolean>,
|
||||
selectedElement: UIEventSource<any>
|
||||
featureSwitchFilter: UIEventSource<boolean>
|
||||
},
|
||||
guiState: {
|
||||
downloadControlIsOpened: UIEventSource<boolean>,
|
||||
filterViewIsOpened: UIEventSource<boolean>,
|
||||
copyrightViewIsOpened: UIEventSource<boolean>
|
||||
}) {
|
||||
|
||||
const toggledCopyright = new ScrollableFullScreen(
|
||||
|
@ -41,7 +41,8 @@ export default class LeftControls extends Combine {
|
|||
state.layoutToUse,
|
||||
new ContributorCount(state).Contributors
|
||||
),
|
||||
undefined
|
||||
"copyright",
|
||||
guiState.copyrightViewIsOpened
|
||||
);
|
||||
|
||||
const copyrightButton = new Toggle(
|
||||
|
@ -49,8 +50,7 @@ export default class LeftControls extends Combine {
|
|||
new MapControlButton(Svg.copyright_svg())
|
||||
.onClick(() => toggledCopyright.isShown.setData(true)),
|
||||
toggledCopyright.isShown
|
||||
)
|
||||
.SetClass("p-0.5");
|
||||
).SetClass("p-0.5");
|
||||
|
||||
const toggledDownload = new Toggle(
|
||||
new AllDownloads(
|
||||
|
@ -73,11 +73,11 @@ export default class LeftControls extends Combine {
|
|||
() => Translations.t.general.layerSelection.title.Clone(),
|
||||
() =>
|
||||
new FilterView(state.filteredLayers, state.overlayToggles).SetClass(
|
||||
"block p-1 rounded-full"
|
||||
"block p-1"
|
||||
),
|
||||
undefined,
|
||||
"filters",
|
||||
guiState.filterViewIsOpened
|
||||
),
|
||||
).SetClass("rounded-lg"),
|
||||
new MapControlButton(Svg.filter_svg())
|
||||
.onClick(() => guiState.filterViewIsOpened.setData(true)),
|
||||
guiState.filterViewIsOpened
|
||||
|
@ -90,18 +90,6 @@ export default class LeftControls extends Combine {
|
|||
);
|
||||
|
||||
|
||||
state.locationControl.addCallback(() => {
|
||||
// Close the layer selection when the map is moved
|
||||
toggledDownload.isEnabled.setData(false);
|
||||
copyrightButton.isEnabled.setData(false);
|
||||
toggledFilter.isEnabled.setData(false);
|
||||
});
|
||||
|
||||
state.selectedElement.addCallbackAndRunD((_) => {
|
||||
toggledDownload.isEnabled.setData(false);
|
||||
copyrightButton.isEnabled.setData(false);
|
||||
toggledFilter.isEnabled.setData(false);
|
||||
});
|
||||
super([filterButton,
|
||||
downloadButtonn,
|
||||
copyrightButton])
|
||||
|
|
|
@ -6,8 +6,6 @@ import {SubtleButton} from "../Base/SubtleButton";
|
|||
import Translations from "../i18n/Translations";
|
||||
import * as personal from "../../assets/themes/personal/personal.json"
|
||||
import Constants from "../../Models/Constants";
|
||||
import LanguagePicker from "../LanguagePicker";
|
||||
import IndexText from "./IndexText";
|
||||
import BaseUIElement from "../BaseUIElement";
|
||||
import LayoutConfig from "../../Models/ThemeConfig/LayoutConfig";
|
||||
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||
|
@ -201,14 +199,13 @@ export default class MoreScreen extends Combine {
|
|||
}) ?? new UIEventSource<string>(`${linkPrefix}${linkSuffix}`)
|
||||
|
||||
|
||||
let description = Translations.WT(layout.shortDescription).Clone();
|
||||
return new SubtleButton(layout.icon,
|
||||
new Combine([
|
||||
`<dt class='text-lg leading-6 font-medium text-gray-900 group-hover:text-blue-800'>`,
|
||||
Translations.WT(layout.title).Clone(),
|
||||
Translations.WT(layout.title),
|
||||
`</dt>`,
|
||||
`<dd class='mt-1 text-base text-gray-500 group-hover:text-blue-900 overflow-ellipsis'>`,
|
||||
description.Clone().SetClass("subtle") ?? "",
|
||||
Translations.WT(layout.shortDescription)?.SetClass("subtle") ?? "",
|
||||
`</dd>`,
|
||||
]), {url: linkText, newTab: false});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue