Compare commits

...

8 commits

Author SHA1 Message Date
David Larlet
b6229a05b7
Better login page styles and incentive (#2293)
Some checks failed
Test & Docs / tests (postgresql, 3.10) (push) Has been cancelled
Test & Docs / tests (postgresql, 3.12) (push) Has been cancelled
Test & Docs / lint (push) Has been cancelled
Test & Docs / docs (push) Has been cancelled
Fixes https://github.com/umap-project/umap-dsfr/issues/21

Rel.
24f23874f7
2024-11-22 09:29:47 -05:00
Yohan Boniface
d84c5246c5
chore: bump channels from 4.1.0 to 4.2.0 (#2275) 2024-11-22 10:18:48 +01:00
Yohan Boniface
4350f55e67
fix: do not fail when editing map infos if no licence is set (#2287) 2024-11-22 10:17:37 +01:00
Yohan Boniface
735c74dcb3
fix: allow spaces in iframe query strings in HTML formatting (#2292)
fix #2269
2024-11-22 09:46:56 +01:00
David Larlet
1073fe6142
Better login page styles and incentive
Fixes https://github.com/umap-project/umap-dsfr/issues/21

Rel. 24f23874f7
2024-11-21 15:37:21 -05:00
Yohan Boniface
95710a4dab fix: allow spaces in iframe query strings in HTML formatting
fix #2269
2024-11-21 15:21:35 +01:00
Yohan Boniface
f7c1b8f123 fix: do not fail when editing map infos if no licence is set 2024-11-20 16:44:15 +01:00
dependabot[bot]
cf7c293523
chore: bump channels from 4.1.0 to 4.2.0
Bumps [channels](https://github.com/django/channels) from 4.1.0 to 4.2.0.
- [Changelog](https://github.com/django/channels/blob/main/CHANGELOG.txt)
- [Commits](https://github.com/django/channels/compare/4.1.0...4.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 18:01:44 +00:00
7 changed files with 38 additions and 14 deletions

View file

@ -66,7 +66,7 @@ docker = [
"uwsgi==2.0.28",
]
sync = [
"channels==4.1.0",
"channels==4.2.0",
"daphne==4.1.2",
"pydantic==2.9.2",
"websockets==13.1",

View file

@ -24,11 +24,11 @@ input:-moz-placeholder, :-moz-placeholder {
body.login {
width: 320px;
margin: auto;
text-align: center;
background-color: var(--color-lighterGray);
color: var(--color-darkerGray);
}
body.login header {
display: flex;
justify-content: center;
}
.login-grid {
display: grid;

View file

@ -174,15 +174,15 @@ export function toHTML(r, options) {
// iframe
r = r.replace(
/{{{(h_t_t_ps?[^ |{]*)}}}/g,
/{{{(h_t_t_ps?[^|{]*)}}}/g,
'<div><iframe frameborder="0" src="$1" width="100%" height="300px"></iframe></div>'
)
r = r.replace(
/{{{(h_t_t_ps?[^ |{]*)\|(\d*)(px)?}}}/g,
/{{{(h_t_t_ps?[^|{]*)\|(\d*)(px)?}}}/g,
'<div><iframe frameborder="0" src="$1" width="100%" height="$2px"></iframe></div>'
)
r = r.replace(
/{{{(h_t_t_ps?[^ |{]*)\|(\d*)(px)?\*(\d*)(px)?}}}/g,
/{{{(h_t_t_ps?[^|{]*)\|(\d*)(px)?\*(\d*)(px)?}}}/g,
'<div><iframe frameborder="0" src="$1" width="$4px" height="$2px"></iframe></div>'
)

View file

@ -405,7 +405,7 @@ L.FormBuilder.LicenceChooser = L.FormBuilder.Select.extend({
},
toHTML: function () {
return this.get().name
return this.get()?.name
},
toJS: function () {

View file

@ -147,7 +147,7 @@ describe('Utils', () => {
)
})
it('should handle iframe with height with px', () => {
it('should handle double iframe', () => {
assert.equal(
Utils.toHTML(
'A double iframe: {{{https://osm.org/pouet}}}{{{https://osm.org/boudin}}}'
@ -156,6 +156,15 @@ describe('Utils', () => {
)
})
it('should handle iframe with query string and space', () => {
assert.equal(
Utils.toHTML(
'An iframe with query string: {{{https://osm.org/pouet.html?name=foobar&description=baz baz}}}'
),
'An iframe with query string: <div><iframe height="300px" width="100%" src="https://osm.org/pouet.html?name=foobar&amp;description=baz baz" frameborder="0"></iframe></div>'
)
})
it('http link with http link as parameter as variable', () => {
assert.equal(
Utils.toHTML('A phrase with a [[http://iframeurl.com?to=http://another.com]].'),
@ -263,6 +272,19 @@ describe('Utils', () => {
)
})
it('should process variables in http links', () => {
assert.equal(
Utils.greedyTemplate(
'A phrase with a {{{https://osm.org/pouet?name={name}&description={description}}}}.',
{
name: 'foobar',
description: 'bazbaz',
}
),
'A phrase with a {{{https://osm.org/pouet?name=foobar&description=bazbaz}}}.'
)
})
it('should not accept dash', () => {
assert.equal(
Utils.greedyTemplate('A phrase with a {var-iable}.', { 'var-iable': 'value' }),

View file

@ -2,6 +2,7 @@
/* Colors. */
--color-waterMint: #B9F5D2;
--color-darkBlue: #263B58;
--color-lighterGray: #f6f6f6;
--color-lightGray: #ddd;
--color-mediumGray: #3e4444;
--color-darkGray: #323737;

View file

@ -19,10 +19,11 @@
<header class="umap-nav">
{% include "umap/branding.html" %}
</header>
<h2>{% trans "To save and easily find your maps, identify yourself." %}</h2>
{% if ENABLE_ACCOUNT_LOGIN %}
<h2>
{% trans "Please log in with your account" %}
</h2>
<h3>
{% trans "Please log in with your account:" %}
</h3>
<div>
{% if form.non_field_errors %}
<ul class="form-errors">
@ -47,9 +48,9 @@
</div>
{% endif %}
{% if backends.backends|length %}
<h2>
{% trans "Please choose a provider" %}
</h2>
<h3>
{% trans "Please choose a provider:" %}
</h3>
<div>
<ul class="login-grid block-grid">
{% for name in backends.backends %}