forked from MapComplete/MapComplete
Add email question, some tweaks
This commit is contained in:
commit
f67508336a
12 changed files with 123 additions and 69 deletions
|
@ -1,20 +1,33 @@
|
|||
import {UIElement} from "../UIElement";
|
||||
import Translations from "../i18n/Translations";
|
||||
import Combine from "./Combine";
|
||||
import {link} from "fs";
|
||||
|
||||
|
||||
export class SubtleButton extends UIElement{
|
||||
private imageUrl: string;
|
||||
private message: UIElement;
|
||||
private linkTo: string = undefined;
|
||||
|
||||
constructor(imageUrl: string, message: string | UIElement) {
|
||||
constructor(imageUrl: string, message: string | UIElement, linkTo : string = undefined) {
|
||||
super(undefined);
|
||||
this.linkTo = linkTo;
|
||||
this.message = Translations.W(message);
|
||||
this.imageUrl = imageUrl;
|
||||
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
|
||||
if(this.linkTo != undefined){
|
||||
return new Combine([
|
||||
`<a class="subtle-button" href="${this.linkTo}" target="_blank">`,
|
||||
this.imageUrl !== undefined ? `<img src='${this.imageUrl}'>` : "",
|
||||
this.message,
|
||||
'</a>'
|
||||
]).Render();
|
||||
}
|
||||
|
||||
return new Combine([
|
||||
'<span class="subtle-button">',
|
||||
this.imageUrl !== undefined ? `<img src='${this.imageUrl}'>` : "",
|
||||
|
|
|
@ -26,7 +26,7 @@ export class LayerSelection extends UIElement{
|
|||
this._checkboxes.push(new CheckBox(
|
||||
new Combine([checkbox, icon, name]),
|
||||
new Combine([
|
||||
Img.checkmark,
|
||||
Img.no_checkmark,
|
||||
icon,
|
||||
layer.layerDef.name]),
|
||||
layer.isDisplayed));
|
||||
|
|
|
@ -34,16 +34,12 @@ export class MoreScreen extends UIElement {
|
|||
const link =
|
||||
new SubtleButton(layout.icon,
|
||||
new Combine([
|
||||
`<a href="${linkText}" target="_blank">`,
|
||||
"<div>",
|
||||
"<b>",
|
||||
Translations.W(layout.title),
|
||||
"</b>",
|
||||
"<br/>",
|
||||
Translations.W(layout.description),
|
||||
"</div>",
|
||||
"</a>"
|
||||
]));
|
||||
]), linkText);
|
||||
|
||||
els.push(link)
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ export class SimpleAddUI extends UIElement {
|
|||
= new UIEventSource<Preset>(undefined);
|
||||
private confirmButton: UIElement = undefined;
|
||||
private cancelButton: UIElement;
|
||||
private goToInboxButton: UIElement = new SubtleButton("/assets/envelope.svg",
|
||||
Translations.t.general.goToInbox, "https://www.openstreetmap.org/messages/inbox");
|
||||
|
||||
constructor(zoomlevel: UIEventSource<{ zoom: number }>,
|
||||
lastClickLocation: UIEventSource<{ lat: number, lon: number }>,
|
||||
|
@ -132,7 +134,9 @@ export class SimpleAddUI extends UIElement {
|
|||
if (this._userDetails.data.unreadMessages > 0) {
|
||||
return new Combine([header, "<span class='alert'>",
|
||||
Translations.t.general.readYourMessages,
|
||||
"</span>"]).Render();
|
||||
"</span>",
|
||||
this.goToInboxButton
|
||||
]).Render();
|
||||
}
|
||||
|
||||
if (this._userDetails.data.dryRun) {
|
||||
|
|
|
@ -748,7 +748,16 @@ export default class Translations {
|
|||
websiteIs: new T({
|
||||
en: "Website: <a href='{website}' target='_blank'>{website}</a>",
|
||||
nl: "Website: <a href='{website}' target='_blank'>{website}</a>"
|
||||
})
|
||||
}),
|
||||
emailOf: new T({
|
||||
en: "What is the email address of {category}?",
|
||||
nl: "Wat is het email-adres van {category}?"
|
||||
}
|
||||
),
|
||||
emailIs: new T({
|
||||
en: "The email address of this {category} is <a href='mailto:{email}' target='_blank'>{email}</a>",
|
||||
nl: "Het email-adres van {category} is <a href='mailto:{email}' target='_blank'>{email}</a>"
|
||||
}),
|
||||
|
||||
},
|
||||
openStreetMapIntro: new T({
|
||||
|
@ -794,6 +803,10 @@ export default class Translations {
|
|||
fewChangesBefore: new T({
|
||||
en: "Please, answer a few questions of existing points before adding a new point.",
|
||||
nl: "Gelieve eerst enkele vragen van bestaande punten te beantwoorden vooraleer zelf punten toe te voegen."
|
||||
}),
|
||||
goToInbox: new T({
|
||||
en: "Open inbox",
|
||||
nl: "Ga naar de berichten"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue