-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kolejna aktualizacja scenriusza rozszerzonego Czat
- Loading branch information
Showing
25 changed files
with
464 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- czat/czat/templates/czat/base.html --> | ||
<html> | ||
<head> | ||
<title>{% block tytul %} System wiadomości Czat {% endblock tytul %}</title> | ||
</head> | ||
<body> | ||
<h1>{% block naglowek %} Witaj w aplikacji Czat! {% endblock naglowek %}</h1> | ||
|
||
{% block komunikaty %} | ||
{% if messages %} | ||
<ul> | ||
{% for komunikat in messages %} | ||
<li>{{ komunikat|capfirst }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endblock komunikaty %} | ||
|
||
{% block tresc %} {% endblock tresc %} | ||
|
||
{% if user.is_authenticated %} | ||
{% block linkilog %} {% endblock linkilog %} | ||
<p><a href="{% url 'wyloguj' %}">Wyloguj się</a></p> | ||
{% else %} | ||
{% block linkizalog %} {% endblock linkizalog %} | ||
{% endif %} | ||
|
||
{% block linki %} {% endblock linki %} | ||
</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
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,16 @@ | ||
<!-- czat/czat/templates/czat/index.html --> | ||
{% extends "czat/base.html" %} | ||
|
||
{% block naglowek %}Witaj w aplikacji Czat!{% endblock naglowek %} | ||
|
||
{% block linkilog %} | ||
<p>Jesteś zalogowany jako {{ user.username }}.</p> | ||
<p><a href="{% url 'wiadomosc' %}">Dodaj wiadomość</a></p> | ||
<p><a href="{% url 'wiadomosci' %}">Lista wiadomości</a></p> | ||
{% endblock linkilog %} | ||
|
||
{% block linkizalog %} | ||
<p><a href="{% url 'loguj' %}">Zaloguj się</a></p> | ||
<p><a href="{% url 'rejestruj' %}">Zarejestruj się</a></p> | ||
{% endblock linkizalog %} | ||
|
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,22 @@ | ||
<!-- czat/czat/templates/czat/rejestruj.html --> | ||
{% extends "czat/base.html" %} | ||
|
||
{% block naglowek %}Rejestracja użytkownika{% endblock naglowek %} | ||
|
||
{% block tresc %} | ||
{% if not user.is_authenticated %} | ||
<form method="POST"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<button type="submit">Zarejestruj</button> | ||
</form> | ||
{% endif %} | ||
{% endblock tresc %} | ||
|
||
{% block linkilog %} | ||
<p>Jesteś już zarejestrowany jako {{ user.username }}.</p> | ||
{% endblock linkilog %} | ||
|
||
{% block linki %} | ||
<p><a href="{% url 'index' %}">Strona główna</a></p> | ||
{% endblock linki %} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- czat/czat/templates/czat/wiadomosc_list.html --> | ||
<html> | ||
<body> | ||
<h1>Wiadomości</h1> | ||
<p>Cześć, {{ user.username }}</p> | ||
{% if messages %} | ||
<ul> | ||
{% for komunikat in messages %} | ||
<li>{{ komunikat|capfirst }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
|
||
<h2>Lista wiadomości:</h2> | ||
<ol> | ||
{% for wiadomosc in wiadomosci %} | ||
<li> | ||
<strong>{{ wiadomosc.autor.username }}</strong> ({{ wiadomosc.data_pub }}): | ||
<br /> {{ wiadomosc.tekst }} | ||
{% if wiadomosc.autor.username == user.username %} | ||
<a href="{% url 'aktualizuj' wiadomosc.id %}">Edytuj</a> • | ||
<a href="{% url 'usun' wiadomosc.id %}">Usuń</a> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
|
||
<p><a href="{% url 'index' %}">Strona główna</a></p> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- czat/czat/templates/czat/wiadomosc_usun.html --> | ||
<html> | ||
<body> | ||
<h1>Wiadomości</h1> | ||
|
||
{% if messages %} | ||
<ul> | ||
{% for komunikat in messages %} | ||
<li>{{ komunikat|capfirst }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
|
||
<h2>Usuń wiadomość</h2> | ||
<form method="POST"> | ||
{% csrf_token %} | ||
<p>Czy na pewno chcesz usunąć wiadomość:<br />"{{ object }}"?</p> | ||
<button type="submit">Usuń</button> | ||
</form> | ||
|
||
<p><a href="{% url 'index' %}">Strona główna</a></p> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- czat/czat/templates/czat/base.html --> | ||
<html> | ||
<head> | ||
<title>{% block tytul %} System wiadomości Czat {% endblock tytul %}</title> | ||
</head> | ||
<body> | ||
<h1>{% block naglowek %} Witaj w aplikacji Czat! {% endblock naglowek %}</h1> | ||
|
||
{% block komunikaty %} | ||
{% if messages %} | ||
<ul> | ||
{% for komunikat in messages %} | ||
<li>{{ komunikat|capfirst }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endblock komunikaty %} | ||
|
||
{% block tresc %} {% endblock tresc %} | ||
|
||
{% if user.is_authenticated %} | ||
{% block linkilog %} {% endblock linkilog %} | ||
<p><a href="{% url 'wyloguj' %}">Wyloguj się</a></p> | ||
{% else %} | ||
{% block linkizalog %} {% endblock linkizalog %} | ||
{% endif %} | ||
|
||
{% block linki %} {% endblock linki %} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,16 @@ | ||
<!-- czat/czat/templates/czat/index.html --> | ||
<html> | ||
<head></head> | ||
<body> | ||
<h1>Witaj w aplikacji Czat!</h1> | ||
{% extends "czat/base.html" %} | ||
|
||
{% if messages %} | ||
<ul> | ||
{% for komunikat in messages %} | ||
<li>{{ komunikat|capfirst }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% block naglowek %}Witaj w aplikacji Czat!{% endblock naglowek %} | ||
|
||
{% block linkilog %} | ||
<p>Jesteś zalogowany jako {{ user.username }}.</p> | ||
<p><a href="{% url 'wiadomosc' %}">Dodaj wiadomość</a></p> | ||
<p><a href="{% url 'wiadomosci' %}">Lista wiadomości</a></p> | ||
{% endblock linkilog %} | ||
|
||
{% block linkizalog %} | ||
<p><a href="{% url 'loguj' %}">Zaloguj się</a></p> | ||
<p><a href="{% url 'rejestruj' %}">Zarejestruj się</a></p> | ||
{% endblock linkizalog %} | ||
|
||
{% if user.is_authenticated %} | ||
<p>Jesteś zalogowany jako {{ user.username }}.</p> | ||
<p><a href="{% url 'wiadomosc' %}">Dodaj wiadomość</a></p> | ||
<p><a href="{% url 'wiadomosci' %}">Lista wiadomości</a></p> | ||
<p><a href="{% url 'wyloguj' %}">Wyloguj się</a></p> | ||
{% else %} | ||
<p><a href="{% url 'loguj' %}">Zaloguj się</a></p> | ||
<p><a href="{% url 'rejestruj' %}">Zarejestruj się</a></p> | ||
{% endif %} | ||
</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
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,25 @@ | ||
<!-- czat/czat/templates/czat/index.html --> | ||
<html> | ||
<head></head> | ||
<body> | ||
<h1>Witaj w aplikacji Czat!</h1> | ||
|
||
{% if messages %} | ||
<ul> | ||
{% for komunikat in messages %} | ||
<li>{{ komunikat|capfirst }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
|
||
{% if user.is_authenticated %} | ||
<p>Jesteś zalogowany jako {{ user.username }}.</p> | ||
<p><a href="{% url 'wiadomosc' %}">Dodaj wiadomość</a></p> | ||
<p><a href="{% url 'wiadomosci' %}">Lista wiadomości</a></p> | ||
<p><a href="{% url 'wyloguj' %}">Wyloguj się</a></p> | ||
{% else %} | ||
<p><a href="{% url 'loguj' %}">Zaloguj się</a></p> | ||
<p><a href="{% url 'rejestruj' %}">Zarejestruj się</a></p> | ||
{% endif %} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!-- czat/czat/templates/czat/loguj.html --> | ||
<html> | ||
<body> | ||
<h1>Logowanie użytkownika</h1> | ||
{% if user.is_authenticated %} | ||
<p>Jesteś już zalogowany jako {{ user.username }}. | ||
<br /><a href="/">Strona główna</a></p> | ||
{% else %} | ||
<form method="POST"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<button type="submit">Zaloguj</button> | ||
</form> | ||
{% endif %} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!-- czat/czat/templates/czat/rejestruj.html --> | ||
<html> | ||
<body> | ||
<h1>Rejestracja użytkownika</h1> | ||
{% if user.is_authenticated %} | ||
<p>Jesteś już zarejestrowany jako {{ user.username }}. | ||
<br /><a href="/">Strona główna</a></p> | ||
{% else %} | ||
<form method="POST"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<button type="submit">Zarejestruj</button> | ||
</form> | ||
{% endif %} | ||
</body> | ||
</html> |
Oops, something went wrong.