Created
December 26, 2016 18:50
-
-
Save sfalexrog/96e05bd7d690cd759ca59bc41a45bc18 to your computer and use it in GitHub Desktop.
Пример наследования шаблонов
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
{# include all required js/css stuff here #} | |
<link rel="stylesheet" href="{{ url_for('static', filename='bootstrap/css/bootstrap.min.css') }}"> | |
<link rel="stylesheet" href="{{ url_for('static', filename='bootstrap/css/bootstrap-theme.min.css') }}"> | |
<script src="{{ url_for('static', filename='js/json3.min.js') }}"></script> | |
<script src="{{ url_for('static', filename='js/jquery-3.1.1.js') }}"></script> | |
<script src="{{ url_for('static', filename='bootstrap/js/bootstrap.js') }}"></script> | |
<script src="{{ url_for('static', filename='js/captured_pieces.js') }}"></script> | |
{% block includes_extra %} | |
{% endblock %} | |
<title>Title</title> | |
</head> | |
<body> | |
{% block body %} | |
{% endblock %} | |
</body> | |
</html> |
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
{% extends "base.html" %} | |
{% block includes_extra %} | |
<link rel="stylesheet" href="{{ url_for('static', filename='css/bits/modal_login.css') }}"> | |
<script src="{{ url_for('static', filename='js/bits/modal_login.js') }}"></script> | |
{% endblock %} | |
{% block body %} | |
<div id="header"> | |
{% if is_logged_in %} | |
<p class="text-right">{{ user.username }} | Очки: {{ user.elo_score }} | <a href="/api/logout" class="btn btn-default btn-sm">Выйти?</a></p> | |
{% else %} | |
<p class="text-right"><a href="#" class="btn btn-primary btn-sm" role="button" data-toggle="modal" data-target="#login-modal">Войти</a></p> | |
{% include 'bits/modal_login.html' %} | |
{% endif %} | |
</div> | |
<div id="tourney-container"> | |
<table class="table"> | |
<tr> | |
<th> | |
Игрок | |
</th> | |
<th> | |
Очки | |
</th> | |
<th> | |
Статус | |
</th> | |
</tr> | |
{% for player in players %} | |
<tr> | |
<td> | |
<a href="players/{{ player.username }}">{{ player.username }}</a> | |
</td> | |
<td> | |
{{ player.elo_score }} | |
</td> | |
<td> | |
{% if player.is_online() %} | |
Сейчас онлайн <button class="btn btn-default">Сыграть!</button> | |
{% else %} | |
Сейчас оффлайн | |
{% endif %} | |
</td> | |
</tr> | |
{% endfor %} | |
</table> | |
</div> | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment