Compare commits
2 Commits
62f190c5b1
...
ae1eaa3c26
Author | SHA1 | Date | |
---|---|---|---|
ae1eaa3c26 | |||
49e5f8b9b7 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
template_upstream
|
template_upstream
|
||||||
archive
|
archive
|
||||||
template.zip
|
template.zip
|
||||||
|
programmes.js
|
||||||
|
@@ -2,5 +2,7 @@
|
|||||||
|
|
||||||
Before you host this yourself, make sure to run the `build.sh` script to create the template archive. Without it, the generator will not work.
|
Before you host this yourself, make sure to run the `build.sh` script to create the template archive. Without it, the generator will not work.
|
||||||
|
|
||||||
|
Make sure that you have the `csvkit` and `jq` packages installed on your Arch system, they are needed to generate the list of study programmes.
|
||||||
|
|
||||||
[Here's a running instance of this generator, just to get a rough idea.](https://internal.prochazkaml.eu/tultemplategen)
|
[Here's a running instance of this generator, just to get a rough idea.](https://internal.prochazkaml.eu/tultemplategen)
|
||||||
|
|
||||||
|
14
build.sh
14
build.sh
@@ -1,5 +1,19 @@
|
|||||||
mkdir -p archive
|
mkdir -p archive
|
||||||
|
|
||||||
|
echo -n "const programmes = " > programmes.js
|
||||||
|
curl "https://stag.tul.cz/StagPortletsJSR168/ProhlizeniPrint?stateClass=cz.zcu.stag.portlets168.prohlizeni.browser.BrowserFakultaSearchState&wservice=programy/getStudijniProgramy&outputFormat=CSV&pouzePlatne=true&lang=cs" | csvjson -e cp1250 | jq 'group_by(.fakulta | ascii_downcase) | [.[] | {
|
||||||
|
key: .[0].fakulta | ascii_downcase | if . == "fe" then "ef" else . end | if . == "fa" then "fua" else . end,
|
||||||
|
value: [.[] | {
|
||||||
|
code: .kod | ascii_upcase,
|
||||||
|
type: .typ | ascii_downcase // .titulZkr // .titul,
|
||||||
|
title: .titulZkr // .titul // "bez titulu",
|
||||||
|
form: .forma | ascii_downcase,
|
||||||
|
year: .platnyOd | round,
|
||||||
|
cs_name: .nazevCz // .nazev,
|
||||||
|
en_name: .nazevAn // .nazev
|
||||||
|
}]
|
||||||
|
}] | from_entries' >> programmes.js
|
||||||
|
|
||||||
if [ ! -d template_upstream ]; then
|
if [ ! -d template_upstream ]; then
|
||||||
git clone git@gordon.zumepro.cz:tul/tultemplate2 template_upstream
|
git clone git@gordon.zumepro.cz:tul/tultemplate2 template_upstream
|
||||||
else
|
else
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="stylesheet" href="styles.css">
|
<link rel="stylesheet" href="styles.css">
|
||||||
<script type="text/javascript" src="lib/jszip.min.js"></script>
|
<script type="text/javascript" src="lib/jszip.min.js"></script>
|
||||||
|
<script type="text/javascript" src="programmes.js"></script>
|
||||||
<script type="text/javascript" src="ui.js"></script>
|
<script type="text/javascript" src="ui.js"></script>
|
||||||
<script type="text/javascript" src="utils.js"></script>
|
<script type="text/javascript" src="utils.js"></script>
|
||||||
<script type="text/javascript" src="data.js"></script>
|
<script type="text/javascript" src="data.js"></script>
|
||||||
|
Reference in New Issue
Block a user