Skip to content
Snippets Groups Projects
Commit 9de161df authored by Tomáš Valenta's avatar Tomáš Valenta
Browse files

fix social media network links, format phone number correctly

parent 99b74c01
No related branches found
No related tags found
3 merge requests!5Release,!4Release,!3Release
Pipeline #11795 passed
...@@ -65,12 +65,21 @@ ...@@ -65,12 +65,21 @@
<label class="basis-56 flex items-center font-bold" for="phone"> <label class="basis-56 flex items-center font-bold" for="phone">
Telefonní číslo: Telefonní číslo:
</label> </label>
<input <div class="grow w-full flex gap-4 items-center">
id="phone" <input
name="phone" id="phone-prefix"
type="tel" name="phone-prefix"
class="border border-gray-200 p-2 rounded-md grow w-full" type="text"
> class="basis-16 w-16 border border-gray-200 p-2 rounded-md"
value="+420"
>
<input
id="phone"
name="phone"
type="number"
class="border border-gray-200 p-2 rounded-md grow w-full"
>
</div>
</div> </div>
<div class="flex gap-4 items-center"> <div class="flex gap-4 items-center">
......
...@@ -71,7 +71,7 @@ const generateSignature = () => { ...@@ -71,7 +71,7 @@ const generateSignature = () => {
let phone = escapeHTML($("#phone").val()); let phone = escapeHTML($("#phone").val());
let web = escapeHTML($("#web").val()); let web = escapeHTML($("#web").val());
let mastodon = escapeHTML($("#web").val()); let mastodon = escapeHTML($("#mastodon").val());
let twitter = escapeHTML($("#twitter").val()); let twitter = escapeHTML($("#twitter").val());
let instagram = escapeHTML($("#instagram").val()); let instagram = escapeHTML($("#instagram").val());
let linkedin = escapeHTML($("#linkedin").val()); let linkedin = escapeHTML($("#linkedin").val());
...@@ -85,14 +85,20 @@ const generateSignature = () => { ...@@ -85,14 +85,20 @@ const generateSignature = () => {
if (email !== "") { if (email !== "") {
result += `<div style="display:flex;column-gap:0.3em;margin-bottom:0.25em"> result += `<div style="display:flex;column-gap:0.3em;margin-bottom:0.25em">
<img src="${emailDataURL}" aria-label="E-mail" title="E-mail" width="14"> <img src="${emailDataURL}" aria-label="E-mail" title="E-mail" width="14">
<a href="${email}" style="color:black!important">${email}</a> <a href="mailto:${email}" style="color:black!important">${email}</a>
</div>`; </div>`;
} }
if (phone !== "") { if (phone !== "") {
phone = phone.replace(" ", "");
let phoneGroups = phone.match(/.?.?.?/g);
const formattedBasePhone = phoneGroups.join(" ");
const prefix = $("#phone-prefix").val();
result += `<div style="display:flex;column-gap:0.3em;margin-bottom:0.25em"> result += `<div style="display:flex;column-gap:0.3em;margin-bottom:0.25em">
<img src="${phoneDataURL}" aria-label="Telefonní číslo" title="Telefonní číslo" width="14"> <img src="${phoneDataURL}" aria-label="Telefonní číslo" title="Telefonní číslo" width="14">
<a href="${phone}" style="color:black!important">${phone}</a> <a href="tel:${prefix} ${formattedBasePhone}" style="color:black!important">${prefix}&nbsp;&nbsp;${formattedBasePhone}</a>
</div>`; </div>`;
} }
...@@ -160,7 +166,7 @@ const generateSignature = () => { ...@@ -160,7 +166,7 @@ const generateSignature = () => {
if (linkedin !== "") { if (linkedin !== "") {
result += `<a result += `<a
style="width:30px;height:30px;background:#1c84bb;text-decoration:none;display:flex;justify-content:center;align-items:center" style="width:30px;height:30px;background:#1c84bb;text-decoration:none;display:flex;justify-content:center;align-items:center"
href="${instagram}" href="${linkedin}"
> >
<img <img
src="${linkedInDataURL}" src="${linkedInDataURL}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment