Merge branch 'master' into beta
This commit is contained in:
commit
ccf234444b
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
@ -16,7 +16,7 @@ class Main extends Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
text: "",
|
status_text: "",
|
||||||
status: "",
|
status: "",
|
||||||
faq: false,
|
faq: false,
|
||||||
results: [],
|
results: [],
|
||||||
@ -43,7 +43,7 @@ class Main extends Component {
|
|||||||
for(const [key, value] of searchParams){
|
for(const [key, value] of searchParams){
|
||||||
if (key == "refId"){
|
if (key == "refId"){
|
||||||
fetch(addr_prefix + "/api/payment_state?refId=" + value).then(resp => resp.json()).then(json =>{
|
fetch(addr_prefix + "/api/payment_state?refId=" + value).then(resp => resp.json()).then(json =>{
|
||||||
this.setState({status: json.status, text: json.reason})
|
this.setState({status: json.status, status_text: json.reason})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ class Main extends Component {
|
|||||||
this.setState({progress:false, uploadProgress: 1.0});
|
this.setState({progress:false, uploadProgress: 1.0});
|
||||||
if(data.reason){
|
if(data.reason){
|
||||||
this.setState({
|
this.setState({
|
||||||
text: data.reason,
|
status_text: data.reason,
|
||||||
status: "failed",
|
status: "failed",
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@ -95,13 +95,19 @@ class Main extends Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
text: data.success,
|
status_text: data.success,
|
||||||
status: "success",
|
status: "success",
|
||||||
})
|
})
|
||||||
if (data.redirect){
|
if (data.redirect){
|
||||||
window.open(data.redirect ,"_self")
|
window.open(data.redirect ,"_self")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
this.setState({
|
||||||
|
progress: false,
|
||||||
|
status_text: "Chyba: " + error.response.status +", " + error.response.data,
|
||||||
|
status: "failed",
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
togglefaq(){
|
togglefaq(){
|
||||||
@ -167,12 +173,12 @@ class Main extends Component {
|
|||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
{this.state.status == "success" &&
|
{this.state.status == "success" &&
|
||||||
<div class="absolute container-fluid alert alert-success">
|
<div class="absolute container-fluid alert alert-success" onClick={(e) => {this.setState({status: "", status_text:""})}}>
|
||||||
{this.state.text}
|
{this.state.status_text}
|
||||||
</div>}
|
</div>}
|
||||||
{this.state.status == "failed" &&
|
{this.state.status == "failed" &&
|
||||||
<div class="absolute container-fluid alert alert-danger">
|
<div class="absolute container-fluid alert alert-danger" onClick={(e) => {this.setState({status: "", status_text:""})}}>
|
||||||
{this.state.text}
|
{this.state.status_text}
|
||||||
</div>}
|
</div>}
|
||||||
{this.state.page == "#login" &&
|
{this.state.page == "#login" &&
|
||||||
<div>
|
<div>
|
||||||
@ -186,8 +192,9 @@ class Main extends Component {
|
|||||||
{this.state.page == "#upload_files" &&
|
{this.state.page == "#upload_files" &&
|
||||||
<div>
|
<div>
|
||||||
<form id="form" action="/api/upload_files" class="container" onSubmit={(e) => this.onSubmit(e)}>
|
<form id="form" action="/api/upload_files" class="container" onSubmit={(e) => this.onSubmit(e)}>
|
||||||
<label>Zvolte soubory <input type="file" name="files" accept=".jpg,.png,.webp,.webm,.avi,.mkv,.mp4" multiple={true}/></label>
|
<label>Zvolte soubory <input type="file" name="files" accept=".jpg,.png,.webp,.webm,.avi,.mkv,.mp4" multiple={true} onChange={(e)=> this.handleChangeFiles.bind(this)(e)}/></label>
|
||||||
<button type="submit" class="btn btn-primary">Nahrát</button> <b>progress: {(this.state.uploadProgress * 100).toFixed(1)}%</b>
|
<button type="submit" class="btn btn-primary">Nahrát</button><b>progress: {(this.state.uploadProgress * 100).toFixed(1)}%</b><br />
|
||||||
|
Nahráním fotek/videí nám dávate souhlas s použitím vaších fotek k propagaci a zvěřejněním na stránkách.
|
||||||
</form>
|
</form>
|
||||||
</div>}
|
</div>}
|
||||||
{this.state.page == "#payment" &&
|
{this.state.page == "#payment" &&
|
||||||
@ -320,9 +327,10 @@ class Main extends Component {
|
|||||||
|
|
||||||
<p>Rozhodně se podívej na FAQ sekci, zde na stránce, kde najdeš důležité informace týkající se závodu ALKÁTOR RACE.</p>
|
<p>Rozhodně se podívej na FAQ sekci, zde na stránce, kde najdeš důležité informace týkající se závodu ALKÁTOR RACE.</p>
|
||||||
<p>Sportem ku chlastu!</p>
|
<p>Sportem ku chlastu!</p>
|
||||||
|
<iframe width="100%" height="500px" src="https://www.youtube.com/embed/INYakiBnVNk?si=Nx9QtADyt_4XI5BC" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="true" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xl-6">
|
<div class="col-xl-6">
|
||||||
<h1 class="text">Výsledky 1. ročníku</h1>
|
<h1 class="text">Výsledky 2. ročníku (Podzim 2024)</h1>
|
||||||
{this.state.results &&
|
{this.state.results &&
|
||||||
<table class="table results">
|
<table class="table results">
|
||||||
<thead>
|
<thead>
|
||||||
@ -346,7 +354,6 @@ class Main extends Component {
|
|||||||
{/*
|
{/*
|
||||||
<img src="/public/trasa.png" style={{'width': '100%', 'height': 'auto'}}/>
|
<img src="/public/trasa.png" style={{'width': '100%', 'height': 'auto'}}/>
|
||||||
*/}
|
*/}
|
||||||
<iframe width="100%" height="500px" src="https://www.youtube.com/embed/INYakiBnVNk?si=Nx9QtADyt_4XI5BC" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="true" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -354,7 +361,7 @@ class Main extends Component {
|
|||||||
<h2>Stále nevíš, jestli se zúčastníš? Přečti si náš <button type="button" class="btn btn-warning" onClick={(e) => this.togglefaq()}>FAQ</button></h2>
|
<h2>Stále nevíš, jestli se zúčastníš? Přečti si náš <button type="button" class="btn btn-warning" onClick={(e) => this.togglefaq()}>FAQ</button></h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="container text text-center">
|
<div class="container text text-center">
|
||||||
<h1>Kapacita je aktuálně naplněna, budem se těšit u dalšího ročníku.</h1>
|
<h1>Další ročník bude na jaře 2025.</h1>
|
||||||
</div>
|
</div>
|
||||||
{/*
|
{/*
|
||||||
<form id="form" class="container" action="/api/register" onSubmit={(e) => this.onSubmit(e)}>
|
<form id="form" class="container" action="/api/register" onSubmit={(e) => this.onSubmit(e)}>
|
||||||
|
BIN
photos/plakat_1.jpg
Normal file
BIN
photos/plakat_1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 209 KiB |
@ -1,13 +1,19 @@
|
|||||||
import glob
|
import glob
|
||||||
import PIL.Image
|
import PIL.Image
|
||||||
|
import os
|
||||||
photos = glob.glob('photos/2/*.jpg')
|
x = 2
|
||||||
|
photos = glob.glob(f'photos/{x}/*.jpg')
|
||||||
|
|
||||||
for image in photos:
|
for image in photos:
|
||||||
print(image)
|
print(image)
|
||||||
img = PIL.Image.open(image)
|
img = PIL.Image.open(image)
|
||||||
img.save(image.replace('.jpg', '.webp'))
|
big_image = image.replace('.jpg', '.webp')
|
||||||
|
if os.path.exists(big_image):
|
||||||
|
continue
|
||||||
|
img.save(big_image)
|
||||||
ratio = 400/max(img.height, img.width)
|
ratio = 400/max(img.height, img.width)
|
||||||
img = img.resize((int(img.width * ratio), int(img.height * ratio)))
|
img = img.resize((int(img.width * ratio), int(img.height * ratio)))
|
||||||
image = image.replace('photos/', 'photos/thumbnail/').replace('.jpg', '.webp')
|
small_image = image.replace(f'photos/{x}/', f'photos/{x}/thumbnail/').replace('.jpg', '.webp')
|
||||||
img.save(image, quality=50, subsampling=2)
|
if os.path.exists(small_image):
|
||||||
|
continue
|
||||||
|
img.save(small_image, quality=50, subsampling=2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user