Compare commits

..

24 commits

Author SHA1 Message Date
dependabot[bot]
32bd724ade
Merge dd1e0ee63c into e01a526935 2024-12-02 18:51:31 +00:00
Yohan Boniface
e01a526935
chore: bump pytest-rerunfailures from 14.0 to 15.0 (#2326)
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run
2024-12-02 19:51:27 +01:00
Yohan Boniface
8569b827ca
fix: compute length of all shapes for MultiLineString (not only first) (#2310) 2024-12-02 19:46:45 +01:00
dependabot[bot]
2dab2f23b5
chore: bump pytest-rerunfailures from 14.0 to 15.0
Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 14.0 to 15.0.
- [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst)
- [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/14.0...15.0)

---
updated-dependencies:
- dependency-name: pytest-rerunfailures
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 18:43:58 +00:00
Yohan Boniface
f4ff1048bd
chore: bump pytest from 8.3.3 to 8.3.4 (#2325) 2024-12-02 19:42:49 +01:00
Yohan Boniface
6310cde28b
chore: bump djlint from 1.36.1 to 1.36.3 (#2324) 2024-12-02 19:41:34 +01:00
Yohan Boniface
666a92ec44 fix: compute length of all shapes for MultiLineString not only first 2024-12-02 19:39:57 +01:00
Yohan Boniface
2f776dab59
feat: highlight importer URL field when it is fulfilled (#2323)
Very small step of #2302 


![image](https://github.com/user-attachments/assets/0ff2c056-91ad-4daa-9882-dd44a4c6ef9f)
2024-12-02 19:04:04 +01:00
Yohan Boniface
bba9487847 feat: highlight importer URL field when it is fulfilled
cf #2302
2024-12-02 18:56:24 +01:00
dependabot[bot]
995052d83e
chore: bump pytest from 8.3.3 to 8.3.4
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.3 to 8.3.4.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.3...8.3.4)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 17:55:51 +00:00
dependabot[bot]
7e53e50b9c
chore: bump djlint from 1.36.1 to 1.36.3
Bumps [djlint](https://github.com/djlint/djLint) from 1.36.1 to 1.36.3.
- [Release notes](https://github.com/djlint/djLint/releases)
- [Changelog](https://github.com/djlint/djLint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/djlint/djLint/compare/v1.36.1...v1.36.3)

---
updated-dependencies:
- dependency-name: djlint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 17:55:44 +00:00
dependabot[bot]
dd1e0ee63c
chore: bump websockets from 13.1 to 14.1
Bumps [websockets](https://github.com/python-websockets/websockets) from 13.1 to 14.1.
- [Release notes](https://github.com/python-websockets/websockets/releases)
- [Commits](https://github.com/python-websockets/websockets/compare/13.1...14.1)

---
updated-dependencies:
- dependency-name: websockets
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 16:21:43 +00:00
Yohan Boniface
8e5f46eb95
chore: bump pydantic from 2.9.2 to 2.10.2 (#2321) 2024-12-02 17:20:35 +01:00
Yohan Boniface
0f8ebcdf9a
chore: bump pytest-playwright from 0.5.2 to 0.6.2 (#2320) 2024-12-02 17:20:17 +01:00
Yohan Boniface
177a4edc1d
fix: broken ctrl+i and ctrl+o (#2322) 2024-12-02 17:19:53 +01:00
Yohan Boniface
31c8bf95ba fix: broken ctrl+i and ctrl+o 2024-12-02 17:10:06 +01:00
Yohan Boniface
f6f42f5e6b chore: move form css to a separate file 2024-12-02 17:07:06 +01:00
Yohan Boniface
d9998efc0f
Fix reordering of layers (#2316)
Broken in the map split I guess.

(Only the first line is the fix, the other are just naming, cf the two
commits.)
2024-12-02 15:43:14 +01:00
Yohan Boniface
30d9e43cd4
Add logo for social_core.backends.keycloak.KeycloakOAuth2 (#2258)
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run
2024-12-02 13:14:06 +01:00
dependabot[bot]
c29df404c8
chore: bump pydantic from 2.9.2 to 2.10.2
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.9.2 to 2.10.2.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.9.2...v2.10.2)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 12:13:48 +00:00
dependabot[bot]
3f24563a05
chore: bump pytest-playwright from 0.5.2 to 0.6.2
Bumps [pytest-playwright](https://github.com/microsoft/playwright-pytest) from 0.5.2 to 0.6.2.
- [Release notes](https://github.com/microsoft/playwright-pytest/releases)
- [Commits](https://github.com/microsoft/playwright-pytest/compare/v0.5.2...v0.6.2)

---
updated-dependencies:
- dependency-name: pytest-playwright
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 12:12:48 +00:00
Yohan Boniface
35b541f200 chore: better naming in layer reordering 2024-12-02 12:55:57 +01:00
Yohan Boniface
8624209e1b fix: iter on the right elements after reordering layers 2024-12-02 12:55:57 +01:00
Thomas Legay
4bd7bd7d48 Add logo for social_core.backends.keycloak.KeycloakOAuth2 2024-11-12 23:58:30 +01:00
10 changed files with 677 additions and 623 deletions

View file

@ -45,7 +45,7 @@ dependencies = [
dev = [ dev = [
"hatch==1.13.0", "hatch==1.13.0",
"ruff==0.8.1", "ruff==0.8.1",
"djlint==1.36.1", "djlint==1.36.3",
"mkdocs==1.6.1", "mkdocs==1.6.1",
"mkdocs-material==9.5.47", "mkdocs-material==9.5.47",
"mkdocs-static-i18n==1.2.3", "mkdocs-static-i18n==1.2.3",
@ -56,10 +56,10 @@ dev = [
test = [ test = [
"factory-boy==3.3.1", "factory-boy==3.3.1",
"playwright>=1.39", "playwright>=1.39",
"pytest==8.3.3", "pytest==8.3.4",
"pytest-django==4.9.0", "pytest-django==4.9.0",
"pytest-playwright==0.5.2", "pytest-playwright==0.6.2",
"pytest-rerunfailures==14.0", "pytest-rerunfailures==15.0",
"pytest-xdist>=3.5.0,<4", "pytest-xdist>=3.5.0,<4",
] ]
docker = [ docker = [
@ -68,7 +68,7 @@ docker = [
sync = [ sync = [
"channels==4.2.0", "channels==4.2.0",
"daphne==4.1.2", "daphne==4.1.2",
"pydantic==2.9.2", "pydantic==2.10.2",
"websockets==14.1", "websockets==14.1",
] ]

View file

@ -161,609 +161,6 @@ dt {
text-align: center; text-align: center;
} }
/* *********** */
/* forms */
/* *********** */
input[type="text"], input[type="password"], input[type="date"],
input[type="datetime-local"], input[type="email"], input[type="number"],
input[type="search"], input[type="tel"], input[type="time"], input[type="file"],
input[type="url"], textarea {
background-color: white;
border: 1px solid #CCCCCC;
border-radius: 2px 2px 2px 2px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
color: rgba(0, 0, 0, 0.75);
display: block;
font-family: inherit;
margin: 0;
margin-bottom: var(--box-margin);
padding: 7px;
width: 100%;
}
input[type="range"] {
margin-top: 10px;
margin-bottom: 5px;
width: 100%;
}
input[type="radio"] {
margin-inline-end: var(--text-margin);
}
input[type="checkbox"] {
margin: 0 var(--text-margin);
vertical-align: middle;
appearance: none;
}
input[type="checkbox"]:after {
display: inline-block;
content: ' ';
width: 12px;
height: 12px;
border: 1px solid var(--color-lightGray);
cursor: pointer;
text-align: center;
font-size: 1rem;
line-height: 0.8rem;
}
input[type=checkbox]:checked:after {
background-color: var(--color-lightCyan);
content: '✓';
color: var(--color-darkGray);
}
input[data-modified=true] {
background-color: var(--color-lightCyan);
border: 1px solid var(--color-darkGray);
}
textarea {
height: inherit;
padding: 7px;
min-height: 15rem;
min-height: 6rlh;
}
select {
border: 1px solid #222;
width: 100%;
height: 28px;
line-height: 28px;
margin-top: 5px;
margin-bottom: var(--box-margin);
}
.dark select {
color: #efefef;
background-color: #393F3F;
}
select[multiple="multiple"] {
height: auto;
}
.button,
[type="button"],
input[type="submit"] {
display: block;
margin-bottom: 14px;
text-align: center;
border-radius: 2px;
font-weight: normal;
cursor: pointer;
padding: 7px;
width: 100%;
min-height: 32px;
line-height: 32px;
border: none;
text-decoration: none;
background-color: white;
}
.dark .button,
.dark [type="button"] {
background-color: var(--color-darkerGray);
color: var(--text-color);
border: 1px solid #1b1f20;
}
.dark .button:hover,
.dark [type="button"]:hover,
.dark input[type="submit"]:hover {
background-color: #2e3436;
}
.dark a {
color: var(--text-color);
}
button.flat,
[type="button"].flat,
.dark [type="button"].flat {
border: none;
background-color: inherit;
padding: 0;
text-align: start;
min-height: inherit;
width: initial;
display: initial;
line-height: inherit;
color: var(--text-color);
}
button.flat:hover,
[type="button"].flat:hover,
.dark [type="button"].flat:hover {
text-decoration: underline;
}
.help-text, .helptext {
display: block;
padding: 7px 7px;
margin-bottom: 14px;
background: #393F3F;
color: var(--color-lightGray);
font-size: 10px;
border-radius: 0 2px;
}
.content .helptext {
background-color: #eee;
color: #000;
}
input + .help-text {
margin-top: -14px;
}
.formbox {
min-height: 36px;
margin-bottom: 14px;
}
.formbox.with-switch {
padding-top: 2px;
}
fieldset.formbox {
border: none;
border-top: 1px solid var(--color-lightGray);
}
label {
display: block;
font-size: 12px;
line-height: 21px;
width: 100%;
}
label + label {
margin-top: var(--box-margin);
}
.content label {
font-weight: bold;
}
input[type="checkbox"] + label {
display: inline;
padding: 0 14px;
}
select + .error,
input + .error {
display: block;
padding: 7px 7px;
margin-top: -14px;
margin-bottom: 14px;
background: var(--color-lightGray);
color: #fff;
background-color: #cc0000;
font-size: 11px;
border-radius: 0 2px;
}
input[type="file"] + .error {
margin-top: 0;
}
input[value]:invalid {
border-color: red;
background-color: darkred;
}
.dark input, .dark textarea {
background-color: #232729;
border-color: #1b1f20;
color: #efefef;
}
details {
margin-bottom: 5px;
border-start-start-radius: 4px;
border-start-end-radius: 4px;
}
.dark details {
border: 1px solid #222;
}
details fieldset {
overflow: hidden;
border: 1px solid var(--color-lightGray);
margin: 0;
padding-top: 10px;
}
details summary {
cursor: pointer;
background-color: var(--color-lightGray);
line-height: 30px;
font-size: 1.2em;
padding: 0 5px;
}
.dark details summary {
background-color: #232729;
color: #fff;
}
.dark details fieldset {
border: 1px solid var(--color-darkGray);
}
fieldset legend {
font-size: .9rem;
padding: 0 5px;
}
fieldset.separator {
border: none;
border-top: 1px solid var(--color-lightGray);
}
[data-badge] {
position: relative;
}
[data-badge]:after {
position: absolute;
inset-inline-end: -6px;
top: -6px;
min-width: 8px;
min-height: 8px;
line-height: 8px;
padding: 2px;
font-weight: bold;
background-color: var(--color-accent);
color: var(--color-darkBlue);
text-align: center;
font-size: .75rem;
border-radius: 50%;
content: attr(data-badge);
}
[hidden] {
display: none!important;
}
/* Switch */
input.switch:empty {
display: none;
}
input.switch:empty ~ label {
white-space: nowrap;
position: relative;
float: inline-start;
line-height: 2em;
height: 2em;
text-indent: 6em;
margin: 0.2em 0;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-shadow: 0 1px rgba(0, 0, 0, 0.1);
width: 80px;
}
input.switch:empty ~ label:before,
input.switch:empty ~ label:after {
position: absolute;
display: block;
top: 0;
bottom: 0;
inset-inline-start: 0;
content: ' ';
width: 6em;
-webkit-transition: all 100ms ease-in;
transition: all 100ms ease-in;
color: #c9c9c7;
font-weight: bold;
background-color: #ededed;
}
.dark input.switch:empty ~ label:before,
.dark input.switch:empty ~ label:after {
background-color: #272c2e;
}
input.switch:empty ~ label:after {
width: 3em;
margin-inline-start: 0.1em;
background-color: #ededed;
content: "OFF";
text-indent: 3.5em;
border: 1px solid #374E75;
font-weight: bold;
}
.dark input.switch:empty ~ label:after {
border: 1px solid #202425;
background-color: #2c3233;
}
input.switch:checked:empty ~ label:after {
content: ' ';
}
.dark input.switch:checked ~ label:before,
input.switch:checked ~ label:before {
background-color: var(--color-lightCyan);
border: 1px solid var(--color-lightGray);
color: var(--color-darkGray);
content: "ON";
text-indent: 0.7em;
text-align: start;
font-weight: bold;
}
.dark input.switch:checked ~ label:before {
border: none;
background-color: var(--color-accent);
}
input.switch:checked ~ label:after {
margin-inline-start: 3em;
}
.button-bar, .umap-multiplechoice {
margin-top: 5px;
text-align: center;
display: grid;
width: 100%
}
.button-bar {
grid-gap: 7px;
}
.umap-multiplechoice.by2,
.button-bar.half {
grid-template-columns: 1fr 1fr;
}
.button-bar.by3,
.button-bar.by5,
.button-bar.by6,
.umap-multiplechoice.by3,
.umap-multiplechoice.by5,
.umap-multiplechoice.by6 {
grid-template-columns: 1fr 1fr 1fr;
}
.button-bar.by4,
.umap-multiplechoice.by4 {
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.button-bar .button,
.button-bar [type="button"] {
display: inline-block;
}
.umap-multiplechoice input[type='radio'] {
display: none;
}
.umap-multiplechoice label {
border: 1px solid #374E75;
cursor: pointer;
background-color: #c9c9c7;
min-height: 30px;
line-height: 30px;
text-align: center;
width: 100%;
display: inline-block;
}
.dark .umap-multiplechoice label {
border: 1px solid black;
background-color: #2c3233;
}
.umap-multiplechoice input[type='radio']:checked + label {
background-color: var(--color-accent);
box-shadow: inset 0 0 6px 0px #2c3233;
color: var(--color-darkGray);
}
.inheritable .header,
.inheritable {
clear: both;
overflow: hidden;
}
.inheritable .header {
margin-bottom: 5px;
}
.inheritable .header label {
padding-top: 6px;
}
.inheritable + .inheritable {
border-top: 1px solid #222;
padding-top: 5px;
margin-top: 5px;
}
.umap-field-iconUrl .action-button,
.inheritable .define,
.inheritable .undefine {
float: inline-end;
width: initial;
min-height: 18px;
line-height: 18px;
margin-bottom: 0;
}
.inheritable .quick-actions {
float: inline-end;
}
.inheritable .quick-actions .formbox {
margin-bottom: 0;
}
.inheritable .quick-actions input {
width: 100px;
margin-inline-end: 5px;
}
.inheritable .define,
.inheritable.undefined .undefine,
.inheritable.undefined .show-on-defined {
display: none;
}
.inheritable.undefined .define {
display: block;
}
i.info {
background-repeat: no-repeat;
background-image: url('./img/16.svg');
background-position: -170px -50px;
display: inline-block;
margin-inline-start: 5px;
vertical-align: middle;
width: 16px;
height: 18px;
}
.dark i.info {
background-image: url('./img/16-white.svg');
}
.with-transition {
transition: all .7s;
}
.umap-empty:before, .umap-to-polygon:before,
.umap-clone:before, .umap-edit:before, .umap-download:before,
.umap-to-polyline:before {
background-repeat: no-repeat;
text-indent: 36px;
height: 24px;
line-height: 24px;
display: inline-block;
background-image: url('./img/24.svg');
vertical-align: bottom;
content: " ";
}
.dark .umap-empty:before,
.dark .umap-to-polygon:before,
.dark .umap-clone:before,
.dark .umap-edit:before, .dark .umap-download:before,
.dark .umap-to-polyline:before {
background-image: url('./img/24-white.svg');
vertical-align: middle;
}
.umap-to-polygon:before {
background-position: -72px -42px;
}
.umap-to-polyline:before {
background-position: -106px -42px;
}
.umap-clone:before {
background-position: -144px -78px;
}
.umap-empty:before {
background-position: -108px -78px;
}
.umap-download:before {
background-position: -72px -78px;
}
.permissions-panel,
.umap-upload,
.umap-share,
.umap-datalayer-container,
.umap-layer-properties-container,
.umap-browse-data,
.umap-tilelayer-switcher-container {
padding: 0 10px;
}
.umap-field-datalist {
display: flex;
justify-content: space-between;
font-size: 9px;
margin-top: -8px;
padding: 0 5px;
}
.flat-tabs {
display: flex;
justify-content: space-around;
font-size: 1.2em;
margin-bottom: 20px;
border-bottom: 1px solid #bebebe;
}
.flat-tabs button {
padding: 10px;
text-decoration: none;
cursor: pointer;
border-bottom: 1px solid transparent;
}
.flat-tabs button:hover,
.flat-tabs .on {
font-weight: bold;
border-bottom: 1px solid #444;
}
.dark .flat-tabs button {
color: #fff;
}
.dark .flat-tabs button:hover,
.dark .flat-tabs .on {
border-bottom: 1px solid #fff;
}
.umap-pictogram-category h6 {
font-size: 1.3em;
}
.umap-pictogram-grid {
display: grid;
grid-template-columns: repeat(auto-fill, 30px);
justify-content: space-between;
grid-gap: 5px;
}
.umap-pictogram-choice {
width: 30px;
height: 30px;
line-height: 30px;
cursor: pointer;
background-color: #999;
text-align: center;
margin-bottom: 5px;
display: block;
color: black;
font-weight: bold;
}
.umap-pictogram-choice img {
vertical-align: middle;
max-width: 24px;
}
.umap-pictogram-choice:hover,
.umap-color-picker span:hover {
background-color: #bebebe;
}
.umap-pictogram-choice.selected {
box-shadow: inset 0 0 0 1px #e9e9e9;
}
.umap-pictogram-choice .leaflet-marker-icon {
bottom: 0;
inset-inline-start: 30px;
position: absolute;
}
.umap-color-picker {
clear: both;
margin-bottom: 20px;
overflow: hidden;
display: none;
}
.umap-color-picker span {
width: 20px;
height: 20px;
display: block;
padding: 0;
margin: 0;
cursor: pointer;
float: inline-start;
}
input.blur {
width: calc(100% - 40px);
display: inline-block;
vertical-align: middle;
border-start-end-radius: 0;
border-end-end-radius: 0;
}
.blur + .button:before,
.blur + [type="button"]:before {
content: '✔';
}
.blur + .button,
.blur + [type="button"] {
width: 40px;
height: 18px;
display: inline-block;
vertical-align: middle;
line-height: 18px;
border-start-start-radius: 0;
border-end-start-radius: 0;
box-sizing: border-box;
}
input[type=hidden].blur + .button,
input[type=hidden].blur + [type="button"] {
display: none;
}
.copiable-input {
display: flex;
align-items: end;
}
.copiable-input input {
border-radius: initial;
}
.copiable-input button {
background-position: -46px -92px;
display: inline;
padding: 0 10px;
height: 32px;
width: 32px;
border: 1px solid #202425;
border-radius: initial;
}
/* *********** */ /* *********** */
/* Panel */ /* Panel */

View file

@ -65,7 +65,9 @@ body.login header {
.login-grid .login-openstreetmap-oauth2 { .login-grid .login-openstreetmap-oauth2 {
background-image: url("./openstreetmap.png"); background-image: url("./openstreetmap.png");
} }
.login-grid .login-keycloak {
background-image: url("./keycloak.png");
}
/* **************************** */ /* **************************** */
/* home */ /* home */

View file

@ -0,0 +1,604 @@
input[type="text"], input[type="password"], input[type="date"],
input[type="datetime-local"], input[type="email"], input[type="number"],
input[type="search"], input[type="tel"], input[type="time"], input[type="file"],
input[type="url"], textarea {
background-color: white;
border: 1px solid #CCCCCC;
border-radius: 2px 2px 2px 2px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
color: rgba(0, 0, 0, 0.75);
display: block;
font-family: inherit;
margin: 0;
margin-bottom: var(--box-margin);
padding: 7px;
width: 100%;
}
input[type="range"] {
margin-top: 10px;
margin-bottom: 5px;
width: 100%;
}
input[type="radio"] {
margin-inline-end: var(--text-margin);
}
input[type="checkbox"] {
margin: 0 var(--text-margin);
vertical-align: middle;
appearance: none;
}
input[type="checkbox"]:after {
display: inline-block;
content: ' ';
width: 12px;
height: 12px;
border: 1px solid var(--color-lightGray);
cursor: pointer;
text-align: center;
font-size: 1rem;
line-height: 0.8rem;
}
input[type=checkbox]:checked:after {
background-color: var(--color-lightCyan);
content: '✓';
color: var(--color-darkGray);
}
input[data-modified=true] {
background-color: var(--color-lightCyan);
border: 1px solid var(--color-darkGray);
}
textarea {
height: inherit;
padding: 7px;
min-height: 15rem;
min-height: 6rlh;
}
select {
border: 1px solid #222;
width: 100%;
height: 28px;
line-height: 28px;
margin-top: 5px;
margin-bottom: var(--box-margin);
}
.dark select {
color: #efefef;
background-color: #393F3F;
}
select[multiple="multiple"] {
height: auto;
}
.button,
[type="button"],
input[type="submit"] {
display: block;
margin-bottom: 14px;
text-align: center;
border-radius: 2px;
font-weight: normal;
cursor: pointer;
padding: 7px;
width: 100%;
min-height: 32px;
line-height: 32px;
border: none;
text-decoration: none;
background-color: white;
}
.dark .button,
.dark [type="button"] {
background-color: var(--color-darkerGray);
color: var(--text-color);
border: 1px solid #1b1f20;
}
.dark .button:hover,
.dark [type="button"]:hover,
.dark input[type="submit"]:hover {
background-color: #2e3436;
}
.dark a {
color: var(--text-color);
}
button.flat,
[type="button"].flat,
.dark [type="button"].flat {
border: none;
background-color: inherit;
padding: 0;
text-align: start;
min-height: inherit;
width: initial;
display: initial;
line-height: inherit;
color: var(--text-color);
}
button.flat:hover,
[type="button"].flat:hover,
.dark [type="button"].flat:hover {
text-decoration: underline;
}
.help-text, .helptext {
display: block;
padding: 7px 7px;
margin-bottom: 14px;
background: #393F3F;
color: var(--color-lightGray);
font-size: 10px;
border-radius: 0 2px;
}
.content .helptext {
background-color: #eee;
color: #000;
}
input + .help-text {
margin-top: -14px;
}
.formbox {
min-height: 36px;
margin-bottom: 14px;
}
.formbox.with-switch {
padding-top: 2px;
}
fieldset.formbox {
border: none;
border-top: 1px solid var(--color-lightGray);
}
label {
display: block;
font-size: 12px;
line-height: 21px;
width: 100%;
}
label + label {
margin-top: var(--box-margin);
}
.content label {
font-weight: bold;
}
input[type="checkbox"] + label {
display: inline;
padding: 0 14px;
}
select + .error,
input + .error {
display: block;
padding: 7px 7px;
margin-top: -14px;
margin-bottom: 14px;
background: var(--color-lightGray);
color: #fff;
background-color: #cc0000;
font-size: 11px;
border-radius: 0 2px;
}
input[type="file"] + .error {
margin-top: 0;
}
input[value]:invalid {
border-color: red;
background-color: darkred;
}
.dark input, .dark textarea {
background-color: #232729;
border-color: #1b1f20;
color: #efefef;
}
details {
margin-bottom: 5px;
border-start-start-radius: 4px;
border-start-end-radius: 4px;
}
.dark details {
border: 1px solid #222;
}
details fieldset {
overflow: hidden;
border: 1px solid var(--color-lightGray);
margin: 0;
padding-top: 10px;
}
details summary {
cursor: pointer;
background-color: var(--color-lightGray);
line-height: 30px;
font-size: 1.2em;
padding: 0 5px;
}
.dark details summary {
background-color: #232729;
color: #fff;
}
.dark details fieldset {
border: 1px solid var(--color-darkGray);
}
fieldset legend {
font-size: .9rem;
padding: 0 5px;
}
fieldset.separator {
border: none;
border-top: 1px solid var(--color-lightGray);
}
[data-badge] {
position: relative;
}
[data-badge]:after {
position: absolute;
inset-inline-end: -6px;
top: -6px;
min-width: 8px;
min-height: 8px;
line-height: 8px;
padding: 2px;
font-weight: bold;
background-color: var(--color-accent);
color: var(--color-darkBlue);
text-align: center;
font-size: .75rem;
border-radius: 50%;
content: attr(data-badge);
}
[hidden] {
display: none!important;
}
/* Switch */
input.switch:empty {
display: none;
}
input.switch:empty ~ label {
white-space: nowrap;
position: relative;
float: inline-start;
line-height: 2em;
height: 2em;
text-indent: 6em;
margin: 0.2em 0;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-shadow: 0 1px rgba(0, 0, 0, 0.1);
width: 80px;
}
input.switch:empty ~ label:before,
input.switch:empty ~ label:after {
position: absolute;
display: block;
top: 0;
bottom: 0;
inset-inline-start: 0;
content: ' ';
width: 6em;
-webkit-transition: all 100ms ease-in;
transition: all 100ms ease-in;
color: #c9c9c7;
font-weight: bold;
background-color: #ededed;
}
.dark input.switch:empty ~ label:before,
.dark input.switch:empty ~ label:after {
background-color: #272c2e;
}
input.switch:empty ~ label:after {
width: 3em;
margin-inline-start: 0.1em;
background-color: #ededed;
content: "OFF";
text-indent: 3.5em;
border: 1px solid #374E75;
font-weight: bold;
}
.dark input.switch:empty ~ label:after {
border: 1px solid #202425;
background-color: #2c3233;
}
input.switch:checked:empty ~ label:after {
content: ' ';
}
.dark input.switch:checked ~ label:before,
input.switch:checked ~ label:before {
background-color: var(--color-lightCyan);
border: 1px solid var(--color-lightGray);
color: var(--color-darkGray);
content: "ON";
text-indent: 0.7em;
text-align: start;
font-weight: bold;
}
.dark input.switch:checked ~ label:before {
border: none;
background-color: var(--color-accent);
}
input.switch:checked ~ label:after {
margin-inline-start: 3em;
}
.button-bar, .umap-multiplechoice {
margin-top: 5px;
text-align: center;
display: grid;
width: 100%
}
.button-bar {
grid-gap: 7px;
}
.umap-multiplechoice.by2,
.button-bar.half {
grid-template-columns: 1fr 1fr;
}
.button-bar.by3,
.button-bar.by5,
.button-bar.by6,
.umap-multiplechoice.by3,
.umap-multiplechoice.by5,
.umap-multiplechoice.by6 {
grid-template-columns: 1fr 1fr 1fr;
}
.button-bar.by4,
.umap-multiplechoice.by4 {
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.button-bar .button,
.button-bar [type="button"] {
display: inline-block;
}
.umap-multiplechoice input[type='radio'] {
display: none;
}
.umap-multiplechoice label {
border: 1px solid #374E75;
cursor: pointer;
background-color: #c9c9c7;
min-height: 30px;
line-height: 30px;
text-align: center;
width: 100%;
display: inline-block;
}
.dark .umap-multiplechoice label {
border: 1px solid black;
background-color: #2c3233;
}
.umap-multiplechoice input[type='radio']:checked + label {
background-color: var(--color-accent);
box-shadow: inset 0 0 6px 0px #2c3233;
color: var(--color-darkGray);
}
.inheritable .header,
.inheritable {
clear: both;
overflow: hidden;
}
.inheritable .header {
margin-bottom: 5px;
}
.inheritable .header label {
padding-top: 6px;
}
.inheritable + .inheritable {
border-top: 1px solid #222;
padding-top: 5px;
margin-top: 5px;
}
.umap-field-iconUrl .action-button,
.inheritable .define,
.inheritable .undefine {
float: inline-end;
width: initial;
min-height: 18px;
line-height: 18px;
margin-bottom: 0;
}
.inheritable .quick-actions {
float: inline-end;
}
.inheritable .quick-actions .formbox {
margin-bottom: 0;
}
.inheritable .quick-actions input {
width: 100px;
margin-inline-end: 5px;
}
.inheritable .define,
.inheritable.undefined .undefine,
.inheritable.undefined .show-on-defined {
display: none;
}
.inheritable.undefined .define {
display: block;
}
i.info {
background-repeat: no-repeat;
background-image: url('../img/16.svg');
background-position: -170px -50px;
display: inline-block;
margin-inline-start: 5px;
vertical-align: middle;
width: 16px;
height: 18px;
}
.dark i.info {
background-image: url('../img/16-white.svg');
}
.with-transition {
transition: all .7s;
}
.umap-empty:before, .umap-to-polygon:before,
.umap-clone:before, .umap-edit:before, .umap-download:before,
.umap-to-polyline:before {
background-repeat: no-repeat;
text-indent: 36px;
height: 24px;
line-height: 24px;
display: inline-block;
background-image: url('../img/24.svg');
vertical-align: bottom;
content: " ";
}
.dark .umap-empty:before,
.dark .umap-to-polygon:before,
.dark .umap-clone:before,
.dark .umap-edit:before, .dark .umap-download:before,
.dark .umap-to-polyline:before {
background-image: url('../img/24-white.svg');
vertical-align: middle;
}
.umap-to-polygon:before {
background-position: -72px -42px;
}
.umap-to-polyline:before {
background-position: -106px -42px;
}
.umap-clone:before {
background-position: -144px -78px;
}
.umap-empty:before {
background-position: -108px -78px;
}
.umap-download:before {
background-position: -72px -78px;
}
.permissions-panel,
.umap-upload,
.umap-share,
.umap-datalayer-container,
.umap-layer-properties-container,
.umap-browse-data,
.umap-tilelayer-switcher-container {
padding: 0 10px;
}
.umap-field-datalist {
display: flex;
justify-content: space-between;
font-size: 9px;
margin-top: -8px;
padding: 0 5px;
}
.flat-tabs {
display: flex;
justify-content: space-around;
font-size: 1.2em;
margin-bottom: 20px;
border-bottom: 1px solid #bebebe;
}
.flat-tabs button {
padding: 10px;
text-decoration: none;
cursor: pointer;
border-bottom: 1px solid transparent;
}
.flat-tabs button:hover,
.flat-tabs .on {
font-weight: bold;
border-bottom: 1px solid #444;
}
.dark .flat-tabs button {
color: #fff;
}
.dark .flat-tabs button:hover,
.dark .flat-tabs .on {
border-bottom: 1px solid #fff;
}
.umap-pictogram-category h6 {
font-size: 1.3em;
}
.umap-pictogram-grid {
display: grid;
grid-template-columns: repeat(auto-fill, 30px);
justify-content: space-between;
grid-gap: 5px;
}
.umap-pictogram-choice {
width: 30px;
height: 30px;
line-height: 30px;
cursor: pointer;
background-color: #999;
text-align: center;
margin-bottom: 5px;
display: block;
color: black;
font-weight: bold;
}
.umap-pictogram-choice img {
vertical-align: middle;
max-width: 24px;
}
.umap-pictogram-choice:hover,
.umap-color-picker span:hover {
background-color: #bebebe;
}
.umap-pictogram-choice.selected {
box-shadow: inset 0 0 0 1px #e9e9e9;
}
.umap-pictogram-choice .leaflet-marker-icon {
bottom: 0;
inset-inline-start: 30px;
position: absolute;
}
.umap-color-picker {
clear: both;
margin-bottom: 20px;
overflow: hidden;
display: none;
}
.umap-color-picker span {
width: 20px;
height: 20px;
display: block;
padding: 0;
margin: 0;
cursor: pointer;
float: inline-start;
}
input.blur {
width: calc(100% - 40px);
display: inline-block;
vertical-align: middle;
border-start-end-radius: 0;
border-end-end-radius: 0;
}
.blur + .button:before,
.blur + [type="button"]:before {
content: '✔';
}
.blur + .button,
.blur + [type="button"] {
width: 40px;
height: 18px;
display: inline-block;
vertical-align: middle;
line-height: 18px;
border-start-start-radius: 0;
border-end-start-radius: 0;
box-sizing: border-box;
}
input[type=hidden].blur + .button,
input[type=hidden].blur + [type="button"] {
display: none;
}
.copiable-input {
display: flex;
align-items: end;
}
.copiable-input input {
border-radius: initial;
}
.copiable-input button {
background-position: -46px -92px;
display: inline;
padding: 0 10px;
height: 32px;
width: 32px;
border: 1px solid #202425;
border-radius: initial;
}
input.highlightable:not(:placeholder-shown) {
border: 1px solid var(--color-brightCyan);
}

View file

@ -10,7 +10,7 @@ const TEMPLATE = `
<fieldset class="formbox"> <fieldset class="formbox">
<legend class="counter">${translate('Choose data')}</legend> <legend class="counter">${translate('Choose data')}</legend>
<input type="file" multiple autofocus onchange /> <input type="file" multiple autofocus onchange />
<input type="url" placeholder="${translate('Provide an URL here')}" onchange /> <input class="highlightable" type="url" placeholder="${translate('Provide an URL here')}" onchange />
<textarea onchange placeholder="${translate('Paste your data here')}"></textarea> <textarea onchange placeholder="${translate('Paste your data here')}"></textarea>
<div class="importers" hidden> <div class="importers" hidden>
<h4>${translate('Import helpers:')}</h4> <h4>${translate('Import helpers:')}</h4>

View file

@ -255,7 +255,10 @@ const PathMixin = {
if (this._map.measureTools?.enabled()) { if (this._map.measureTools?.enabled()) {
this._map._umap.tooltip.open({ content: this.getMeasure(), anchor: this }) this._map._umap.tooltip.open({ content: this.getMeasure(), anchor: this })
} else if (this._map._umap.editEnabled && !this._map._umap.editedFeature) { } else if (this._map._umap.editEnabled && !this._map._umap.editedFeature) {
this._map._umap.tooltip.open({ content: translate('Click to edit'), anchor: this }) this._map._umap.tooltip.open({
content: translate('Click to edit'),
anchor: this,
})
} }
}, },
@ -267,7 +270,9 @@ const PathMixin = {
this._map.once('moveend', this.makeGeometryEditable, this) this._map.once('moveend', this.makeGeometryEditable, this)
const pointsCount = this._parts.reduce((acc, part) => acc + part.length, 0) const pointsCount = this._parts.reduce((acc, part) => acc + part.length, 0)
if (pointsCount > 100 && this._map.getZoom() < this._map.getMaxZoom()) { if (pointsCount > 100 && this._map.getZoom() < this._map.getMaxZoom()) {
this._map._umap.tooltip.open({ content: L._('Please zoom in to edit the geometry') }) this._map._umap.tooltip.open({
content: L._('Please zoom in to edit the geometry'),
})
this.disableEdit() this.disableEdit()
} else { } else {
this.enableEdit() this.enableEdit()
@ -380,8 +385,19 @@ export const LeafletPolyline = Polyline.extend({
}, },
getMeasure: function (shape) { getMeasure: function (shape) {
let shapes
if (shape) {
shapes = [shape]
} else if (LineUtil.isFlat(this._latlngs)) {
shapes = [this._latlngs]
} else {
shapes = this._latlngs
}
// FIXME: compute from data in feature (with TurfJS) // FIXME: compute from data in feature (with TurfJS)
const length = L.GeoUtil.lineLength(this._map, shape || this._defaultShape()) const length = shapes.reduce(
(acc, shape) => acc + L.GeoUtil.lineLength(this._map, shape),
0
)
return L.GeoUtil.readableDistance(length, this._map.measureTools.getMeasureUnit()) return L.GeoUtil.readableDistance(length, this._map.measureTools.getMeasureUnit())
}, },
}) })

View file

@ -537,10 +537,10 @@ export default class Umap extends ServerStored {
this._leafletMap.editTools.startPolyline() this._leafletMap.editTools.startPolyline()
break break
case 'i': case 'i':
this._leafletMap.importer.open() this.importer.open()
break break
case 'o': case 'o':
this._leafletMap.importer.openFiles() this.importer.openFiles()
break break
case 'h': case 'h':
this.help.showGetStarted() this.help.showGetStarted()
@ -596,7 +596,7 @@ export default class Umap extends ServerStored {
const panes = this._leafletMap.getPane('overlayPane') const panes = this._leafletMap.getPane('overlayPane')
this.datalayersIndex = [] this.datalayersIndex = []
for (const pane of panes) { for (const pane of panes.children) {
if (!pane.dataset || !pane.dataset.id) continue if (!pane.dataset || !pane.dataset.id) continue
this.datalayersIndex.push(this.datalayers[pane.dataset.id]) this.datalayersIndex.push(this.datalayers[pane.dataset.id])
} }
@ -1425,13 +1425,13 @@ export default class Umap extends ServerStored {
row.dataset.id = stamp(datalayer) row.dataset.id = stamp(datalayer)
}) })
const onReorder = (src, dst, initialIndex, finalIndex) => { const onReorder = (src, dst, initialIndex, finalIndex) => {
const layer = this.datalayers[src.dataset.id] const movedLayer = this.datalayers[src.dataset.id]
const other = this.datalayers[dst.dataset.id] const targetLayer = this.datalayers[dst.dataset.id]
const minIndex = Math.min(layer.getRank(), other.getRank()) const minIndex = Math.min(movedLayer.getRank(), targetLayer.getRank())
const maxIndex = Math.max(layer.getRank(), other.getRank()) const maxIndex = Math.max(movedLayer.getRank(), targetLayer.getRank())
if (finalIndex === 0) layer.bringToTop() if (finalIndex === 0) movedLayer.bringToTop()
else if (finalIndex > initialIndex) layer.insertBefore(other) else if (finalIndex > initialIndex) movedLayer.insertBefore(targetLayer)
else layer.insertAfter(other) else movedLayer.insertAfter(targetLayer)
this.eachDataLayerReverse((datalayer) => { this.eachDataLayerReverse((datalayer) => {
if (datalayer.getRank() >= minIndex && datalayer.getRank() <= maxIndex) if (datalayer.getRank() >= minIndex && datalayer.getRank() <= maxIndex)
datalayer.isDirty = true datalayer.isDirty = true

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -24,6 +24,7 @@
<link rel="stylesheet" href="{% static 'umap/font.css' %}" /> <link rel="stylesheet" href="{% static 'umap/font.css' %}" />
<link rel="stylesheet" href="{% static 'umap/css/icon.css' %}" /> <link rel="stylesheet" href="{% static 'umap/css/icon.css' %}" />
<link rel="stylesheet" href="{% static 'umap/base.css' %}" /> <link rel="stylesheet" href="{% static 'umap/base.css' %}" />
<link rel="stylesheet" href="{% static 'umap/css/form.css' %}" />
<link rel="stylesheet" href="{% static 'umap/content.css' %}" /> <link rel="stylesheet" href="{% static 'umap/content.css' %}" />
<link rel="stylesheet" href="{% static 'umap/nav.css' %}" /> <link rel="stylesheet" href="{% static 'umap/nav.css' %}" />
<link rel="stylesheet" href="{% static 'umap/map.css' %}" /> <link rel="stylesheet" href="{% static 'umap/map.css' %}" />

View file

@ -49,3 +49,37 @@ def test_should_open_popup_on_click(live_server, map, page, bootstrap):
# Close popup # Close popup
page.locator("#map").click() page.locator("#map").click()
expect(line).to_have_attribute("stroke-opacity", "0.5") expect(line).to_have_attribute("stroke-opacity", "0.5")
def test_can_use_measure_on_name(live_server, map, page):
data = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {"name": "linestring"},
"geometry": {
"type": "LineString",
"coordinates": [
[11.25, 53.585984],
[10.151367, 52.975108],
],
},
},
{
"type": "Feature",
"properties": {"name": "multilinestring"},
"geometry": {
"type": "MultiLineString",
"coordinates": [[[8, 53], [13, 52]], [[12, 51], [15, 52]]],
},
},
],
}
map.settings["properties"]["labelKey"] = "{name} ({measure})"
map.settings["properties"]["onLoadPanel"] = "databrowser"
map.save()
DataLayerFactory(map=map, data=data)
page.goto(f"{live_server.url}{map.get_absolute_url()}#6/10/50")
expect(page.get_by_text("linestring (99.7 km)")).to_be_visible()
expect(page.get_by_text("multilinestring (592 km)")).to_be_visible()