racers page
This commit is contained in:
parent
c87ff05370
commit
d1626a8460
@ -72,6 +72,5 @@ class Racer(models.Model):
|
|||||||
paid = models.BooleanField(default=False)
|
paid = models.BooleanField(default=False)
|
||||||
invoice_id = models.IntegerField(null=True, blank=True, unique=True)
|
invoice_id = models.IntegerField(null=True, blank=True, unique=True)
|
||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"<Racer {self.email} {self.first_name} {self.last_name} {self.team}>"
|
return f"<Racer {self.email} {self.first_name} {self.last_name} {self.team}>"
|
||||||
|
@ -164,7 +164,7 @@ class Main extends Component {
|
|||||||
</li>
|
</li>
|
||||||
{Object.keys(this.state.login_status).length === 0 &&
|
{Object.keys(this.state.login_status).length === 0 &&
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#login">Přihlašování</a>
|
<a class="nav-link" href="#login">Přihlášení</a>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
{Object.keys(this.state.login_status).length === 0 &&
|
{Object.keys(this.state.login_status).length === 0 &&
|
||||||
@ -172,6 +172,11 @@ class Main extends Component {
|
|||||||
<a class="nav-link" href="#register_user">Registrace</a>
|
<a class="nav-link" href="#register_user">Registrace</a>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
|
{this.state.login_status.racers.length > 1 &&
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#racers">Závodníci</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
{Object.keys(this.state.login_status).length > 0 &&
|
{Object.keys(this.state.login_status).length > 0 &&
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="#register_racer">Registrovat závodníka</a>
|
<a class="nav-link" href="#register_racer">Registrovat závodníka</a>
|
||||||
@ -186,13 +191,16 @@ class Main extends Component {
|
|||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
{this.state.status == "success" &&
|
{this.state.status == "success" &&
|
||||||
<div class="absolute container-fluid alert alert-success" onClick={(e) => {this.setState({status: "", status_text:""})}}>
|
<div class="absolute container-fluid alert alert-success" onClick={(e) => {this.setState({status: "", status_text:""})}}>
|
||||||
{this.state.status_text}
|
{this.state.status_text}
|
||||||
</div>}
|
</div>}
|
||||||
{this.state.status == "failed" &&
|
{this.state.status == "failed" &&
|
||||||
<div class="absolute container-fluid alert alert-danger" onClick={(e) => {this.setState({status: "", status_text:""})}}>
|
<div class="absolute container-fluid alert alert-danger" onClick={(e) => {this.setState({status: "", status_text:""})}}>
|
||||||
{this.state.status_text}
|
{this.state.status_text}
|
||||||
</div>}
|
</div>}
|
||||||
|
{this.state.page == "#racers" &&
|
||||||
|
this.state.login_status.racers
|
||||||
|
}
|
||||||
{this.state.page == "#register_racer" &&
|
{this.state.page == "#register_racer" &&
|
||||||
<div>
|
<div>
|
||||||
<form id="form" class="container" action="/api/register_racer" onSubmit={(e) => this.onSubmit(e)}>
|
<form id="form" class="container" action="/api/register_racer" onSubmit={(e) => this.onSubmit(e)}>
|
||||||
@ -250,11 +258,11 @@ class Main extends Component {
|
|||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="password1" class="form-label">Heslo:</label>
|
<label for="password1" class="form-label">Heslo:</label>
|
||||||
<input type="password1" class="form-control" name="password1"/>
|
<input type="password" class="form-control" name="password1"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="password2" class="form-label">Znovu heslo:</label>
|
<label for="password2" class="form-label">Znovu heslo:</label>
|
||||||
<input type="password2" class="form-control" name="password2"/>
|
<input type="password" class="form-control" name="password2"/>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-primary">Registrovat</button>
|
<button type="submit" class="btn btn-primary">Registrovat</button>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user