Skip to content

Commit

Permalink
quickstart: better titles
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 19, 2020
1 parent 026a116 commit 8af573b
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 60 deletions.
7 changes: 2 additions & 5 deletions cs/quickstart/authentication.texy
@@ -1,5 +1,5 @@
Autentifikace
*************
Autentifikace <small>| První aplikace</small>
*********************************************

Nette poskytuje způsob jak naprogramovat autentifikaci na našich stránkách, ale do ničeho nás nenutí. Implementace je pouze na nás. Nette obsahuje rozhraní `Nette\Security\IAuthenticator`, které vyžaduje pouze jednu metodu `authenticate`, která ověřuje uživatele jakkoliv budeme chtít.

Expand Down Expand Up @@ -205,6 +205,3 @@ Shrnutí
=======

Nyní máme odkaz odkazující na nový presenter, který požaduje od uživatelů přihlašovací údaje a umožňuje jim přihlásit se. K ověření uživatele jsme použili *SimpleAuthenticator* a přihlašovací údaje máme v konfiguračním souboru. Jelikož se jedná o velmi jednoduchou aplikaci, nepotřebujeme více účtů. Také jsme zabezpečili všechny akce a formuláře, takže přidávat a editovat příspěvky mohou pouze přihlášení uživatelé.


{{title: Píšeme první aplikaci: Autentifikace}}
7 changes: 2 additions & 5 deletions cs/quickstart/comments.texy
@@ -1,5 +1,5 @@
Komentáře
*********
Komentáře <small>| První aplikace</small>
*****************************************

Nahráli jsme blog na webserver a publikovali několik velmi zajímavých příspěvků pomocí Admineru. Lidé čtou náš blog a jsou z něho velmi nadšení. Dostáváme každý den mnoho e-mailů s pochvalami. Ale k čemu je všechna tato chvála, pokud ji máme pouze v e-mailu a nikdo si ji nemůže přečíst? Bylo by lepší, kdyby mohl čtenář článek přímo komentovat, takže by si mohl každý přečíst, jak jsme úžasní.

Expand Down Expand Up @@ -160,6 +160,3 @@ Všimněte si speciálního atributu `n:tag-if`. Již víte jak `n:atributy` fun
<strong n:tag-if="$important"> Dobrý den! </strong>
{if $important}<strong>{/if} Dobrý den! {if $important}</strong>{/if}
```


{{title: Píšeme první aplikaci: Komentáře}}
7 changes: 2 additions & 5 deletions cs/quickstart/creating-posts.texy
@@ -1,5 +1,5 @@
Vytváření a editování příspěvků
*******************************
Vytváření a editování příspěvků <small>| První aplikace</small>
***************************************************************

To je paráda! Máme super cool nový blog, lidé urputně diskutují v komentářích a my máme konečně trochu času na další programování. Přestože je Adminer skvělý nástroj, není úplně ideální pro psaní nových příspěvků na blog. Zřejmě je ten správný čas pro vytvoření jednoduchého formuláře pro přidání nových příspěvků přímo z aplikace. Pojďme na to.

Expand Down Expand Up @@ -151,6 +151,3 @@ Shrnutí
=======

Blog je nyní funkční, návštěvníci jej aktivně komentují a my již nepotřebujeme na publikaci Adminer. Aplikace je plně nezávislá a kdokoliv může přidat nový příspěvek. Tak moment, to asi není úplně v pořádku, že kdokoliv - a tím myslím opravdu kdokoliv s přístupem na internet - může přidávat nové příspěvky. Je zapotřebí nějaké zabezpečení, aby mohl nový příspěvek přidat pouze přihlášený uživatel. Na to se podíváme v příští kapitole.


{{title: Píšeme první aplikaci: Vytváření a editování příspěvků}}
7 changes: 2 additions & 5 deletions cs/quickstart/home-page.texy
@@ -1,5 +1,5 @@
Úvodní stránka blogu
********************
Úvodní stránka blogu <small>| První aplikace</small>
****************************************************

.[perex]
Nyní si vytvoříme úvodní stránku zobrazující poslední příspěvky.
Expand Down Expand Up @@ -200,6 +200,3 @@ Shrnutí
=======

Nyní máme velmi jednoduchou MySQL databázi s pár příspěvky. Aplikace se připojuje k této databázi a vypisuje jednoduchý seznam těchto příspěvků do šablony.


{{title: Píšeme první aplikaci: Úvodní stránka blogu}}
7 changes: 2 additions & 5 deletions cs/quickstart/refactoring-model.texy
@@ -1,5 +1,5 @@
Model
*****
Model <small>| První aplikace</small>
*************************************

S tím, jak aplikace roste, brzy zjistíme, že na různých místech, v různých presenterech, potřebujeme provádět podobné operace s databází. Například získávat nejnovější publikované články. Když aplikaci vylepšíme třeba tím, že u článků přidáme příznak, zda je rozepsaný, musíme potom projít i všechna místa v aplikaci, kde se články z databáze získávají a doplnit podmínku where, aby se vybíraly jen články nerozepsané.

Expand Down Expand Up @@ -104,6 +104,3 @@ V sekci use máme `App\Model\ArticleManager`, tak si můžeme zápis v PHP kódu
V konstruktoru si požádáme o `ArticleManager`, který si přiřadíme do vlastnosti `$articleManager` a v metodě renderDefault zavoláme metodu `getPublicArticles()`. Nad výsledkem této funkce zavoláme ještě metodu `limit(5)`;

Třída `ArticleManager` si v konstruktoru řekne o předání `Nette\Database\Context` a jelikož je tato třída v DI containeru zaregistrovaná, kontejner tuto instanci vytvoří a předá ji. DI za nás takto vytvoří instanci ArticleManagera a předá ho v konstruktoru třídě HomepagePresenter, který si o něj požádal. Taková matrjoška. :) Všichni si jen říkají co chtějí a nezajímají se o to, kde se co a jak vytváří. O vytvoření se postará [Nette DI container |/dependency-injection].


{{title: Píšeme první aplikaci: Model}}
7 changes: 2 additions & 5 deletions cs/quickstart/single-post.texy
@@ -1,5 +1,5 @@
Stránka s příspěvkem
********************
Stránka s příspěvkem <small>| První aplikace</small>
****************************************************

.[perex]
Nyní si vytvoříme další stránku blogu, která bude zobrazovat jeden konkrétní příspěvek.
Expand Down Expand Up @@ -121,6 +121,3 @@ Shrnutí
=======

Máme databázi s příspěvky a webovou aplikaci, která má dva pohledy - první zobrazuje přehled všech příspěvků a druhá zobrazuje jeden konkrétní příspěvek.


{{title: Píšeme první aplikaci: Stránka s příspěvkem}}
7 changes: 2 additions & 5 deletions en/quickstart/authentication.texy
@@ -1,5 +1,5 @@
Authentication
**************
Authentication <small>| First Application</small>
*************************************************

Nette provides you with guidelines on how to program authentication on your page, but it doesn't force you to do it any particular way. The implementation is up to you. Nette has a `Nette\Security\IAuthenticator` interface which forces you to implement just a single method called `authenticate`, which finds the user anyhow you want.

Expand Down Expand Up @@ -204,6 +204,3 @@ Summary
=======

There is a `Sign in` link pointing to a new presenter, which asks the user for his credentials and authenticates him. We used *SimpleAuthenticator* and configured the usernames and passwords in the config file because it was a very easy way and we don't need more users at the moment. We also secured all required actions and forms, so that only logged in users can add new posts or edit existing ones.


{{title: Create Your First Application: Authentication}}
7 changes: 2 additions & 5 deletions en/quickstart/comments.texy
@@ -1,5 +1,5 @@
Comments
********
Comments <small>| First Application</small>
*******************************************

The blog has been deployed, we’ve written some very good blog posts and published them via Adminer. People are reading the blog and they’re very passionate about our ideas. We’re receiving many emails with praise each day. But what is all the praise for when we’ve got it only in the email, so no one else can read it? Wouldn’t it be better if people could comment directly on the blog so that everyone else could read how awesome we are?

Expand Down Expand Up @@ -160,6 +160,3 @@ Notice the special `n:tag-if` attribute. You already know how `n: attributes` wo
<strong n:tag-if="$important"> Hello there! </strong>
{if $important}<strong>{/if} Hello there! {if $important}</strong>{/if}
```


{{title: Create Your First Application: Comments}}
7 changes: 2 additions & 5 deletions en/quickstart/creating-posts.texy
@@ -1,5 +1,5 @@
Creating and Editing Posts
**************************
Creating and Editing Posts <small>| First Application</small>
*************************************************************

What a great time. We have a super cool new blog, people are arguing in comments and we have finally some time for more programming. Though we like Adminer, it is not that comfortable to write blog posts in it. Perhaps it's the right time to add a simple form for adding new posts directly from our app. Let’s do it.

Expand Down Expand Up @@ -151,6 +151,3 @@ Summary
=======

The blog is working, people are commenting rapidly and we no longer rely on Adminer for adding new posts. It is fully independent and even normal people can post there. But wait, that’s probably not ok, that anyone, I mean really anyone on the Internet, can post on our blog. Some form of authentication is required so that only logged-in users would be able to post. We'll add that in the next chapter.


{{title: Create Your First Application: Creating and Editing Posts}}
7 changes: 2 additions & 5 deletions en/quickstart/home-page.texy
@@ -1,5 +1,5 @@
Blog Home Page
**************
Blog Home Page <small>| First Application</small>
*************************************************

.[perex]
Let’s create the home page displaying your recent posts.
Expand Down Expand Up @@ -199,6 +199,3 @@ Summary
=======

We have a very simple MySQL database with some blog posts in it. The application connects to the database and displays a simple list of the posts.


{{title: Create Your First Application: Blog Home Page}}
7 changes: 2 additions & 5 deletions en/quickstart/refactoring-model.texy
@@ -1,5 +1,5 @@
Model
*****
Model <small>| First Application</small>
****************************************

As our application grows, we soon find out that we need to perform similar database operations in various locations and in various presenters, for example acquiring the newest published articles. If we improve our application by adding a flag to articles to indicate a work-in-progress state, we must also go through all locations in our application and add a where clause to make sure only finished articles are selected.

Expand Down Expand Up @@ -100,6 +100,3 @@ In the use section, we are using `App\Model\ArticleManager`. That way we can sho
We request `ArticleManager` in a constructor which we will assign to the `$articleManager` attribute and in the renderDefault method we are calling the `getPublicArticles()` method. We are also calling the `limit(5)` method on the result of that function.

The `ArticleManager` class asks for `Nette\Database\Context` in a constructor and because this class is registered in the DI container, the container creates this instance and passes it. DI this way creates an ArticleManager instance for us and passes it in a constructor to the HomepagePresenter class which asked for it. Sort of a Matryoshka doll of code. :) All the components only request what they need and they don't care where and how it gets created. The creation is handled by [Nette DI container |/dependency-injection].


{{title: Create Your First Application: Model}}
7 changes: 2 additions & 5 deletions en/quickstart/single-post.texy
@@ -1,5 +1,5 @@
Single Post Page
****************
Single Post Page <small>| First Application</small>
***************************************************

.[perex]
Let’s add another page to our blog, which will display the content of one particular blog post.
Expand Down Expand Up @@ -121,6 +121,3 @@ Summary
=======

We have a database with blog posts and a web app with two views - the first one displays the summary of all recent posts and the second one displays one specific post.


{{title: Create Your First Application: Single Post Page}}

0 comments on commit 8af573b

Please sign in to comment.