added link for second infosheet

This commit is contained in:
Dorian Zedler 2020-10-31 12:00:14 +01:00
parent a7c8ba3f81
commit 0ee35c6f6d
Signed by: dorian
GPG key ID: D3B255CB8BC7CD37

View file

@ -190,7 +190,15 @@ DataListView {
}
}
var infosheet = getCompInfoUrl(compIndex) !== undefined ? ("<a href='" + getCompInfoUrl(compIndex) + "'>" + qsTr('infosheet') + "</a>"): ""
var infoUrls = getCompInfoUrls(compIndex)
var infosheet = "";
if(infoUrls.length >= 1)
infosheet += ("<a href='" + getCompInfoUrls(compIndex)[0] + "'>" + qsTr('infosheet') + "</a>")
if(infoUrls.length === 2)
infosheet += (", <a href='" + getCompInfoUrls(compIndex)[1] + "'>" + qsTr('further infos') + "</a>")
console.log("Infosheet: " + infosheet)
var eventWebsite = control.widgetData["competitions"][compIndex]["homepage"] !== undefined ? ("<a href='" + control.widgetData["competitions"][compIndex]["homepage"] + "'>" + qsTr('Event Website') + "</a>"):""
selector.appear(selectOptions, control.widgetData["competitions"][compIndex]['name'], eventWebsite + ((eventWebsite !== "" && infosheet !== "") ? ", ":"") + infosheet )
@ -270,23 +278,25 @@ DataListView {
}
function getCompInfoUrl(compIndex) {
switch(params.nation) {
case "GER":
if(control.widgetData["competitions"][compIndex]['info'] !== undefined){
return "http://ranking.alpenverein.de/" + control.year + "/GER/" + control.widgetData["competitions"][compIndex]['rkey'] + ".pdf"
}
return
case "SUI":
return
default:
if(control.widgetData["competitions"][compIndex]['info'] === undefined){
return control.widgetData["competitions"][compIndex]['info2']
}
else {
return control.widgetData["competitions"][compIndex]['info']
}
function getCompInfoUrls(compIndex) {
var urls = [];
if(control.widgetData["competitions"][compIndex].hasOwnProperty("info")) {
if(params.nation === "GER")
urls.push("http://ranking.alpenverein.de/" + control.year + "/GER/" + control.widgetData["competitions"][compIndex]['rkey'] + ".pdf")
else
urls.push(control.widgetData["competitions"][compIndex]['info'])
}
if(control.widgetData["competitions"][compIndex].hasOwnProperty("info2")) {
if(params.nation === "GER")
urls.push("http://ranking.alpenverein.de/" + control.year + "/GER/i" + control.widgetData["competitions"][compIndex]['rkey'] + ".pdf")
else
urls.push(control.widgetData["competitions"][compIndex]['info2'])
}
return urls;
}
function filterCats(display, cats) {
@ -414,7 +424,7 @@ DataListView {
width: parent.width
height: thisIsVisible ? compDelCol.height + 10 : 0
enabled: ((thisData["cats"] !== undefined && thisData["cats"].length > 0) || competitionDel.thisData["homepage"] !== undefined || getCompInfoUrl(index) !== undefined) && height > 0
enabled: ((thisData["cats"] !== undefined && thisData["cats"].length > 0) || competitionDel.thisData["homepage"] !== undefined || getCompInfoUrls(index).length > 0) && height > 0
//visible: includedByFilter
opacity: 0