Add logo in edit header

cf #609
This commit is contained in:
Yohan Boniface 2023-07-24 17:49:46 +02:00
parent d56162390d
commit 202c73c35a
3 changed files with 34 additions and 6 deletions

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="35" height="35" viewBox="0 0 35 35" fill="none" version="1.1" id="svg15" sodipodi:docname="logo_small.svg" inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview id="namedview17" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" showgrid="false" inkscape:zoom="22.25" inkscape:cx="12.94382" inkscape:cy="17.325843" inkscape:window-width="1920" inkscape:window-height="1019" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="svg15" />
<rect x="0" y="0" width="35" height="35" rx="17.5" fill="#f2f2f2" stroke="#F2F2F2" stroke-width="0.5" id="rect2" style="stroke:none" />
<g clip-path="url(#clip0_217_11335)" id="g8" transform="translate(0.09990314,-0.7800653)">
<path d="m 12.2438,6.86133 c -2.46004,1.16961 -4.44899,3.14137 -5.63988,5.59127 -1.19088,2.4498 -1.51282,5.232 -0.9129,7.8891 0.59991,2.6571 2.08599,5.031 4.21394,6.7315 2.12794,1.7005 4.77114,2.6265 7.49514,2.6256 -9.28126,-8.6625 -11.41876,-19.35 -5.1563,-22.83747 z m 5.1563,22.83747 c 2.724,9e-4 5.3672,-0.9251 7.4951,-2.6256 2.128,-1.7005 3.6141,-4.0744 4.214,-6.7315 0.5999,-2.6571 0.2779,-5.4393 -0.9129,-7.8891 -1.1909,-2.4499 -3.1799,-4.42166 -5.64,-5.59127 6.2625,3.48747 4.125,14.17497 -5.1562,22.83747 z" fill="#323e56" id="path4" />
<path d="m 21.8439,12.0365 c 0,0.5836 -0.1149,1.1614 -0.3382,1.7006 -0.2234,0.5391 -0.5507,1.029 -0.9633,1.4416 -0.4127,0.4127 -0.9025,0.74 -1.4417,0.9633 -0.5391,0.2233 -1.117,0.3383 -1.7005,0.3383 -0.5836,0 -1.1614,-0.115 -1.7006,-0.3383 -0.5391,-0.2233 -1.029,-0.5506 -1.4416,-0.9633 -0.4127,-0.4126 -0.74,-0.9025 -0.9633,-1.4416 -0.2233,-0.5392 -0.3383,-1.117 -0.3383,-1.7006 0,-1.1785 0.4682,-2.30882 1.3016,-3.14218 0.8333,-0.83337 1.9636,-1.30155 3.1422,-1.30155 1.1785,0 2.3088,0.46818 3.1422,1.30155 0.8333,0.83336 1.3015,1.96368 1.3015,3.14218 z" fill="#323e56" id="path6" />
</g>
<defs id="defs13">
<clipPath id="clip0_217_11335">
<rect x="5.4001498" y="5.6992202" width="24" height="24" rx="12" fill="#ffffff" id="rect10" />
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -1810,19 +1810,19 @@ L.U.Map.include({
'umap-main-edit-toolbox with-transition dark', 'umap-main-edit-toolbox with-transition dark',
this._controlContainer this._controlContainer
), ),
title = L.DomUtil.add('h3', '', container, `${L._('Editing')}&nbsp;`), logo = L.DomUtil.add('a', 'logo', container),
name = L.DomUtil.create('a', 'umap-click-to-edit', title), name = L.DomUtil.add('a', 'umap-click-to-edit', container, this.getDisplayName()),
setName = function () { setName = function () {
name.textContent = this.getDisplayName() name.textContent = this.getDisplayName()
} }
logo.href = '/'
if (this.options.user) { if (this.options.user) {
const userLabel = L.DomUtil.add('a', 'umap-user', title, this.options.user.name) const userLabel = L.DomUtil.add('a', 'umap-user', container, this.options.user.name)
userLabel.href = this.options.user.url userLabel.href = this.options.user.url
} }
L.bind(setName, this)() this.help.button(container, 'edit')
L.DomEvent.on(name, 'click', this.edit, this) L.DomEvent.on(name, 'click', this.edit, this)
this.on('postsync', L.bind(setName, this)) this.on('postsync', L.bind(setName, this))
this.help.button(name, 'edit')
const save = L.DomUtil.create('a', 'leaflet-control-edit-save button', container) const save = L.DomUtil.create('a', 'leaflet-control-edit-save button', container)
save.href = '#' save.href = '#'
save.title = `${L._('Save current edits')} (Ctrl+S)` save.title = `${L._('Save current edits')} (Ctrl+S)`

View file

@ -436,6 +436,7 @@ ul.photon-autocomplete {
.umap-click-to-edit { .umap-click-to-edit {
color: #4a90d9; color: #4a90d9;
font-weight: bold; font-weight: bold;
cursor: pointer;
} }
.umap-click-to-edit:after { .umap-click-to-edit:after {
content: "\00a0"; content: "\00a0";
@ -471,7 +472,20 @@ ul.photon-autocomplete {
border-bottom: 1px solid #222; border-bottom: 1px solid #222;
z-index: 1000; z-index: 1000;
opacity: 0.98; opacity: 0.98;
color: #efefef; color: #fff;
}
.umap-main-edit-toolbox .logo {
background-image: url('./img/logo_small.svg');
background-position: 10px center;
background-repeat: no-repeat;
width: 60px;
display: inline-block;
height: 100%;
vertical-align: middle;
}
.umap-main-edit-toolbox a {
color: #fff;
font-size: 1.2em;
} }
.umap-edit-enabled .umap-main-edit-toolbox { .umap-edit-enabled .umap-main-edit-toolbox {
top: 0; top: 0;