generated from MinBZK/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
319 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PROJECT VERSION\n" | ||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | ||
"POT-Creation-Date: 2024-06-24 10:53+0200\n" | ||
"POT-Creation-Date: 2024-07-03 11:56+0200\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -17,14 +17,14 @@ msgstr "" | |
"Content-Transfer-Encoding: 8bit\n" | ||
"Generated-By: Babel 2.15.0\n" | ||
|
||
#: tad/site/templates/default_layout.jinja:19 | ||
msgid "Transparency of Algorithmic Decision making (TAD)" | ||
msgstr "" | ||
|
||
#: tad/site/templates/default_layout.jinja:49 | ||
#: tad/site/templates/default_header.html.jinja:6 | ||
msgid "Transparency of Algorithmic Decision making" | ||
msgstr "" | ||
|
||
#: tad/site/templates/default_layout.jinja:55 | ||
#: tad/site/templates/default_header.html.jinja:12 | ||
msgid "Language" | ||
msgstr "" | ||
|
||
#: tad/site/templates/layouts/base.html.jinja:10 | ||
msgid "Transparency of Algorithmic Decision making (TAD)" | ||
msgstr "" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PROJECT VERSION\n" | ||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | ||
"POT-Creation-Date: 2024-06-24 10:53+0200\n" | ||
"PO-Revision-Date: 2024-06-24 09:48+0200\n" | ||
"POT-Creation-Date: 2024-07-03 11:56+0200\n" | ||
"PO-Revision-Date: 2024-07-02 11:20+0200\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language: en_US\n" | ||
"Language-Team: en_US <[email protected]>\n" | ||
|
@@ -18,14 +18,23 @@ msgstr "" | |
"Content-Transfer-Encoding: 8bit\n" | ||
"Generated-By: Babel 2.15.0\n" | ||
|
||
#: tad/site/templates/default_layout.jinja:19 | ||
msgid "Transparency of Algorithmic Decision making (TAD)" | ||
msgstr "" | ||
|
||
#: tad/site/templates/default_layout.jinja:49 | ||
#: tad/site/templates/default_header.html.jinja:6 | ||
msgid "Transparency of Algorithmic Decision making" | ||
msgstr "" | ||
|
||
#: tad/site/templates/default_layout.jinja:55 | ||
#: tad/site/templates/default_header.html.jinja:12 | ||
msgid "Language" | ||
msgstr "" | ||
|
||
#: tad/site/templates/layouts/base.html.jinja:10 | ||
msgid "Transparency of Algorithmic Decision making (TAD)" | ||
msgstr "" | ||
|
||
#~ msgid "Transparency of Algorithmic Decision making (TAD)" | ||
#~ msgstr "" | ||
|
||
#~ msgid "Transparency of Algorithmic Decision making" | ||
#~ msgstr "" | ||
|
||
#~ msgid "Language" | ||
#~ msgstr "" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PROJECT VERSION\n" | ||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | ||
"POT-Creation-Date: 2024-06-24 10:53+0200\n" | ||
"PO-Revision-Date: 2024-06-24 09:48+0200\n" | ||
"POT-Creation-Date: 2024-07-03 11:56+0200\n" | ||
"PO-Revision-Date: 2024-07-02 11:05+0200\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language: nl_FY\n" | ||
"Language-Team: nl_FY <[email protected]>\n" | ||
|
@@ -18,14 +18,23 @@ msgstr "" | |
"Content-Transfer-Encoding: 8bit\n" | ||
"Generated-By: Babel 2.15.0\n" | ||
|
||
#: tad/site/templates/default_layout.jinja:19 | ||
msgid "Transparency of Algorithmic Decision making (TAD)" | ||
msgstr "Transparânsje fan algoritmyske beslútfoarming (TAD)" | ||
|
||
#: tad/site/templates/default_layout.jinja:49 | ||
#: tad/site/templates/default_header.html.jinja:6 | ||
msgid "Transparency of Algorithmic Decision making" | ||
msgstr "Transparânsje fan algoritmyske beslútfoarming" | ||
msgstr "" | ||
|
||
#: tad/site/templates/default_layout.jinja:55 | ||
#: tad/site/templates/default_header.html.jinja:12 | ||
msgid "Language" | ||
msgstr "Taal" | ||
msgstr "" | ||
|
||
#: tad/site/templates/layouts/base.html.jinja:10 | ||
msgid "Transparency of Algorithmic Decision making (TAD)" | ||
msgstr "" | ||
|
||
#~ msgid "Transparency of Algorithmic Decision making (TAD)" | ||
#~ msgstr "Transparânsje fan algoritmyske beslútfoarming (TAD)" | ||
|
||
#~ msgid "Transparency of Algorithmic Decision making" | ||
#~ msgstr "Transparânsje fan algoritmyske beslútfoarming" | ||
|
||
#~ msgid "Language" | ||
#~ msgstr "Taal" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PROJECT VERSION\n" | ||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | ||
"POT-Creation-Date: 2024-06-24 10:53+0200\n" | ||
"PO-Revision-Date: 2024-06-24 09:48+0200\n" | ||
"POT-Creation-Date: 2024-07-03 11:56+0200\n" | ||
"PO-Revision-Date: 2024-07-02 11:20+0200\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language: nl_NL\n" | ||
"Language-Team: nl_NL <[email protected]>\n" | ||
|
@@ -18,14 +18,23 @@ msgstr "" | |
"Content-Transfer-Encoding: 8bit\n" | ||
"Generated-By: Babel 2.15.0\n" | ||
|
||
#: tad/site/templates/default_layout.jinja:19 | ||
msgid "Transparency of Algorithmic Decision making (TAD)" | ||
msgstr "Transparantie voor Algoritmische Besluitvorming (TAD)" | ||
|
||
#: tad/site/templates/default_layout.jinja:49 | ||
#: tad/site/templates/default_header.html.jinja:6 | ||
msgid "Transparency of Algorithmic Decision making" | ||
msgstr "Transparantie voor Algoritmische Besluitvorming" | ||
msgstr "" | ||
|
||
#: tad/site/templates/default_layout.jinja:55 | ||
#: tad/site/templates/default_header.html.jinja:12 | ||
msgid "Language" | ||
msgstr "Taal" | ||
msgstr "" | ||
|
||
#: tad/site/templates/layouts/base.html.jinja:10 | ||
msgid "Transparency of Algorithmic Decision making (TAD)" | ||
msgstr "" | ||
|
||
#~ msgid "Transparency of Algorithmic Decision making (TAD)" | ||
#~ msgstr "Transparantie voor Algoritmische Besluitvorming (TAD)" | ||
|
||
#~ msgid "Transparency of Algorithmic Decision making" | ||
#~ msgstr "Transparantie voor Algoritmische Besluitvorming" | ||
|
||
#~ msgid "Language" | ||
#~ msgstr "Taal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
htmx.defineExtension('json-enc', { | ||
onEvent: function (name, evt) { | ||
if (name === "htmx:configRequest") { | ||
evt.detail.headers['Content-Type'] = "application/json"; | ||
} | ||
}, | ||
|
||
encodeParameters : function(xhr, parameters, elt) { | ||
xhr.overrideMimeType('text/json'); | ||
return (JSON.stringify(parameters)); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
(function(){ | ||
|
||
/** @type {import("../htmx").HtmxInternalApi} */ | ||
var api; | ||
|
||
var attrPrefix = 'hx-target-'; | ||
|
||
// IE11 doesn't support string.startsWith | ||
function startsWith(str, prefix) { | ||
return str.substring(0, prefix.length) === prefix | ||
} | ||
|
||
/** | ||
* @param {HTMLElement} elt | ||
* @param {number} respCode | ||
* @returns {HTMLElement | null} | ||
*/ | ||
function getRespCodeTarget(elt, respCodeNumber) { | ||
if (!elt || !respCodeNumber) return null; | ||
|
||
var respCode = respCodeNumber.toString(); | ||
|
||
// '*' is the original syntax, as the obvious character for a wildcard. | ||
// The 'x' alternative was added for maximum compatibility with HTML | ||
// templating engines, due to ambiguity around which characters are | ||
// supported in HTML attributes. | ||
// | ||
// Start with the most specific possible attribute and generalize from | ||
// there. | ||
var attrPossibilities = [ | ||
respCode, | ||
|
||
respCode.substr(0, 2) + '*', | ||
respCode.substr(0, 2) + 'x', | ||
|
||
respCode.substr(0, 1) + '*', | ||
respCode.substr(0, 1) + 'x', | ||
respCode.substr(0, 1) + '**', | ||
respCode.substr(0, 1) + 'xx', | ||
|
||
'*', | ||
'x', | ||
'***', | ||
'xxx', | ||
]; | ||
if (startsWith(respCode, '4') || startsWith(respCode, '5')) { | ||
attrPossibilities.push('error'); | ||
} | ||
|
||
for (var i = 0; i < attrPossibilities.length; i++) { | ||
var attr = attrPrefix + attrPossibilities[i]; | ||
var attrValue = api.getClosestAttributeValue(elt, attr); | ||
if (attrValue) { | ||
if (attrValue === "this") { | ||
return api.findThisElement(elt, attr); | ||
} else { | ||
return api.querySelectorExt(elt, attrValue); | ||
} | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
|
||
/** @param {Event} evt */ | ||
function handleErrorFlag(evt) { | ||
if (evt.detail.isError) { | ||
if (htmx.config.responseTargetUnsetsError) { | ||
evt.detail.isError = false; | ||
} | ||
} else if (htmx.config.responseTargetSetsError) { | ||
evt.detail.isError = true; | ||
} | ||
} | ||
|
||
htmx.defineExtension('response-targets', { | ||
|
||
/** @param {import("../htmx").HtmxInternalApi} apiRef */ | ||
init: function (apiRef) { | ||
api = apiRef; | ||
|
||
if (htmx.config.responseTargetUnsetsError === undefined) { | ||
htmx.config.responseTargetUnsetsError = true; | ||
} | ||
if (htmx.config.responseTargetSetsError === undefined) { | ||
htmx.config.responseTargetSetsError = false; | ||
} | ||
if (htmx.config.responseTargetPrefersExisting === undefined) { | ||
htmx.config.responseTargetPrefersExisting = false; | ||
} | ||
if (htmx.config.responseTargetPrefersRetargetHeader === undefined) { | ||
htmx.config.responseTargetPrefersRetargetHeader = true; | ||
} | ||
}, | ||
|
||
/** | ||
* @param {string} name | ||
* @param {Event} evt | ||
*/ | ||
onEvent: function (name, evt) { | ||
if (name === "htmx:beforeSwap" && | ||
evt.detail.xhr && | ||
evt.detail.xhr.status !== 200) { | ||
if (evt.detail.target) { | ||
if (htmx.config.responseTargetPrefersExisting) { | ||
evt.detail.shouldSwap = true; | ||
handleErrorFlag(evt); | ||
return true; | ||
} | ||
if (htmx.config.responseTargetPrefersRetargetHeader && | ||
evt.detail.xhr.getAllResponseHeaders().match(/HX-Retarget:/i)) { | ||
evt.detail.shouldSwap = true; | ||
handleErrorFlag(evt); | ||
return true; | ||
} | ||
} | ||
if (!evt.detail.requestConfig) { | ||
return true; | ||
} | ||
var target = getRespCodeTarget(evt.detail.requestConfig.elt, evt.detail.xhr.status); | ||
if (target) { | ||
handleErrorFlag(evt); | ||
evt.detail.shouldSwap = true; | ||
evt.detail.target = target; | ||
} | ||
return true; | ||
} | ||
} | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<header class="header"> | ||
<div class="container"> | ||
<div class="header_logo_container"> | ||
<img class="header_logo_image" src="/static/images/logo.svg"/> | ||
<div class="header_subtitle_container"> | ||
<span>{% trans %}Transparency of Algorithmic Decision making{% endtrans %} ({{ version }})</span> | ||
</div> | ||
</div> | ||
</div> | ||
<nav class="header_nav"> | ||
<div style="color: white; float: right; margin-right: 50px; width: 10em; height: 100%; display: flex; align-items: center"> | ||
{% trans %}Language{% endtrans %}: | ||
{% for available_translation in available_translations %} | ||
<a {% if available_translation == language %}class="selected"{% endif %} id="langselect-{{ available_translation }}" style="color: white; text-decoration: none" href="javascript:setCookie('lang','{{ available_translation }}',9999); window.location.reload()">{{ available_translation }}</a> | ||
{% endfor %} | ||
</div> | ||
|
||
</nav> | ||
</header> |
Oops, something went wrong.