This is a simple blog based on the Nette WebProject template which aims to demonstrate various Nittro features.
The project starts as a plain and simple Nette web application and then each commit in the repository enhances the experience a little bit, explaining what is being done and why.
To install the demo locally, simply clone the repository
and start the PHP built-in webserver from the /public
directory. (While you could run the demo under Apache, there's
a lot of permission issues you could run into, so it's not
recommended.) Checkout the first commit, take a look around
to make sure you understand what's going on in the base
app, and then checkout the other commits one by one
to see what's being done. If you're using PhpStorm or
some other IDE which can show you side-by-side diffs
of the files updated in any given commit, I very much
recommend using that.
- Download a custom Nittro build
- Link Nittro in
@layout.latte
- Install the
nittro/nette-bridges
Composer package - Make
BasePresenter
extendNittro\Bridges\NittroUI\Presenter
instead ofNette\Application\UI\Presenter
- Setup default snippets in base presenter's
startup()
method
- Register the Nittro extension in
config.neon
- Update flash messages rendering in templates to make use of the
n:flash
macro in order to normalize flash behaviour and appearance - Add form error rendering macros to templates
- Add a default transition to the content snippet in
@layout.latte
- Disable transitions & history for some actions (like adding / removing a comment)
- Replace
redirect()
withpostGet()
&redrawControl()
where applicable to save roundtrips - Update site CSS to make everything beautiful
- Install the
jahudka/component-events
Composer package - Register the ComponentEvents extension in
config.neon
- Make the
CommentCount
component an event subscriber
- Replace inline
window.confirm()
calls with thedata-prompt
attribute - Update stylesheet to make buttons in Nittro dialog look like Bootstrap buttons
- Update component code: send payload instead of rendering when a comment is deleted and render only new comment when one is added
- Update template: add
n:dynamic
, specify dynamic element and create dynamic snippets out of list items; also change remove button behaviour to use client-side dynamic snippet removal - Add some animations when a comment is added or removed
- Add
_stack
initialisation code in@layout.latte
- Initialise CheckList in post editor template
- Initialise DropZone in post editor template
- Update stylesheets
- Wrap CheckList and DropZone initialisation in snippet setup callback
- Add snippet teardown callback
- Add the appropriate
n:dialog
macro attributes to links that should open in a dialog - Add the
data-action="cancel"
attribute to the cancel button of the form to improve behaviour when the form is open in a dialog - Update snippet redrawing behaviour