Added trade unions
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
Server/public/js/components/profile-trade-unions.js
Normal file
1
Server/public/js/components/profile-trade-unions.js
Normal file
@@ -0,0 +1 @@
|
||||
import{S as t,i as s,a as e,b as o,s as r,h as a,j as n,n as i,z as d,d as c,o as l}from"./index-0d9f0c09.js";import"../../../../../../../../../js/libraries/authTools.js";function h(t){let s,e,r;return{c(){s=a("h3"),s.textContent="Under development",e=n(),r=a("p"),r.innerHTML='Visit <a href="https://discord.gg/Qk8KUk787z" style="color: #c52a28;">https://discord.gg/Qk8KUk787z</a> and ask for your trade union to be added.',this.c=i,d(r,"position","relative"),d(r,"margin-top","2rem")},m(t,a){o(t,s,a),o(t,e,a),o(t,r,a)},p:i,i:i,o:i,d(t){t&&c(s),t&&c(e),t&&c(r)}}}function p(t){return l((()=>{})),[]}class u extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';h3{text-align:center}</style>",s(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},p,h,r,{},null),t&&t.target&&o(t.target,this,t.anchor)}}customElements.define("profile-trade-unions",u);export{u as default};
|
File diff suppressed because one or more lines are too long
1
Server/public/js/components/trade-unions-component.js
Normal file
1
Server/public/js/components/trade-unions-component.js
Normal file
File diff suppressed because one or more lines are too long
@@ -13,9 +13,9 @@ export function debounce(func, timeout){
|
||||
}
|
||||
|
||||
export function svgFromObject(object) {
|
||||
var objectDoc = object.contentDocument;
|
||||
var svgItem = objectDoc.querySelector("path");
|
||||
return svgItem
|
||||
var objectDoc = object.contentDocument
|
||||
var svgItems = objectDoc.querySelectorAll("path")
|
||||
return svgItems
|
||||
}
|
||||
|
||||
export function rem2px(rem) {
|
||||
|
@@ -6,7 +6,15 @@ export function addGroupPinContent(g,content,locale) {
|
||||
for (let field of ["location","members","contact"]) {
|
||||
let fieldText = content[field] + ": "
|
||||
if (field=="contact") {
|
||||
text += fieldText + "<a href='" + g.contact + "' target='_blank' rel=noreferrer>" + g.contact + "</a>"
|
||||
if (g.contact.includes("@") && g.contact.trim().split(" ").length==1) {
|
||||
text += fieldText + "<a href='mailto:" + g.contact + "' target='_blank' rel=noreferrer>" + g.contact + "</a>"
|
||||
}
|
||||
else if (g.contact.includes("http")) {
|
||||
text += fieldText + "<a href='" + g.contact + "' target='_blank' rel=noreferrer>" + g.contact + "</a>"
|
||||
}
|
||||
else {
|
||||
text += fieldText + g.contact + "<br>"
|
||||
}
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined)
|
||||
@@ -175,4 +183,31 @@ export function addPartnersPinContent(g,content,locale) {
|
||||
}
|
||||
}
|
||||
return {text,coordinates}
|
||||
}
|
||||
|
||||
export function addTradeUnionPinContent(g,content,locale) {
|
||||
let coordinates
|
||||
let text = "<b>"+content["TradeUnion"]+"</b><br>"
|
||||
for (let field of ["name","location","members","contact"]) {
|
||||
let fieldText = content[field] + ": "
|
||||
if (field=="contact") {
|
||||
text += fieldText + "<a href='" + g.contact + "' target='_blank' rel=noreferrer>" + g.contact + "</a>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined)
|
||||
let locationString
|
||||
if (locale=="en") {
|
||||
locationString = location.map(x => x).join(", ")
|
||||
}
|
||||
else {
|
||||
locationString = location.map(x => translate(content, x)).join(", ")
|
||||
}
|
||||
text += fieldText + locationString + "<br>"
|
||||
coordinates = [g.latitude,g.longitude]
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
}
|
||||
return {text,coordinates}
|
||||
}
|
Reference in New Issue
Block a user