Skip to content

Commit

Permalink
Merge pull request #94 from Plant-for-the-Planet-org/develop
Browse files Browse the repository at this point in the history
Hiding tenant widgets and changing placeholder for project url
  • Loading branch information
sagararyal authored Sep 19, 2021
2 parents 70a85fe + 0f13b77 commit 388714b
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 9 deletions.
16 changes: 16 additions & 0 deletions public/data/locales/cz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"treesPlanted":"zasazených stromů",
"target":"Cíl",
"plantTrees":"Sázej stromy",
"viewProfile":"Ukázat profil",
"poweredBy":"Powered by Plant-for-the-Planet",
"treesPlantedBy":"stromů zasadil",
"and":"a",
"treesPlantedByComm":"stromů zasadila komunita.",
"forestfrontrunners": "Přední Stromvedoucí",
"mostrecent": "NEJNOVĚJŠÍ",
"mosttrees": "NEJVÍC STROMŮ",
"trees": "stromů",
"the": "Počítáme, jak",
"forestGrows": "roste."
}
2 changes: 1 addition & 1 deletion public/data/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"trees": "Trees",
"the": "The",
"forestGrows": "Forest Grows."
}
}
27 changes: 19 additions & 8 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
margin-right: 20px;
display: flex;
align-items: center;
height: fit-content;
}
.customisation-column {
display: flex;
Expand All @@ -74,6 +75,7 @@
display: block;
color: red;
font-size: smaller;
margin-top: -20px;
}
.input-group-new,
.form-select-new,
Expand Down Expand Up @@ -165,6 +167,11 @@
margin-top: 20px;
border-radius: 10px;
}
.mb-3{
display: flex !important;
flex-direction: column;
align-items: flex-start !important;
}
</style>
</head>
<body>
Expand All @@ -176,8 +183,8 @@ <h2 class="widgetTitle">Select your Widget</h2>
aria-label="Default select example">
<option value="treeMap">Tree-Map</option>
<option value="treeProfile">Tree-Profile</option>
<option value="treeTenantCounter">Tree-Tenant-Counter</option>
<option value="treeTenantLeaderboard">Tree-Tenant-Leaderboard</option>
<!-- <option value="treeTenantCounter">Tree-Tenant-Counter</option>
<option value="treeTenantLeaderboard">Tree-Tenant-Leaderboard</option> -->
</select>
</div>

Expand All @@ -187,18 +194,19 @@ <h2 class="widgetTitle">Select your Widget</h2>
<div class="customizationContainer">
<div class="mb-3">
<input type="text" class="form-control" onblur="updateURL('treeMap', this.value)"
placeholder="Username or profile url" id="userSlug">
placeholder="Username or profile url" id="userSlug" /><br>
<div id="error"></div>
</div>
<div class="mb-3">
<input type="text" class="form-control" onblur="updateProjectURL('treeMap', this.value)"
placeholder="Project" id="project">
placeholder="Project URL" id="project"><br/>
<div id="error1"></div>
</div>
<select class="form-select-new" onchange="changeAttribute('treeMap',this.value,'locale')"
aria-label="Default select example">
<option value="en" selected>Select Language</option>
<option value="en">EN</option>
<option value="cz">CZ</option>
<option value="de">DE</option>
<option value="es">ES</option>
<option value="fr">FR</option>
Expand Down Expand Up @@ -242,18 +250,19 @@ <h5 class="widgetSubTitle" style="margin-bottom: 20px;">
<div class="customizationContainer">
<div class="mb-3">
<input type="text" class="form-control" onblur="updateURL('treeProfile', (this.value))"
placeholder="User URL">
placeholder="User URL"><br/>
<div id="error-prof"></div>
</div>
<div class="mb-3">
<input type="text" class="form-control" onblur="updateProjectURL('treeProfile', (this.value))"
placeholder="Project">
placeholder="Project URL"><br/>
<div id="error-prof1"></div>
</div>
<select class="form-select-new" onchange="changeAttribute('treeProfile',this.value,'locale')"
aria-label="Default select example">
<option value="en" selected>Select Language</option>
<option value="en">EN</option>
<option value="cz">CZ</option>
<option value="de">DE</option>
<option value="es">ES</option>
<option value="fr">FR</option>
Expand Down Expand Up @@ -303,6 +312,7 @@ <h5 class="widgetSubTitle" style="margin-bottom: 20px;">
aria-label="Default select example">
<option value="en" selected>Select Language</option>
<option value="en">EN</option>
<option value="cz">CZ</option>
<option value="de">DE</option>
<option value="es">ES</option>
<option value="fr">FR</option>
Expand Down Expand Up @@ -342,6 +352,7 @@ <h5 class="widgetSubTitle" style="margin-bottom: 20px;">
aria-label="Default select example">
<option value="en" selected>Select Language</option>
<option value="en">EN</option>
<option value="cz">CZ</option>
<option value="de">DE</option>
<option value="es">ES</option>
<option value="fr">FR</option>
Expand Down Expand Up @@ -554,7 +565,7 @@ <h5 class="widgetSubTitle" style="margin-bottom: 20px;">
})
.catch((error) => {
console.log(error);
document.getElementById("error").innerHTML = "Invalid Profile URL";
document.getElementById("error-prof").innerHTML = "Invalid Profile URL";
});
document.getElementById("userSlug").placeholder = userslug;
}
Expand All @@ -572,7 +583,7 @@ <h5 class="widgetSubTitle" style="margin-bottom: 20px;">
})
.catch((error) => {
console.log(error);
document.getElementById("error1").innerHTML = "Invalid Project URL";
document.getElementById("error-prof1").innerHTML = "Invalid Project URL";
});
document.getElementById("project").placeholder = projectSlug;
}
Expand Down
2 changes: 2 additions & 0 deletions src/TreeMap/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { fetchTiles } from "../../utils/mapUtils";
import getImageUrl from "../../utils/getImageUrl";
import enLocale from "./../../public/data/locales/en.json";
import czLocale from "./../../public/data/locales/cz.json";
import deLocale from "./../../public/data/locales/de.json";
import esLocale from "./../../public/data/locales/es.json";
import frLocale from "./../../public/data/locales/fr.json";
Expand Down Expand Up @@ -40,6 +41,7 @@
let language = [];
language["en"] = enLocale;
language["cz"] = czLocale;
language["de"] = deLocale;
language["es"] = esLocale;
language["fr"] = frLocale;
Expand Down
2 changes: 2 additions & 0 deletions src/TreeProfile/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { localizedAbbreviatedNumber } from "../../utils/formatNumber";
import getImageUrl from "../../utils/getImageUrl";
import enLocale from "./../../public/data/locales/en.json";
import czLocale from "./../../public/data/locales/cz.json";
import deLocale from "./../../public/data/locales/de.json";
import esLocale from "./../../public/data/locales/es.json";
import frLocale from "./../../public/data/locales/fr.json";
Expand Down Expand Up @@ -35,6 +36,7 @@
let language = [];
language["en"] = enLocale;
language["cz"] = czLocale;
language["de"] = deLocale;
language["es"] = esLocale;
language["fr"] = frLocale;
Expand Down
2 changes: 2 additions & 0 deletions src/TreeTenantCounter/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import UserProfileLoader from "../../utils/contentLoaders/UserProfileLoader.svelte";
import { localizedAbbreviatedNumber } from "../../utils/formatNumber";
import enLocale from "./../../public/data/locales/en.json";
import czLocale from "./../../public/data/locales/cz.json";
import deLocale from "./../../public/data/locales/de.json";
import esLocale from "./../../public/data/locales/es.json";
import frLocale from "./../../public/data/locales/fr.json";
Expand All @@ -30,6 +31,7 @@
let language = [];
language["en"] = enLocale;
language["cz"] = czLocale;
language["de"] = deLocale;
language["es"] = esLocale;
language["fr"] = frLocale;
Expand Down
2 changes: 2 additions & 0 deletions src/TreeTenantLeaderboard/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<script>
import { getFormattedNumber } from "../../utils/formatNumber";
import enLocale from "./../../public/data/locales/en.json";
import czLocale from "./../../public/data/locales/cz.json";
import deLocale from "./../../public/data/locales/de.json";
import esLocale from "./../../public/data/locales/es.json";
import frLocale from "./../../public/data/locales/fr.json";
Expand All @@ -19,6 +20,7 @@
let language = [];
language["en"] = enLocale;
language["cz"] = czLocale;
language["de"] = deLocale;
language["es"] = esLocale;
language["fr"] = frLocale;
Expand Down

1 comment on commit 388714b

@vercel
Copy link

@vercel vercel bot commented on 388714b Sep 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.