Permalink
Browse files

Merge branch 'master' into example

Conflicts:
	app/bootstrap.php
	app/config/addons.neon
	app/config/config.neon
	app/templates/@layout.latte
	app/templates/Homepage/default.latte
	composer.json
	readme.md
  • Loading branch information...
juzna committed Aug 1, 2012
2 parents 36c8ec3 + ca16fdf commit 0b1dd7fcae46b8583d20e0e208deab567061f281
Showing with 16 additions and 98 deletions.
  1. +3 −7 app/bootstrap.php
  2. +1 −6 app/templates/@layout.latte
  3. +0 −78 app/templates/Homepage/default.latte
  4. +2 −1 composer.json
  5. +10 −6 readme.md
View
@@ -11,9 +11,7 @@
// Configure application
-//$configurator = new Nette\Config\Configurator;
-require_once APP_DIR . '/model/Configurator.php';
-$configurator = new Configurator;
+$configurator = new Nette\Addons\Configurator;
// Enable Nette Debugger for error visualisation & logging
//$configurator->setDebugMode($configurator::AUTO);
@@ -23,17 +21,15 @@
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()
->addDirectory(APP_DIR)
-// ->addDirectory(LIBS_DIR)
->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();
// Setup router
-$container->router[] = new \Nette\Application\Routers\SimpleRouter('Homepage:default');
-//$container->router[] = new Route('index.php', 'Homepage:default', Route::ONE_WAY);
-//$container->router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
+$container->router[] = new Route('index.php', 'Homepage:default', Route::ONE_WAY);
+$container->router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
// Configure and run the application!
@@ -18,14 +18,9 @@
{control css}
{control javascript}
-{*
- <link rel="stylesheet" media="screen,projection,tv" href="{$basePath}/css/screen.css" type="text/css">
- <link rel="stylesheet" media="print" href="{$basePath}/css/print.css" type="text/css">
-*}
+
<link rel="shortcut icon" href="{$basePath}/favicon.ico" type="image/x-icon">
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
- <script type="text/javascript" src="{$basePath}/js/netteForms.js"></script>
{block head}{/block}
</head>
@@ -7,82 +7,4 @@
{control vp}
{control dp}
{control records}
-
</div>
-
-<script src="http://jush.sourceforge.net/jush.js"></script>
-<script>
- jush.create_links = false;
- jush.highlight_tag('code');
- $('code.jush').each(function(){ $(this).html($(this).html().replace(/\x7B[/$\w].*?\}/g, '<span class="jush-latte">$&</span>')) });
-
- $('a[href^=#]').click(function(){
- $('html,body').animate({ scrollTop: $($(this).attr('href')).show().offset().top - 5 }, 'fast');
- return false;
- });
-</script>
-{/block}
-
-
-{block head}
-<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-<script type="text/javascript" src="{$basePath}/js/nifty-grid/jquery-ui.js"></script>
-<script type="text/javascript" src="{$basePath}/js/nifty-grid/netteForms.js"></script>
-<script type="text/javascript" src="{$basePath}/js/nifty-grid/grid.js"></script>
-<style type="text/css">
- @import url("css/nifty-grid/grid.css");
-</style>
-
-
-<style>
-html { overflow-y: scroll; }
-body { font: 14px/1.65 Verdana, "Geneva CE", lucida, sans-serif; background: #3484d2; color: #333; margin: 38px auto; max-width: 940px; min-width: 770px; }
-
-h1, h2 { font: normal 150%/1.3 Georgia, "New York CE", utopia, serif; color: #1e5eb6; -webkit-text-stroke: 1px rgba(0,0,0,0); }
-
-img { border: none; }
-
-a { color: #006aeb; padding: 3px 1px; }
-
-a:hover, a:active, a:focus { background-color: #006aeb; text-decoration: none; color: white; }
-
-#banner { border-radius: 12px 12px 0 0; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAB5CAMAAADPursXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGBQTFRFD1CRDkqFDTlmDkF1D06NDT1tDTNZDk2KEFWaDTZgDkiCDTtpDT5wDkZ/DTBVEFacEFOWD1KUDTRcDTFWDkV9DkR7DkN4DkByDTVeDC9TDThjDTxrDkeADkuIDTRbDC9SbsUaggAAAEdJREFUeNqkwYURgAAQA7DH3d3335LSKyxAYpf9vWCpnYbf01qcOdFVXc14w4BznNTjkQfsscAdU3b4wIh9fDVYc4zV8xZgAAYaCMI6vPgLAAAAAElFTkSuQmCC); }
-#banner h1 { color: white; font-size: 50px; line-height: 121px; margin: 0; padding-left: 40px; background: url(http://files.nette.org/sandbox/logo.png) no-repeat 95%; text-shadow: 1px 1px 0 rgba(0, 0, 0, .9); }
-
-#content { background: white; border: 1px solid #eff4f7; border-radius: 0 0 12px 12px; padding: 10px 40px; }
-#content > h2 { font-size: 130%; color: #666; clear: both; padding: 1.2em 0; margin: 0; }
-
-h2 span { color: #87A7D5; }
-h2 a { text-decoration: none; background: transparent; }
-
-.box { width: 24%; float: left; background: #f0f0f0; margin-right: 4%; min-height: 230px; padding: 3%; border: 1px solid #e6e6e6; border-radius: 5px; }
-.box h2 { text-align: right; margin: 0; }
-.box img { float: left; }
-.box p { clear: both; }
-.box:nth-child(4n - 2) h2 { color: #00a6e5; }
-.box:nth-child(4n - 2) img { margin: -24px 0 0 -24px; }
-.box:nth-child(4n - 1) h2 a { color: #db8e34; background: transparent; }
-.box:nth-child(4n) { margin: 0; }
-.box:nth-child(4n) h2 a { color: #578404; background: transparent; }
-
-body.js section { display: none; }
-
-pre { font-size: 12px; line-height: 1.4; padding: 10px; margin: 1.3em 0; overflow: auto; max-height: 500px; background: #F1F5FB; border-radius: 5px; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); }
-
-footer { font-size: 70%; padding: 1em 0; color: gray; }
-
-.jush-com, .jush-php_doc { color: #929292; }
-.jush-tag, .jush-tag_js { color: #6A8527; font-weight: bold; }
-.jush-att { color: #8CA315 }
-.jush-att_quo { color: #448CCB; font-weight: bold; }
-.jush-php_var { color: #d59401; font-weight: bold; }
-.jush-php_apo { color: green; }
-.jush-php_new { font-weight: bold; }
-.jush-php_fun { color: #254DB3; }
-.jush-js, .jush-css { color: #333333; }
-.jush-css_val { color: #448CCB; }
-.jush-clr { color: #007800; }
-.jush a { color: inherit; background: transparent; }
-.jush-latte { color: #D59401; font-weight: bold }
-</style>
-{/block}
View
@@ -23,7 +23,8 @@
},
"require": {
"php": ">= 5.3.0",
- "nette/nette": "2.0.*",
+ "nette/nette": ">= 2.0.4",
+ "nette/addon-installer": "@dev",
"JanMarek/WebLoader": "dev-juznovo",
"juzna/nette-visual-paginator": "@dev",
"nifty/nifty-grid": "dev-juznovo",
View
@@ -5,14 +5,18 @@ Please join the [discussion](http://forum.nette.org/cs/10875-nette-addons-konven
## Overview
-Supported Nette Addons are configured to `type=nette-addon` in `composer.json` file and Nette related info in section `extra`.
-Here is an [example](https://github.com/juzna/kdyby-CurlExtension/blob/juznovo/composer.json) of such addon.
+This is a sandbox/skeleton, from which you can start your projects with Nette Addons. It has the basic code needed to run them.
+We try to simplyfy addon instalation by automatig as many steps as possible. Previously, you would have to download the addon, extract it to correct place,
+ copy assets to www directory and register the addon in several places of your app. Now, with Composer's help, all those steps will be automated for you.
+ All you need is just to write down the *addon name* into `composer.json`, section *require* (like all other dependencies).
-If you want to install an supported Addon, just put it as a requirement to your project's `composer.json`.
## How it works?
+Supported Nette Addons are configured to `type=nette-addon` in `composer.json` file and Nette related info in section `extra`.
+Here is an [example](https://github.com/juzna/kdyby-CurlExtension/blob/juznovo/composer.json) of such addon.
+
Custom installer copies the addon section from composer.json to `app/config/addons.neon` file which is then processed by the app.
For more details, see [nette/addon-installer](https://github.com/juzna/nette-addon-installer) which does half of the hard work.
@@ -23,10 +27,10 @@ For more details, see [nette/addon-installer](https://github.com/juzna/nette-add
Clone and run this project:
```
-git clone git://github.com/juzna/nette-addons-sandbox.git sandbox master
+git clone git://github.com/juzna/nette-addons-sandbox.git sandbox
cd sandbox/
chmod 0777 temp log
-mkdir -m 0777 www/temp
+mkdir -m0777 www/temp
composer install
```
@@ -38,7 +42,7 @@ Now the sandbox should work, try it in your browser. To add an Addon, edit `comp
"php": ">= 5.3.0",
"nette/nette": "2.0.*",
"JanMarek/WebLoader": "dev-juznovo",
- "juzna/nette-visual-paginator": "@dev",
+ "juzna/nette-visual-paginator": "@dev"
},
...
}

0 comments on commit 0b1dd7f

Please sign in to comment.