├── .gitattributes ├── .gitignore ├── app ├── commands │ ├── .gitkeep │ ├── AppInstallCommand.php │ ├── AppRefreshCommand.php │ └── AppSeedCommand.php ├── config │ ├── app.php │ ├── auth.php │ ├── cache.php │ ├── compile.php │ ├── database.php │ ├── mail.php │ ├── packages │ │ └── .gitkeep │ ├── queue.php │ ├── session.php │ ├── testing │ │ ├── cache.php │ │ └── session.php │ ├── view.php │ └── workbench.php ├── controllers │ ├── .gitkeep │ ├── BaseController.php │ └── admin │ │ ├── ArticlesController.php │ │ ├── AuthController.php │ │ └── PagesController.php ├── database │ ├── migrations │ │ ├── .gitkeep │ │ ├── 2013_04_10_120429_create_articles_table.php │ │ └── 2013_04_10_120446_create_pages_table.php │ ├── production.sqlite │ └── seeds │ │ ├── .gitkeep │ │ ├── ContentSeeder.php │ │ ├── DatabaseSeeder.php │ │ └── SentrySeeder.php ├── facades │ └── ImageFacade.php ├── filters.php ├── lang │ └── en │ │ ├── pagination.php │ │ ├── reminders.php │ │ └── validation.php ├── models │ ├── Article.php │ ├── Page.php │ └── User.php ├── routes.php ├── services │ ├── Image.php │ └── validators │ │ ├── ArticleValidator.php │ │ ├── PageValidator.php │ │ └── Validator.php ├── start │ ├── artisan.php │ ├── global.php │ └── local.php ├── storage │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── logs │ │ └── .gitignore │ ├── meta │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── tests │ ├── ExampleTest.php │ └── TestCase.php └── views │ ├── admin │ ├── _layouts │ │ └── default.blade.php │ ├── _partials │ │ ├── assets.blade.php │ │ ├── header.blade.php │ │ ├── navigation.blade.php │ │ └── notifications.blade.php │ ├── articles │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── auth │ │ └── login.blade.php │ └── pages │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── emails │ └── auth │ │ └── reminder.blade.php │ └── hello.blade.php ├── artisan ├── bootstrap ├── autoload.php ├── paths.php └── start.php ├── composer.json ├── public ├── .htaccess ├── assets │ ├── css │ │ ├── bootstrap-responsive.min.css │ │ ├── bootstrap.min.css │ │ └── main.css │ └── js │ │ ├── bootstrap.min.js │ │ └── script.js ├── favicon.ico ├── index.php ├── packages │ └── .gitkeep ├── robots.txt └── site │ ├── SiteServiceProvider.php │ ├── assets │ ├── css │ │ ├── main.css │ │ └── reset.css │ ├── img │ │ ├── bg.png │ │ └── l.gif │ └── js │ │ └── script.js │ ├── routes.php │ └── views │ ├── 404.blade.php │ ├── _partials │ ├── footer.blade.php │ ├── header.blade.php │ └── navigation.blade.php │ ├── article.blade.php │ ├── articles.blade.php │ ├── index.blade.php │ └── page.blade.php ├── readme.md └── server.php /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bootstrap/compiled.php 2 | /vendor 3 | /public/uploads 4 | composer.phar 5 | composer.lock 6 | .DS_Store 7 | _article 8 | -------------------------------------------------------------------------------- /app/commands/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bstrahija/l4-site-tutorial/15f34895815acf6a15d4a23009840327574c6ad3/app/commands/.gitkeep -------------------------------------------------------------------------------- /app/commands/AppInstallCommand.php: -------------------------------------------------------------------------------- 1 | call('migrate', array('--package' => 'cartalyst/sentry')); 44 | 45 | // App migraions 46 | $this->call('migrate'); 47 | 48 | // And seed it 49 | $this->call('app:seed'); 50 | 51 | echo 'Done.'.PHP_EOL; 52 | } 53 | 54 | /** 55 | * Get the console command arguments. 56 | * 57 | * @return array 58 | */ 59 | protected function getArguments() 60 | { 61 | return array(); 62 | } 63 | 64 | /** 65 | * Get the console command options. 66 | * 67 | * @return array 68 | */ 69 | protected function getOptions() 70 | { 71 | return array(); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /app/commands/AppRefreshCommand.php: -------------------------------------------------------------------------------- 1 | confirm('Are you sure you want to refresh your installation? You will loose all data stored in the database! [yes|no]')) 41 | { 42 | // First reset data 43 | echo 'Reseting DB...'.PHP_EOL; 44 | $this->call('migrate:reset'); 45 | echo 'Done.'.PHP_EOL.PHP_EOL; 46 | 47 | // Now install it again 48 | $this->call('app:install'); 49 | } 50 | } 51 | 52 | /** 53 | * Get the console command arguments. 54 | * 55 | * @return array 56 | */ 57 | protected function getArguments() 58 | { 59 | return array(); 60 | } 61 | 62 | /** 63 | * Get the console command options. 64 | * 65 | * @return array 66 | */ 67 | protected function getOptions() 68 | { 69 | return array(); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /app/commands/AppSeedCommand.php: -------------------------------------------------------------------------------- 1 | call('db:seed'); 43 | echo 'Done.'.PHP_EOL.PHP_EOL; 44 | } 45 | 46 | /** 47 | * Get the console command arguments. 48 | * 49 | * @return array 50 | */ 51 | protected function getArguments() 52 | { 53 | return array(); 54 | } 55 | 56 | /** 57 | * Get the console command options. 58 | * 59 | * @return array 60 | */ 61 | protected function getOptions() 62 | { 63 | return array(); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /app/config/app.php: -------------------------------------------------------------------------------- 1 | true, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application URL 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This URL is used by the console to properly generate URLs when using 24 | | the Artisan command line tool. You should set this to the root of 25 | | your application so that it is used when running Artisan tasks. 26 | | 27 | */ 28 | 29 | 'url' => '', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Timezone 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may specify the default timezone for your application, which 37 | | will be used by the PHP date and date-time functions. We have gone 38 | | ahead and set this to a sensible default for you out of the box. 39 | | 40 | */ 41 | 42 | 'timezone' => 'UTC', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application Locale Configuration 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The application locale determines the default locale that will be used 50 | | by the translation service provider. You are free to set this value 51 | | to any of the locales which will be supported by the application. 52 | | 53 | */ 54 | 55 | 'locale' => 'en', 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Encryption Key 60 | |-------------------------------------------------------------------------- 61 | | 62 | | This key is used by the Illuminate encrypter service and should be set 63 | | to a random, long string, otherwise these encrypted values will not 64 | | be safe. Make sure to change it before deploying any application! 65 | | 66 | */ 67 | 68 | 'key' => 'haxe0ghe5qua5fa4hyth9ri0fofu7biv', 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Autoloaded Service Providers 73 | |-------------------------------------------------------------------------- 74 | | 75 | | The service providers listed here will be automatically loaded on the 76 | | request to your application. Feel free to add your own services to 77 | | this array to grant expanded functionality to your applications. 78 | | 79 | */ 80 | 81 | 'providers' => array( 82 | 83 | 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 84 | 'Illuminate\Auth\AuthServiceProvider', 85 | 'Illuminate\Cache\CacheServiceProvider', 86 | 'Illuminate\Foundation\Providers\CommandCreatorServiceProvider', 87 | 'Illuminate\Session\CommandsServiceProvider', 88 | 'Illuminate\Foundation\Providers\ComposerServiceProvider', 89 | 'Illuminate\Routing\ControllerServiceProvider', 90 | 'Illuminate\Cookie\CookieServiceProvider', 91 | 'Illuminate\Database\DatabaseServiceProvider', 92 | 'Illuminate\Encryption\EncryptionServiceProvider', 93 | 'Illuminate\Filesystem\FilesystemServiceProvider', 94 | 'Illuminate\Hashing\HashServiceProvider', 95 | 'Illuminate\Html\HtmlServiceProvider', 96 | 'Illuminate\Foundation\Providers\KeyGeneratorServiceProvider', 97 | 'Illuminate\Log\LogServiceProvider', 98 | 'Illuminate\Mail\MailServiceProvider', 99 | 'Illuminate\Foundation\Providers\MaintenanceServiceProvider', 100 | 'Illuminate\Database\MigrationServiceProvider', 101 | 'Illuminate\Foundation\Providers\OptimizeServiceProvider', 102 | 'Illuminate\Pagination\PaginationServiceProvider', 103 | 'Illuminate\Foundation\Providers\PublisherServiceProvider', 104 | 'Illuminate\Queue\QueueServiceProvider', 105 | 'Illuminate\Redis\RedisServiceProvider', 106 | 'Illuminate\Auth\Reminders\ReminderServiceProvider', 107 | 'Illuminate\Foundation\Providers\RouteListServiceProvider', 108 | 'Illuminate\Database\SeedServiceProvider', 109 | 'Illuminate\Foundation\Providers\ServerServiceProvider', 110 | 'Illuminate\Session\SessionServiceProvider', 111 | 'Illuminate\Foundation\Providers\TinkerServiceProvider', 112 | 'Illuminate\Translation\TranslationServiceProvider', 113 | 'Illuminate\Validation\ValidationServiceProvider', 114 | 'Illuminate\View\ViewServiceProvider', 115 | 'Illuminate\Workbench\WorkbenchServiceProvider', 116 | 'Cartalyst\Sentry\SentryServiceProvider', 117 | 'Krucas\Notification\NotificationServiceProvider', 118 | 'App\Site\SiteServiceProvider', 119 | 120 | ), 121 | 122 | /* 123 | |-------------------------------------------------------------------------- 124 | | Service Provider Manifest 125 | |-------------------------------------------------------------------------- 126 | | 127 | | The service provider manifest is used by Laravel to lazy load service 128 | | providers which are not needed for each request, as well to keep a 129 | | list of all of the services. Here, you may set its storage spot. 130 | | 131 | */ 132 | 133 | 'manifest' => storage_path().'/meta', 134 | 135 | /* 136 | |-------------------------------------------------------------------------- 137 | | Class Aliases 138 | |-------------------------------------------------------------------------- 139 | | 140 | | This array of class aliases will be registered when this application 141 | | is started. However, feel free to register as many as you wish as 142 | | the aliases are "lazy" loaded so they don't hinder performance. 143 | | 144 | */ 145 | 146 | 'aliases' => array( 147 | 148 | 'App' => 'Illuminate\Support\Facades\App', 149 | 'Artisan' => 'Illuminate\Support\Facades\Artisan', 150 | 'Auth' => 'Illuminate\Support\Facades\Auth', 151 | 'Blade' => 'Illuminate\Support\Facades\Blade', 152 | 'Cache' => 'Illuminate\Support\Facades\Cache', 153 | 'ClassLoader' => 'Illuminate\Support\ClassLoader', 154 | 'Config' => 'Illuminate\Support\Facades\Config', 155 | 'Controller' => 'Illuminate\Routing\Controllers\Controller', 156 | 'Cookie' => 'Illuminate\Support\Facades\Cookie', 157 | 'Crypt' => 'Illuminate\Support\Facades\Crypt', 158 | 'DB' => 'Illuminate\Support\Facades\DB', 159 | 'Eloquent' => 'Illuminate\Database\Eloquent\Model', 160 | 'Event' => 'Illuminate\Support\Facades\Event', 161 | 'File' => 'Illuminate\Support\Facades\File', 162 | 'Form' => 'Illuminate\Support\Facades\Form', 163 | 'Hash' => 'Illuminate\Support\Facades\Hash', 164 | 'HTML' => 'Illuminate\Support\Facades\HTML', 165 | 'Input' => 'Illuminate\Support\Facades\Input', 166 | 'Lang' => 'Illuminate\Support\Facades\Lang', 167 | 'Log' => 'Illuminate\Support\Facades\Log', 168 | 'Mail' => 'Illuminate\Support\Facades\Mail', 169 | 'Paginator' => 'Illuminate\Support\Facades\Paginator', 170 | 'Password' => 'Illuminate\Support\Facades\Password', 171 | 'Queue' => 'Illuminate\Support\Facades\Queue', 172 | 'Redirect' => 'Illuminate\Support\Facades\Redirect', 173 | 'Redis' => 'Illuminate\Support\Facades\Redis', 174 | 'Request' => 'Illuminate\Support\Facades\Request', 175 | 'Response' => 'Illuminate\Support\Facades\Response', 176 | 'Route' => 'Illuminate\Support\Facades\Route', 177 | 'Schema' => 'Illuminate\Support\Facades\Schema', 178 | 'Seeder' => 'Illuminate\Database\Seeder', 179 | 'Session' => 'Illuminate\Support\Facades\Session', 180 | 'Str' => 'Illuminate\Support\Str', 181 | 'URL' => 'Illuminate\Support\Facades\URL', 182 | 'Validator' => 'Illuminate\Support\Facades\Validator', 183 | 'View' => 'Illuminate\Support\Facades\View', 184 | 'Sentry' => 'Cartalyst\Sentry\Facades\Laravel\Sentry', 185 | 'Notification' => 'Krucas\Notification\Facades\Notification', 186 | 'Article' => 'App\Models\Article', 187 | 'Page' => 'App\Models\Page', 188 | 'Image' => 'App\Facades\ImageFacade', 189 | ), 190 | 191 | ); 192 | -------------------------------------------------------------------------------- /app/config/auth.php: -------------------------------------------------------------------------------- 1 | 'eloquent', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Model 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "Eloquent" authentication driver, we need to know which 26 | | Eloquent model should be used to retrieve your users. Of course, it 27 | | is often just the "User" model but you may use whatever you like. 28 | | 29 | */ 30 | 31 | 'model' => 'User', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Authentication Table 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "Database" authentication driver, we need to know which 39 | | table should be used to retrieve your users. We have chosen a basic 40 | | default value but you may easily change it to any table you like. 41 | | 42 | */ 43 | 44 | 'table' => 'users', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reminder Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the settings for password reminders, including a view 52 | | that should be used as your password reminder e-mail. You will also 53 | | be able to set the name of the table that holds the reset tokens. 54 | | 55 | */ 56 | 57 | 'reminder' => array( 58 | 59 | 'email' => 'emails.auth.reminder', 'table' => 'password_reminders', 60 | 61 | ), 62 | 63 | ); -------------------------------------------------------------------------------- /app/config/cache.php: -------------------------------------------------------------------------------- 1 | 'file', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | File Cache Location 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "file" cache driver, we need a location where the cache 26 | | files may be stored. A sensible default has been specified, but you 27 | | are free to change it to any other place on disk that you desire. 28 | | 29 | */ 30 | 31 | 'path' => storage_path().'/cache', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Database Cache Connection 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "database" cache driver you may specify the connection 39 | | that should be used to store the cached items. When this option is 40 | | null the default database connection will be utilized for cache. 41 | | 42 | */ 43 | 44 | 'connection' => null, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Database Cache Table 49 | |-------------------------------------------------------------------------- 50 | | 51 | | When using the "database" cache driver we need to know the table that 52 | | should be used to store the cached items. A default table name has 53 | | been provided but you're free to change it however you deem fit. 54 | | 55 | */ 56 | 57 | 'table' => 'cache', 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Memcached Servers 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Now you may specify an array of your Memcached servers that should be 65 | | used when utilizing the Memcached cache driver. All of the servers 66 | | should contain a value for "host", "port", and "weight" options. 67 | | 68 | */ 69 | 70 | 'memcached' => array( 71 | 72 | array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), 73 | 74 | ), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Cache Key Prefix 79 | |-------------------------------------------------------------------------- 80 | | 81 | | When utilizing a RAM based store such as APC or Memcached, there might 82 | | be other applications utilizing the same cache. So, we'll specify a 83 | | value to get prefixed to all our keys so we can avoid collisions. 84 | | 85 | */ 86 | 87 | 'prefix' => 'laravel', 88 | 89 | ); 90 | -------------------------------------------------------------------------------- /app/config/compile.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_CLASS, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Database Connection Name 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may specify which of the database connections below you wish 24 | | to use as your default connection for all database work. Of course 25 | | you may use many connections at once using the Database library. 26 | | 27 | */ 28 | 29 | 'default' => 'mysql', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Database Connections 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here are each of the database connections setup for your application. 37 | | Of course, examples of configuring each database platform that is 38 | | supported by Laravel is shown below to make development simple. 39 | | 40 | | 41 | | All database work in Laravel is done through the PHP PDO facilities 42 | | so make sure you have the driver for your particular database of 43 | | choice installed on your machine before you begin development. 44 | | 45 | */ 46 | 47 | 'connections' => array( 48 | 49 | 'sqlite' => array( 50 | 'driver' => 'sqlite', 51 | 'database' => __DIR__.'/../database/production.sqlite', 52 | 'prefix' => '', 53 | ), 54 | 55 | 'mysql' => array( 56 | 'driver' => 'mysql', 57 | 'host' => 'localhost', 58 | 'database' => 'l4_site', 59 | 'username' => 'root', 60 | 'password' => 'root', 61 | 'charset' => 'utf8', 62 | 'collation' => 'utf8_unicode_ci', 63 | 'prefix' => '', 64 | ), 65 | 66 | 'pgsql' => array( 67 | 'driver' => 'pgsql', 68 | 'host' => 'localhost', 69 | 'database' => 'database', 70 | 'username' => 'root', 71 | 'password' => '', 72 | 'charset' => 'utf8', 73 | 'prefix' => '', 74 | 'schema' => 'public', 75 | ), 76 | 77 | 'sqlsrv' => array( 78 | 'driver' => 'sqlsrv', 79 | 'host' => 'localhost', 80 | 'database' => 'database', 81 | 'username' => 'root', 82 | 'password' => '', 83 | 'prefix' => '', 84 | ), 85 | 86 | ), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Migration Repository Table 91 | |-------------------------------------------------------------------------- 92 | | 93 | | This table keeps track of all the migrations that have already run for 94 | | your application. Using this information, we can determine which of 95 | | the migrations on disk have not actually be run in the databases. 96 | | 97 | */ 98 | 99 | 'migrations' => 'migrations', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Redis Databases 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Redis is an open source, fast, and advanced key-value store that also 107 | | provides a richer set of commands than a typical key-value systems 108 | | such as APC or Memcached. Laravel makes it easy to dig right in. 109 | | 110 | */ 111 | 112 | 'redis' => array( 113 | 114 | 'cluster' => true, 115 | 116 | 'default' => array( 117 | 'host' => '127.0.0.1', 118 | 'port' => 6379, 119 | 'database' => 0, 120 | ), 121 | 122 | ), 123 | 124 | ); 125 | -------------------------------------------------------------------------------- /app/config/mail.php: -------------------------------------------------------------------------------- 1 | 'smtp', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | SMTP Host Address 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may provide the host address of the SMTP server used by your 26 | | applications. A default option is provided that is compatible with 27 | | the Postmark mail service, which will provide reliable delivery. 28 | | 29 | */ 30 | 31 | 'host' => 'smtp.mailgun.org', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to delivery e-mails to 39 | | users of your application. Like the host we have set this value to 40 | | stay compatible with the Postmark e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => 587, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => array('address' => null, 'name' => null), 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | E-Mail Encryption Protocol 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the encryption protocol that should be used when 65 | | the application send e-mail messages. A sensible default using the 66 | | transport layer security protocol should provide great security. 67 | | 68 | */ 69 | 70 | 'encryption' => 'tls', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | SMTP Server Username 75 | |-------------------------------------------------------------------------- 76 | | 77 | | If your SMTP server requires a username for authentication, you should 78 | | set it here. This will get used to authenticate with your server on 79 | | connection. You may also set the "password" value below this one. 80 | | 81 | */ 82 | 83 | 'username' => null, 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | SMTP Server Password 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may set the password required by your SMTP server to send out 91 | | messages from your application. This will be given to the server on 92 | | connection so that the application will be able to send messages. 93 | | 94 | */ 95 | 96 | 'password' => null, 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Sendmail System Path 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When using the "sendmail" driver to send e-mails, we will need to know 104 | | the path to where Sendmail lives on this server. A default path has 105 | | been provided here, which will work well on most of your systems. 106 | | 107 | */ 108 | 109 | 'sendmail' => '/usr/sbin/sendmail -bs', 110 | 111 | ); 112 | -------------------------------------------------------------------------------- /app/config/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bstrahija/l4-site-tutorial/15f34895815acf6a15d4a23009840327574c6ad3/app/config/packages/.gitkeep -------------------------------------------------------------------------------- /app/config/queue.php: -------------------------------------------------------------------------------- 1 | 'sync', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => array( 32 | 33 | 'sync' => array( 34 | 'driver' => 'sync', 35 | ), 36 | 37 | 'beanstalkd' => array( 38 | 'driver' => 'beanstalkd', 39 | 'host' => 'localhost', 40 | 'queue' => 'default', 41 | ), 42 | 43 | 'sqs' => array( 44 | 'driver' => 'sqs', 45 | 'key' => 'your-public-key', 46 | 'secret' => 'your-secret-key', 47 | 'queue' => 'your-queue-url', 48 | 'region' => 'us-east-1', 49 | ), 50 | 51 | 'iron' => array( 52 | 'driver' => 'iron', 53 | 'project' => 'your-project-id', 54 | 'token' => 'your-token', 55 | 'queue' => 'your-queue-name', 56 | ), 57 | 58 | ), 59 | 60 | ); 61 | -------------------------------------------------------------------------------- /app/config/session.php: -------------------------------------------------------------------------------- 1 | 'native', 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle for it is expired. If you want them 28 | | to immediately expire when the browser closes, set it to zero. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Session File Location 37 | |-------------------------------------------------------------------------- 38 | | 39 | | When using the native session driver, we need a location where session 40 | | files may be stored. A default has been set for you but a different 41 | | location may be specified. This is only needed for file sessions. 42 | | 43 | */ 44 | 45 | 'files' => storage_path().'/sessions', 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Session Database Connection 50 | |-------------------------------------------------------------------------- 51 | | 52 | | When using the "database" session driver, you may specify the database 53 | | connection that should be used to manage your sessions. This should 54 | | correspond to a connection in your "database" configuration file. 55 | | 56 | */ 57 | 58 | 'connection' => null, 59 | 60 | /* 61 | |-------------------------------------------------------------------------- 62 | | Session Database Table 63 | |-------------------------------------------------------------------------- 64 | | 65 | | When using the "database" session driver, you may specify the table we 66 | | should use to manage the sessions. Of course, a sensible default is 67 | | provided for you; however, you are free to change this as needed. 68 | | 69 | */ 70 | 71 | 'table' => 'sessions', 72 | 73 | /* 74 | |-------------------------------------------------------------------------- 75 | | Session Sweeping Lottery 76 | |-------------------------------------------------------------------------- 77 | | 78 | | Some session drivers must manually sweep their storage location to get 79 | | rid of old sessions from storage. Here are the chances that it will 80 | | happen on a given request. By default, the odds are 2 out of 100. 81 | | 82 | */ 83 | 84 | 'lottery' => array(2, 100), 85 | 86 | /* 87 | |-------------------------------------------------------------------------- 88 | | Session Cookie Name 89 | |-------------------------------------------------------------------------- 90 | | 91 | | Here you may change the name of the cookie used to identify a session 92 | | instance by ID. The name specified here will get used every time a 93 | | new session cookie is created by the framework for every driver. 94 | | 95 | */ 96 | 97 | 'cookie' => 'laravel_session', 98 | 99 | /* 100 | |-------------------------------------------------------------------------- 101 | | Session Cookie Path 102 | |-------------------------------------------------------------------------- 103 | | 104 | | The session cookie path determines the path for which the cookie will 105 | | be regarded as available. Typically, this will be the root path of 106 | | your application but you are free to change this when necessary. 107 | | 108 | */ 109 | 110 | 'path' => '/', 111 | 112 | /* 113 | |-------------------------------------------------------------------------- 114 | | Session Cookie Domain 115 | |-------------------------------------------------------------------------- 116 | | 117 | | Here you may change the domain of the cookie used to identify a session 118 | | in your application. This will determine which domains the cookie is 119 | | available to in your application. A sensible default has been set. 120 | | 121 | */ 122 | 123 | 'domain' => null, 124 | 125 | ); 126 | -------------------------------------------------------------------------------- /app/config/testing/cache.php: -------------------------------------------------------------------------------- 1 | 'array', 19 | 20 | ); -------------------------------------------------------------------------------- /app/config/testing/session.php: -------------------------------------------------------------------------------- 1 | 'array', 20 | 21 | ); -------------------------------------------------------------------------------- /app/config/view.php: -------------------------------------------------------------------------------- 1 | array(__DIR__.'/../views'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Pagination View 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This view will be used to render the pagination link output, and can 24 | | be easily customized here to show any view you like. A clean view 25 | | compatible with Twitter's Bootstrap is given to you by default. 26 | | 27 | */ 28 | 29 | 'pagination' => 'pagination::slider', 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/config/workbench.php: -------------------------------------------------------------------------------- 1 | '', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Workbench Author E-Mail Address 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Like the option above, your e-mail address is used when generating new 24 | | workbench packages. The e-mail is placed in your composer.json file 25 | | automatically after the package is created by the workbench tool. 26 | | 27 | */ 28 | 29 | 'email' => '', 30 | 31 | ); -------------------------------------------------------------------------------- /app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bstrahija/l4-site-tutorial/15f34895815acf6a15d4a23009840327574c6ad3/app/controllers/.gitkeep -------------------------------------------------------------------------------- /app/controllers/BaseController.php: -------------------------------------------------------------------------------- 1 | layout)) 13 | { 14 | $this->layout = View::make($this->layout); 15 | } 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /app/controllers/admin/ArticlesController.php: -------------------------------------------------------------------------------- 1 | with('articles', Article::all()); 12 | } 13 | 14 | public function show($id) 15 | { 16 | return \View::make('admin.articles.show')->with('article',Article::find($id)); 17 | } 18 | 19 | public function create() 20 | { 21 | return \View::make('admin.articles.create'); 22 | } 23 | 24 | public function store() 25 | { 26 | $validation = new ArticleValidator; 27 | 28 | if ($validation->passes()) 29 | { 30 | $article = new Article; 31 | $article->title = Input::get('title'); 32 | $article->slug = Str::slug(Input::get('title')); 33 | $article->body = Input::get('body'); 34 | $article->user_id = Sentry::getUser()->id; 35 | $article->save(); 36 | 37 | // Now that we have the article ID we need to move the image 38 | if (Input::hasFile('image')) 39 | { 40 | $article->image = Image::upload(Input::file('image'), 'articles/' . $article->id); 41 | $article->save(); 42 | } 43 | 44 | Notification::success('The article was saved.'); 45 | 46 | return Redirect::route('admin.articles.edit', $article->id); 47 | } 48 | 49 | return Redirect::back()->withInput()->withErrors($validation->errors); 50 | } 51 | 52 | public function edit($id) 53 | { 54 | return \View::make('admin.articles.edit')->with('article', Article::find($id)); 55 | } 56 | 57 | public function update($id) 58 | { 59 | $validation = new ArticleValidator; 60 | 61 | if ($validation->passes()) 62 | { 63 | $article = Article::find($id); 64 | $article->title = Input::get('title'); 65 | $article->slug = Str::slug(Input::get('title')); 66 | $article->body = Input::get('body'); 67 | $article->user_id = Sentry::getUser()->id; 68 | if (Input::hasFile('image')) $article->image = Image::upload(Input::file('image'), 'articles/' . $article->id); 69 | $article->save(); 70 | 71 | Notification::success('The article was saved.'); 72 | 73 | return Redirect::route('admin.articles.edit', $article->id); 74 | } 75 | 76 | return Redirect::back()->withInput()->withErrors($validation->errors); 77 | } 78 | 79 | public function destroy($id) 80 | { 81 | $article = Article::find($id); 82 | $article->delete(); 83 | 84 | Notification::success('The article was deleted.'); 85 | 86 | return Redirect::route('admin.articles.index'); 87 | } 88 | 89 | } 90 | 91 | -------------------------------------------------------------------------------- /app/controllers/admin/AuthController.php: -------------------------------------------------------------------------------- 1 | Input::get('email'), 24 | 'password' => Input::get('password') 25 | ); 26 | 27 | try 28 | { 29 | $user = Sentry::authenticate($credentials, false); 30 | 31 | if ($user) 32 | { 33 | return Redirect::route('admin.pages.index'); 34 | } 35 | } 36 | catch(\Exception $e) 37 | { 38 | return Redirect::route('admin.login')->withErrors(array('login' => $e->getMessage())); 39 | } 40 | } 41 | 42 | /** 43 | * Logout action 44 | * @return Redirect 45 | */ 46 | public function getLogout() 47 | { 48 | Sentry::logout(); 49 | 50 | return Redirect::route('admin.login'); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /app/controllers/admin/PagesController.php: -------------------------------------------------------------------------------- 1 | with('pages', Page::all()); 12 | } 13 | 14 | public function show($id) 15 | { 16 | return \View::make('admin.pages.show')->with('page', Page::find($id)); 17 | } 18 | 19 | public function create() 20 | { 21 | return \View::make('admin.pages.create'); 22 | } 23 | 24 | public function store() 25 | { 26 | $validation = new PageValidator; 27 | 28 | if ($validation->passes()) 29 | { 30 | $page = new Page; 31 | $page->title = Input::get('title'); 32 | $page->slug = Str::slug(Input::get('title')); 33 | $page->body = Input::get('body'); 34 | $page->user_id = Sentry::getUser()->id; 35 | $page->save(); 36 | 37 | Notification::success('The page was saved.'); 38 | 39 | return Redirect::route('admin.pages.edit', $page->id); 40 | } 41 | 42 | return Redirect::back()->withInput()->withErrors($validation->errors); 43 | } 44 | 45 | public function edit($id) 46 | { 47 | return \View::make('admin.pages.edit')->with('page', Page::find($id)); 48 | } 49 | 50 | public function update($id) 51 | { 52 | $validation = new PageValidator; 53 | 54 | if ($validation->passes()) 55 | { 56 | $page = Page::find($id); 57 | $page->title = Input::get('title'); 58 | $page->slug = Str::slug(Input::get('title')); 59 | $page->body = Input::get('body'); 60 | $page->user_id = Sentry::getUser()->id; 61 | $page->save(); 62 | 63 | Notification::success('The page was saved.'); 64 | 65 | return Redirect::route('admin.pages.edit', $page->id); 66 | } 67 | 68 | return Redirect::back()->withInput()->withErrors($validation->errors); 69 | } 70 | 71 | public function destroy($id) 72 | { 73 | $page = Page::find($id); 74 | //$page->delete(); 75 | 76 | Notification::success('The page was deleted.'); 77 | 78 | return Redirect::route('admin.pages.index'); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /app/database/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bstrahija/l4-site-tutorial/15f34895815acf6a15d4a23009840327574c6ad3/app/database/migrations/.gitkeep -------------------------------------------------------------------------------- /app/database/migrations/2013_04_10_120429_create_articles_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | $table->string('title'); 14 | $table->string('slug'); 15 | $table->text('body')->nullable(); 16 | $table->string('image')->nullable(); 17 | $table->integer('user_id'); 18 | $table->timestamps(); 19 | }); 20 | } 21 | 22 | public function down() 23 | { 24 | Schema::drop('articles'); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/database/migrations/2013_04_10_120446_create_pages_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | $table->string('title'); 14 | $table->string('slug'); 15 | $table->text('body')->nullable(); 16 | $table->integer('user_id'); 17 | $table->timestamps(); 18 | }); 19 | } 20 | 21 | public function down() 22 | { 23 | Schema::drop('pages'); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /app/database/production.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bstrahija/l4-site-tutorial/15f34895815acf6a15d4a23009840327574c6ad3/app/database/production.sqlite -------------------------------------------------------------------------------- /app/database/seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bstrahija/l4-site-tutorial/15f34895815acf6a15d4a23009840327574c6ad3/app/database/seeds/.gitkeep -------------------------------------------------------------------------------- /app/database/seeds/ContentSeeder.php: -------------------------------------------------------------------------------- 1 | truncate(); // Using truncate function so all info will be cleared when re-seeding. 11 | DB::table('pages')->truncate(); 12 | 13 | Article::create(array( 14 | 'title' => 'First post', 15 | 'slug' => 'first-post', 16 | 'body' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 17 | 'user_id' => 1, 18 | 'created_at' => Carbon\Carbon::now()->subWeek(), 19 | 'updated_at' => Carbon\Carbon::now()->subWeek(), 20 | )); 21 | Article::create(array( 22 | 'title' => '2nd post', 23 | 'slug' => '2nd-post', 24 | 'body' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 25 | 'user_id' => 1, 26 | 'created_at' => Carbon\Carbon::now()->subDay(), 27 | 'updated_at' => Carbon\Carbon::now()->subDay(), 28 | )); 29 | Article::create(array( 30 | 'title' => 'Third post', 31 | 'slug' => 'third-post', 32 | 'body' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 33 | 'user_id' => 1, 34 | )); 35 | 36 | Page::create(array( 37 | 'title' => 'Welcome', 38 | 'slug' => 'welcome', 39 | 'body' => 'Welcome to the site', 40 | 'user_id' => 1, 41 | )); 42 | Page::create(array( 43 | 'title' => 'About us', 44 | 'slug' => 'about-us', 45 | 'body' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 46 | 'user_id' => 1, 47 | )); 48 | Page::create(array( 49 | 'title' => 'Contact', 50 | 'slug' => 'contact', 51 | 'body' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 52 | 'user_id' => 1, 53 | )); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /app/database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call('SentrySeeder'); 10 | $this->command->info('Sentry tables seeded!'); 11 | 12 | $this->call('ContentSeeder'); 13 | $this->command->info('Content tables seeded!'); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /app/database/seeds/SentrySeeder.php: -------------------------------------------------------------------------------- 1 | truncate(); // Using truncate function so all info will be cleared when re-seeding. 10 | DB::table('groups')->truncate(); 11 | DB::table('users_groups')->truncate(); 12 | 13 | Sentry::getUserProvider()->create(array( 14 | 'email' => 'admin@admin.com', 15 | 'password' => "admin", 16 | 'first_name' => 'John', 17 | 'last_name' => 'McClane', 18 | 'activated' => 1, 19 | )); 20 | 21 | Sentry::getGroupProvider()->create(array( 22 | 'name' => 'Admin', 23 | 'permissions' => array('admin' => 1), 24 | )); 25 | 26 | // Assign user permissions 27 | $adminUser = Sentry::getUserProvider()->findByLogin('admin@admin.com'); 28 | $adminGroup = Sentry::getGroupProvider()->findByName('Admin'); 29 | $adminUser->addGroup($adminGroup); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/facades/ImageFacade.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 18 | 'next' => 'Next »', 19 | 20 | ); -------------------------------------------------------------------------------- /app/lang/en/reminders.php: -------------------------------------------------------------------------------- 1 | "Passwords must be six characters and match the confirmation.", 17 | 18 | "user" => "We can't find a user with that e-mail address.", 19 | 20 | "token" => "This password reset token is invalid.", 21 | 22 | ); -------------------------------------------------------------------------------- /app/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | "The :attribute must be accepted.", 17 | "active_url" => "The :attribute is not a valid URL.", 18 | "after" => "The :attribute must be a date after :date.", 19 | "alpha" => "The :attribute may only contain letters.", 20 | "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", 21 | "alpha_num" => "The :attribute may only contain letters and numbers.", 22 | "before" => "The :attribute must be a date before :date.", 23 | "between" => array( 24 | "numeric" => "The :attribute must be between :min - :max.", 25 | "file" => "The :attribute must be between :min - :max kilobytes.", 26 | "string" => "The :attribute must be between :min - :max characters.", 27 | ), 28 | "confirmed" => "The :attribute confirmation does not match.", 29 | "date" => "The :attribute is not a valid date.", 30 | "date_format" => "The :attribute does not match the format :format.", 31 | "different" => "The :attribute and :other must be different.", 32 | "digits" => "The :attribute must be :digits digits.", 33 | "digits_between" => "The :attribute must be between :min and :max digits.", 34 | "email" => "The :attribute format is invalid.", 35 | "exists" => "The selected :attribute is invalid.", 36 | "image" => "The :attribute must be an image.", 37 | "in" => "The selected :attribute is invalid.", 38 | "integer" => "The :attribute must be an integer.", 39 | "ip" => "The :attribute must be a valid IP address.", 40 | "max" => array( 41 | "numeric" => "The :attribute may not be greater than :max.", 42 | "file" => "The :attribute may not be greater than :max kilobytes.", 43 | "string" => "The :attribute may not be greater than :max characters.", 44 | ), 45 | "mimes" => "The :attribute must be a file of type: :values.", 46 | "min" => array( 47 | "numeric" => "The :attribute must be at least :min.", 48 | "file" => "The :attribute must be at least :min kilobytes.", 49 | "string" => "The :attribute must be at least :min characters.", 50 | ), 51 | "not_in" => "The selected :attribute is invalid.", 52 | "numeric" => "The :attribute must be a number.", 53 | "regex" => "The :attribute format is invalid.", 54 | "required" => "The :attribute field is required.", 55 | "required_if" => "The :attribute field is required when :other is :value.", 56 | "required_with" => "The :attribute field is required when :values is present.", 57 | "required_without" => "The :attribute field is required when :values is not present.", 58 | "same" => "The :attribute and :other must match.", 59 | "size" => array( 60 | "numeric" => "The :attribute must be :size.", 61 | "file" => "The :attribute must be :size kilobytes.", 62 | "string" => "The :attribute must be :size characters.", 63 | ), 64 | "unique" => "The :attribute has already been taken.", 65 | "url" => "The :attribute format is invalid.", 66 | 67 | /* 68 | |-------------------------------------------------------------------------- 69 | | Custom Validation Language Lines 70 | |-------------------------------------------------------------------------- 71 | | 72 | | Here you may specify custom validation messages for attributes using the 73 | | convention "attribute.rule" to name the lines. This makes it quick to 74 | | specify a specific custom language line for a given attribute rule. 75 | | 76 | */ 77 | 78 | 'custom' => array(), 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | Custom Validation Attributes 83 | |-------------------------------------------------------------------------- 84 | | 85 | | The following language lines are used to swap attribute place-holders 86 | | with something more reader friendly such as E-Mail Address instead 87 | | of "email". This simply helps us make messages a little cleaner. 88 | | 89 | */ 90 | 91 | 'attributes' => array(), 92 | 93 | ); 94 | -------------------------------------------------------------------------------- /app/models/Article.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\Models\User', 'user_id'); 10 | } 11 | 12 | } 13 | 14 | -------------------------------------------------------------------------------- /app/models/Page.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\Models\User', 'user_id'); 10 | } 11 | 12 | } 13 | 14 | -------------------------------------------------------------------------------- /app/models/User.php: -------------------------------------------------------------------------------- 1 | getKey(); 31 | } 32 | 33 | /** 34 | * Get the password for the user. 35 | * 36 | * @return string 37 | */ 38 | public function getAuthPassword() 39 | { 40 | return $this->password; 41 | } 42 | 43 | /** 44 | * Get the e-mail address where password reminders are sent. 45 | * 46 | * @return string 47 | */ 48 | public function getReminderEmail() 49 | { 50 | return $this->email; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /app/routes.php: -------------------------------------------------------------------------------- 1 | 'admin.logout', 'uses' => 'App\Controllers\Admin\AuthController@getLogout')); 15 | Route::get('admin/login', array('as' => 'admin.login', 'uses' => 'App\Controllers\Admin\AuthController@getLogin')); 16 | Route::post('admin/login', array('as' => 'admin.login.post', 'uses' => 'App\Controllers\Admin\AuthController@postLogin')); 17 | 18 | Route::group(array('prefix' => 'admin', 'before' => 'auth.admin'), function() 19 | { 20 | Route::any('/', 'App\Controllers\Admin\PagesController@index'); 21 | Route::resource('articles', 'App\Controllers\Admin\ArticlesController'); 22 | Route::resource('pages', 'App\Controllers\Admin\PagesController'); 23 | }); 24 | -------------------------------------------------------------------------------- /app/services/Image.php: -------------------------------------------------------------------------------- 1 | imagine) 38 | { 39 | $this->library = $library ? $library : null; 40 | 41 | // Use image magick if available 42 | if ( ! $this->library and class_exists('Imagick')) $this->library = 'imagick'; 43 | else $this->library = 'gd'; 44 | 45 | // Now create instance 46 | if ($this->library == 'imagick') $this->imagine = new \Imagine\Imagick\Imagine(); 47 | elseif ($this->library == 'gmagick') $this->imagine = new \Imagine\Gmagick\Imagine(); 48 | elseif ($this->library == 'gd') $this->imagine = new \Imagine\Gd\Imagine(); 49 | else $this->imagine = new \Imagine\Gd\Imagine(); 50 | } 51 | } 52 | 53 | /** 54 | * Resize an image 55 | * @param string $url 56 | * @param integer $width 57 | * @param integer $height 58 | * @param boolean $crop 59 | * @return string 60 | */ 61 | public function resize($url, $width = 100, $height = null, $crop = false, $quality = null) 62 | { 63 | if ($url) 64 | { 65 | // URL info 66 | $info = pathinfo($url); 67 | 68 | // The size 69 | if ( ! $height) $height = $width; 70 | 71 | // Quality 72 | $quality = ($quality) ? $quality : $this->quality; 73 | 74 | // Directories and file names 75 | $fileName = $info['basename']; 76 | $sourceDirPath = public_path() . $info['dirname']; 77 | $sourceFilePath = $sourceDirPath . '/' . $fileName; 78 | $targetDirName = $width . 'x' . $height . ($crop ? '_crop' : ''); 79 | $targetDirPath = $sourceDirPath . '/' . $targetDirName . '/'; 80 | $targetFilePath = $targetDirPath . $fileName; 81 | $targetUrl = asset($info['dirname'] . '/' . $targetDirName . '/' . $fileName); 82 | 83 | // Create directory if missing 84 | try 85 | { 86 | // Create dir if missing 87 | if ( ! File::isDirectory($targetDirPath) and $targetDirPath) @File::makeDirectory($targetDirPath); 88 | 89 | // Set the size 90 | $size = new \Imagine\Image\Box($width, $height); 91 | 92 | // Now the mode 93 | $mode = $crop ? \Imagine\Image\ImageInterface::THUMBNAIL_OUTBOUND : \Imagine\Image\ImageInterface::THUMBNAIL_INSET; 94 | 95 | if ($this->overwrite or ! File::exists($targetFilePath) or (File::lastModified($targetFilePath) < File::lastModified($sourceFilePath))) 96 | { 97 | $this->imagine->open($sourceFilePath) 98 | ->thumbnail($size, $mode) 99 | ->save($targetFilePath, array('quality' => $quality)); 100 | } 101 | } 102 | catch (\Exception $e) 103 | { 104 | Log::error('[IMAGE SERVICE] Failed to resize image "' . $url . '" [' . $e->getMessage() . ']'); 105 | } 106 | 107 | return $targetUrl; 108 | } 109 | } 110 | 111 | /** 112 | * Helper for creating thumbs 113 | * @param string $url 114 | * @param integer $width 115 | * @param integer $height 116 | * @return string 117 | */ 118 | public function thumb($url, $width, $height = null) 119 | { 120 | return $this->resize($url, $width, $height, true); 121 | } 122 | 123 | /** 124 | * Upload an image to the public storage 125 | * @param File $file 126 | * @return string 127 | */ 128 | public function upload($file, $dir = null) 129 | { 130 | if ($file) 131 | { 132 | // Generate random dir 133 | if ( ! $dir) $dir = str_random(8); 134 | 135 | // Get file info and try to move 136 | $destination = public_path() . '/uploads/' . $dir; 137 | $filename = $file->getClientOriginalName(); 138 | $path = '/uploads/' . $dir . '/' . $filename; 139 | $uploaded = $file->move($destination, $filename); 140 | 141 | if ($uploaded) return $path; 142 | } 143 | } 144 | 145 | } 146 | -------------------------------------------------------------------------------- /app/services/validators/ArticleValidator.php: -------------------------------------------------------------------------------- 1 | 'required', 7 | 'body' => 'required', 8 | ); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /app/services/validators/PageValidator.php: -------------------------------------------------------------------------------- 1 | 'required', 7 | 'body' => 'required', 8 | ); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /app/services/validators/Validator.php: -------------------------------------------------------------------------------- 1 | data = $data ?: \Input::all(); 30 | } 31 | 32 | /** 33 | * Check if validation passes 34 | * @return bool 35 | */ 36 | public function passes() 37 | { 38 | $validation = \Validator::make($this->data, static::$rules); 39 | 40 | if ($validation->passes()) return true; 41 | 42 | $this->errors = $validation->messages(); 43 | 44 | return false; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app/start/artisan.php: -------------------------------------------------------------------------------- 1 | client->request('GET', '/'); 13 | 14 | $this->assertTrue($this->client->getResponse()->isOk()); 15 | 16 | $this->assertCount(1, $crawler->filter('h1:contains("Hello World!")')); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /app/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | L4 Site 6 | 7 | @include('admin._partials.assets') 8 | 9 | 10 |
11 | @include('admin._partials.header') 12 | 13 | @yield('main') 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /app/views/admin/_partials/assets.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/views/admin/_partials/header.blade.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /app/views/admin/_partials/navigation.blade.php: -------------------------------------------------------------------------------- 1 | @if (Sentry::check()) 2 | 7 | @endif 8 | -------------------------------------------------------------------------------- /app/views/admin/_partials/notifications.blade.php: -------------------------------------------------------------------------------- 1 | {{ Notification::showAll() }} 2 | 3 | @if ($errors->any()) 4 |
5 | {{ implode('
', $errors->all()) }} 6 |
7 | @endif 8 | -------------------------------------------------------------------------------- /app/views/admin/articles/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin._layouts.default') 2 | 3 | @section('main') 4 | 5 |

Create new article

6 | 7 | @include('admin._partials.notifications') 8 | 9 | {{ Form::open(array('route' => 'admin.articles.store', 'files' => true)) }} 10 | 11 |
12 | {{ Form::label('title', 'Title') }} 13 |
14 | {{ Form::text('title') }} 15 |
16 |
17 | 18 |
19 | {{ Form::label('body', 'Content') }} 20 |
21 | {{ Form::textarea('body') }} 22 |
23 |
24 | 25 |
26 | {{ Form::label('image', 'Image') }} 27 | 28 |
29 |
30 | 31 |
32 |
33 | Select imageChange{{ Form::file('image') }} 34 | Remove 35 |
36 |
37 |
38 | 39 |
40 | {{ Form::submit('Save', array('class' => 'btn btn-success btn-save btn-large')) }} 41 | Cancel 42 |
43 | 44 | {{ Form::close() }} 45 | 46 | @stop 47 | -------------------------------------------------------------------------------- /app/views/admin/articles/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin._layouts.default') 2 | 3 | @section('main') 4 | 5 |

Edit article

6 | 7 | @include('admin._partials.notifications') 8 | 9 | {{ Form::model($article, array('method' => 'put', 'route' => array('admin.articles.update', $article->id), 'files' => true)) }} 10 | 11 |
12 | {{ Form::label('title', 'Title') }} 13 |
14 | {{ Form::text('title') }} 15 |
16 |
17 | 18 |
19 | {{ Form::label('body', 'Content') }} 20 |
21 | {{ Form::textarea('body') }} 22 |
23 |
24 | 25 |
26 | {{ Form::label('image', 'Image') }} 27 | 28 |
29 |
30 | @if ($article->image) 31 | 32 | @else 33 | 34 | @endif 35 |
36 |
37 | Select imageChange{{ Form::file('image') }} 38 | Remove 39 |
40 |
41 |
42 | 43 |
44 | {{ Form::submit('Save', array('class' => 'btn btn-success btn-save btn-large')) }} 45 | Cancel 46 |
47 | 48 | {{ Form::close() }} 49 | 50 | @stop 51 | -------------------------------------------------------------------------------- /app/views/admin/articles/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin._layouts.default') 2 | 3 | @section('main') 4 | 5 |

6 | Articles Add new article 7 |

8 | 9 |
10 | 11 | {{ Notification::showAll() }} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | @foreach ($articles as $article) 24 | 25 | 26 | 27 | 28 | 35 | 36 | @endforeach 37 | 38 |
#TitleWhen
{{ $article->id }}{{ $article->title }}{{ $article->created_at }} 29 | Edit 30 | 31 | {{ Form::open(array('route' => array('admin.articles.destroy', $article->id), 'method' => 'delete', 'data-confirm' => 'Are you sure?')) }} 32 | 33 | {{ Form::close() }} 34 |
39 | 40 | @stop 41 | -------------------------------------------------------------------------------- /app/views/admin/articles/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin._layouts.default') 2 | 3 | @section('main') 4 |

Display article

5 | 6 |
7 | 8 |

{{ $article->title }}

9 |
@{{ $article->created_at }}
10 | {{ $article->body }} 11 | 12 | @if ($article->image) 13 |
14 |
15 | @endif 16 | @stop 17 | -------------------------------------------------------------------------------- /app/views/admin/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin._layouts.default') 2 | 3 | @section('main') 4 | 5 |
6 | {{ Form::open() }} 7 | 8 | @if ($errors->has('login')) 9 |
{{ $errors->first('login', ':message') }}
10 | @endif 11 | 12 |
13 | {{ Form::label('email', 'Email') }} 14 |
15 | {{ Form::text('email') }} 16 |
17 |
18 | 19 |
20 | {{ Form::label('password', 'Password') }} 21 |
22 | {{ Form::password('password') }} 23 |
24 |
25 | 26 |
27 | {{ Form::submit('Login', array('class' => 'btn btn-inverse btn-login')) }} 28 |
29 | 30 | {{ Form::close() }} 31 |
32 | 33 | @stop -------------------------------------------------------------------------------- /app/views/admin/pages/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin._layouts.default') 2 | 3 | @section('main') 4 | 5 |

Create new page

6 | 7 | @include('admin._partials.notifications') 8 | 9 | {{ Form::open(array('route' => 'admin.pages.store')) }} 10 | 11 |
12 | {{ Form::label('title', 'Title') }} 13 |
14 | {{ Form::text('title') }} 15 |
16 |
17 | 18 |
19 | {{ Form::label('body', 'Content') }} 20 |
21 | {{ Form::textarea('body') }} 22 |
23 |
24 | 25 |
26 | {{ Form::submit('Save', array('class' => 'btn btn-success btn-save btn-large')) }} 27 | Cancel 28 |
29 | 30 | {{ Form::close() }} 31 | 32 | @stop 33 | -------------------------------------------------------------------------------- /app/views/admin/pages/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin._layouts.default') 2 | 3 | @section('main') 4 | 5 |

Edit page

6 | 7 | @include('admin._partials.notifications') 8 | 9 | {{ Form::model($page, array('method' => 'put', 'route' => array('admin.pages.update', $page->id))) }} 10 | 11 |
12 | {{ Form::label('title', 'Title') }} 13 |
14 | {{ Form::text('title') }} 15 |
16 |
17 | 18 |
19 | {{ Form::label('body', 'Content') }} 20 |
21 | {{ Form::textarea('body') }} 22 |
23 |
24 | 25 |
26 | {{ Form::submit('Save', array('class' => 'btn btn-success btn-save btn-large')) }} 27 | Cancel 28 |
29 | 30 | {{ Form::close() }} 31 | 32 | @stop 33 | -------------------------------------------------------------------------------- /app/views/admin/pages/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin._layouts.default') 2 | 3 | @section('main') 4 | 5 |

6 | Pages Add new page 7 |

8 | 9 |
10 | 11 | {{ Notification::showAll() }} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | @foreach ($pages as $page) 24 | 25 | 26 | 27 | 28 | 35 | 36 | @endforeach 37 | 38 |
#TitleWhen
{{ $page->id }}{{ $page->title }}{{ $page->created_at }} 29 | Edit 30 | 31 | {{ Form::open(array('route' => array('admin.pages.destroy', $page->id), 'method' => 'delete', 'data-confirm' => 'Are you sure?')) }} 32 | 33 | {{ Form::close() }} 34 |
39 | 40 | @stop 41 | -------------------------------------------------------------------------------- /app/views/admin/pages/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin._layouts.default') 2 | 3 | @section('main') 4 |

Display page

5 | 6 |
7 | 8 |

{{ $page->title }}

9 |
@{{ $page->created_at }}
10 | {{ $page->body }} 11 | @stop -------------------------------------------------------------------------------- /app/views/emails/auth/reminder.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Password Reset

8 | 9 |
10 | To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}. 11 |
12 | 13 | -------------------------------------------------------------------------------- /app/views/hello.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Laravel 4 Tutorial 6 | 7 | 8 | 9 | 10 | 11 | 54 | 55 | 56 | 57 |
58 | 59 |

You have arrived.

60 |

Nothing to see here, proceed to login.

61 |
62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | boot(); 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Load The Artisan Console Application 37 | |-------------------------------------------------------------------------- 38 | | 39 | | We'll need to run the script to load and return the Artisan console 40 | | application. We keep this in its own script so that we will load 41 | | the console application independent of running commands which 42 | | will allow us to fire commands from Routes when we want to. 43 | | 44 | */ 45 | 46 | $artisan = Illuminate\Console\Application::start($app); 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Run The Artisan Application 51 | |-------------------------------------------------------------------------- 52 | | 53 | | When we run the console application, the current CLI command will be 54 | | executed in this console and the response sent back to a terminal 55 | | or another output device for the developers. Here goes nothing! 56 | | 57 | */ 58 | 59 | $status = $artisan->run(); 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Shutdown The Application 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Once Artisan has finished running. We will fire off the shutdown events 67 | | so that any final work may be done by the application before we shut 68 | | down the process. This is the last thing to happen to the request. 69 | | 70 | */ 71 | 72 | $app->shutdown(); 73 | 74 | exit($status); -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | __DIR__.'/../app', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Public Path 21 | |-------------------------------------------------------------------------- 22 | | 23 | | The public path contains the assets for your web application, such as 24 | | your JavaScript and CSS files, and also contains the primary entry 25 | | point for web requests into these applications from the outside. 26 | | 27 | */ 28 | 29 | 'public' => __DIR__.'/../public', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Base Path 34 | |-------------------------------------------------------------------------- 35 | | 36 | | The base path is the root of the Laravel installation. Most likely you 37 | | will not need to change this value. But, if for some wild reason it 38 | | is necessary you will do so here, just proceed with some caution. 39 | | 40 | */ 41 | 42 | 'base' => __DIR__.'/..', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Storage Path 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The storage path is used by Laravel to store cached Blade views, logs 50 | | and other pieces of information. You may modify the path here when 51 | | you want to change the location of this directory for your apps. 52 | | 53 | */ 54 | 55 | 'storage' => __DIR__.'/../app/storage', 56 | 57 | ); 58 | -------------------------------------------------------------------------------- /bootstrap/start.php: -------------------------------------------------------------------------------- 1 | redirectIfTrailingSlash(); 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Detect The Application Environment 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Laravel takes a dead simple approach to your application environments 24 | | so you can just specify a machine name or HTTP host that matches a 25 | | given environment, then we will automatically detect it for you. 26 | | 27 | */ 28 | 29 | $env = $app->detectEnvironment(array( 30 | 31 | 'local' => array('localhost', 'l4.dev'), 32 | 33 | )); 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Bind Paths 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here we are binding the paths configured in paths.php to the app. You 41 | | should not be changing these here. If you need to change these you 42 | | may do so within the paths.php file and they will be bound here. 43 | | 44 | */ 45 | 46 | $app->bindInstallPaths(require __DIR__.'/paths.php'); 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Load The Application 51 | |-------------------------------------------------------------------------- 52 | | 53 | | Here we will load the Illuminate application. We'll keep this is in a 54 | | separate location so we can isolate the creation of an application 55 | | from the actual running of the application with a given request. 56 | | 57 | */ 58 | 59 | $framework = $app['path.base'].'/vendor/laravel/framework/src'; 60 | 61 | require $framework.'/Illuminate/Foundation/start.php'; 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | Return The Application 66 | |-------------------------------------------------------------------------- 67 | | 68 | | This script returns the application instance. The instance is given to 69 | | the calling script so we can separate the building of the instances 70 | | from the actual running of the application and sending responses. 71 | | 72 | */ 73 | 74 | return $app; 75 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "laravel/framework": "4.0.*", 4 | "cartalyst/sentry": "2.0.*", 5 | "dflydev/markdown": "v1.0.2", 6 | "imagine/Imagine": "v0.4.1", 7 | "edvinaskrucas/notification": "1.*" 8 | }, 9 | "autoload": { 10 | "classmap": [ 11 | "app/commands", 12 | "app/controllers", 13 | "app/models", 14 | "app/database/migrations", 15 | "app/database/seeds", 16 | "app/tests/TestCase.php", 17 | "app/services", 18 | "app/facades", 19 | "public/site" 20 | ] 21 | }, 22 | "scripts": { 23 | "pre-update-cmd": [ 24 | "php artisan clear-compiled" 25 | ], 26 | "post-install-cmd": [ 27 | "php artisan optimize" 28 | ], 29 | "post-update-cmd": [ 30 | "php artisan optimize" 31 | ] 32 | }, 33 | "config": { 34 | "preferred-install": "dist" 35 | }, 36 | "minimum-stability": "dev" 37 | } 38 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Options -MultiViews 3 | RewriteEngine On 4 | 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteRule ^ index.php [L] 7 | -------------------------------------------------------------------------------- /public/assets/css/bootstrap-responsive.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.3.1 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@-ms-viewport{width:device-width}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:inherit!important}.hidden-print{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .nav>li>a:focus,.nav-collapse .dropdown-menu a:hover,.nav-collapse .dropdown-menu a:focus{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .nav>li>a:focus,.navbar-inverse .nav-collapse .dropdown-menu a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:focus{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} 10 | /*! 11 | * Jasny Bootstrap Responsive Extensions j3 12 | * 13 | * Copyright 2012 Jasny BV 14 | * Licensed under the Apache License v2.0 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Extended with pride by @ArnoldDaniels of jasny.net 18 | */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.container-semifluid{max-width:1170px}@media(min-width:768px) and (max-width:979px){.row-desktop.row-fluid{width:100%}.row-desktop.row{margin-left:0}.row-desktop>[class*="span"],.row-desktop>[class*="span"]{display:block;float:none;width:auto;margin:0}}@media(max-width:767px){.table-responsive tr{display:block;padding:8px}.table-bordered.table-responsive tr{border:1px solid #DDD;border-top:0;border-right:0}.table-responsive td,.table-responsive th{display:block;padding:0;font-weight:normal;border:0}.table-responsive th{font-style:italic}.responsive-strong{font-weight:bold}.responsive-em{font-style:italic}.responsive-soft{color:#999}}@media(max-width:480px){.form-horizontal .controls,.form-horizontal .well .controls,.small-labels .controls{margin-left:0}}@media(max-width:768px){.form-horizontal .form-actions{padding-left:18px}}@media(min-width:768px) and (max-width:979px){.form-horizontal .control-label{width:100px}.form-horizontal .controls{margin-left:110px}.form-horizontal .form-actions{padding-left:110px}.form-horizontal .well .control-label{width:80px}.form-horizontal .well .controls{margin-left:90px}.small-labels .control-group>label{width:50px}.small-labels .controls{margin-left:60px}.small-labels .form-actions{padding-left:60px}}@media(min-width:1200px){.small-labels .control-group>label{width:80px}.small-labels .controls{margin-left:100px}.small-labels .form-actions{padding-left:100px}}@media(max-width:480px){.page-alert{position:static;width:auto}.page-alert .alert{width:auto;margin-left:0;border-top-width:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}body>.page-alert{position:static}}@media(min-width:1200px){.page-alert .alert{width:700px;margin-left:-375px}} 19 | -------------------------------------------------------------------------------- /public/assets/css/main.css: -------------------------------------------------------------------------------- 1 | body { padding-top: 60px; padding-bottom: 40px; } 2 | table form { margin: 0 6px; } 3 | table .btn { margin-right: 4px; } 4 | -------------------------------------------------------------------------------- /public/assets/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap.js by @fat & @mdo extended by @ArnoldDaniels 3 | * Copyright 2012 Twitter, Inc. 4 | * http://www.apache.org/licenses/LICENSE-2.0.txt 5 | */ 6 | !function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||s.toggleClass("open"),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e.fn[this.type].defaults,r={},i;this._options&&e.each(this._options,function(e,t){n[e]!=t&&(r[e]=t)},this),i=e(t.currentTarget)[this.type](r).data(this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'

'}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.options.target&&(this.$target=e(this.options.target)),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.strict=this.options.strict,this.$menu=e(this.options.menu),this.shown=!1,typeof this.source=="string"&&(this.url=this.source,this.source=this.searchAjax),t.nodeName=="SELECT"&&this.replaceSelect(),this.text=this.$element.val(),this.$element.attr("data-text",this.value).attr("autocomplete","off"),typeof this.$target!="undefined"?this.$element.attr("data-value",this.$target.val()):typeof this.$element.attr("data-value")=="undefined"&&this.$element.attr("data-value",this.strict?"":this.value),this.$menu.css("min-width",this.$element.width()+12),this.listen()};t.prototype={constructor:t,replaceSelect:function(){this.$target=this.$element,this.$element=e(''),this.source={},this.strict=!0;var t=this.$target.find("option"),n;for(var r=0;r0?e.find(".item-text").text():e.text();return t=this.updater(t,"value"),n=this.updater(n,"text"),this.$element.val(n).attr("data-value",t),this.text=n,typeof this.$target!="undefined"&&this.$target.val(t).trigger("change"),this.$element.trigger("change"),this.hide()},updater:function(e,t){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length=n.options.items&&delete r[e]}),this.render(r).show())},searchAjax:function(t,n){var r=this;this.ajaxTimeout&&clearTimeout(this.ajaxTimeout),this.ajaxTimeout=setTimeout(function(){r.ajaxTimeout&&clearTimeout(r.ajaxTimeout);if(t===""){r.hide();return}e.get(r.url,{q:t,limit:r.options.items},function(e){typeof e=="string"&&(e=JSON.parse(e)),n(e)})},this.options.ajaxdelay)},matcher:function(e){return~e.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(t){return e.isArray(t)?this.sortArray(t):this.sortObject(t)},sortArray:function(e){var t=[],n=[],r=[],i;while(i=e.shift())i.toLowerCase().indexOf(this.query.toLowerCase())?~i.indexOf(this.query)?n.push(i):r.push(i):t.push(i);return t.concat(n,r)},sortObject:function(e){var t={},n;for(n in e)e[n].toLowerCase().indexOf(this.query.toLowerCase())||(t[n]=e[n],delete e[n]);for(n in e)~e[n].indexOf(this.query)&&(t[n]=e[n],delete e[n]);for(n in e)t[n]=e[n];return t},highlighter:function(e){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),function(e,t){return""+t+""})},render:function(t){var n=this,r=e([]);return e.map(t,function(i,s){if(r.length>=n.options.items)return;var o,u;e.isArray(t)&&(s=i),o=e(n.options.item),u=o.find("a").length?o.find("a"):o,u.html(n.highlighter(i)),o.attr("data-value",s),o.find("a").length===0&&o.addClass("dropdown-header"),r.push(o[0])}),r.not(".dropdown-header").first().addClass("active"),this.$menu.html(r),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.nextAll("li:not(.dropdown-header)").first();r.length||(r=e(this.$menu.find("li:not(.dropdown-header)")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prevAll("li:not(.dropdown-header)").first();n.length||(n=this.$menu.find("li:not(.dropdown-header)").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("change",e.proxy(this.change,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this)),e(window).on("unload",e.proxy(this.destroyReplacement,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},change:function(e){var t;this.$element.val()!=this.text&&(t=this.$element.val()===""||this.strict?"":this.$element.val(),this.$element.val(t),this.$element.attr("data-value",t),this.text=t,typeof this.$target!="undefined"&&this.$target.val(t))},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'',item:'
  • ',ajaxdelay:400,minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).off("focus.typeahead.data-api").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.is("select")&&n.attr("autofocus",!0),t.preventDefault(),n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=window.orientation!==undefined,n=navigator.userAgent.toLowerCase().indexOf("android")>-1,r=function(t,r){if(n)return;this.$element=e(t),this.options=e.extend({},e.fn.inputmask.defaults,r),this.mask=String(r.mask),this.init(),this.listen(),this.checkVal()};r.prototype={init:function(){var t=this.options.definitions,n=this.mask.length;this.tests=[],this.partialPosition=this.mask.length,this.firstNonMaskPos=null,e.each(this.mask.split(""),e.proxy(function(e,r){r=="?"?(n--,this.partialPosition=e):t[r]?(this.tests.push(new RegExp(t[r])),this.firstNonMaskPos===null&&(this.firstNonMaskPos=this.tests.length-1)):this.tests.push(null)},this)),this.buffer=e.map(this.mask.split(""),e.proxy(function(e,n){if(e!="?")return t[e]?this.options.placeholder:e},this)),this.focusText=this.$element.val(),this.$element.data("rawMaskFn",e.proxy(function(){return e.map(this.buffer,function(e,t){return this.tests[t]&&e!=this.options.placeholder?e:null}).join("")},this))},listen:function(){if(this.$element.attr("readonly"))return;var t=(navigator.userAgent.match(/msie/i)?"paste":"input")+".mask";this.$element.on("unmask",e.proxy(this.unmask,this)).on("focus.mask",e.proxy(this.focusEvent,this)).on("blur.mask",e.proxy(this.blurEvent,this)).on("keydown.mask",e.proxy(this.keydownEvent,this)).on("keypress.mask",e.proxy(this.keypressEvent,this)).on(t,e.proxy(this.pasteEvent,this))},caret:function(e,t){if(this.$element.length===0)return;if(typeof e=="number")return t=typeof t=="number"?t:e,this.$element.each(function(){if(this.setSelectionRange)this.setSelectionRange(e,t);else if(this.createTextRange){var n=this.createTextRange();n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",e),n.select()}});if(this.$element[0].setSelectionRange)e=this.$element[0].selectionStart,t=this.$element[0].selectionEnd;else if(document.selection&&document.selection.createRange){var n=document.selection.createRange();e=0-n.duplicate().moveStart("character",-1e5),t=e+n.text.length}return{begin:e,end:t}},seekNext:function(e){var t=this.mask.length;while(++e<=t&&!this.tests[e]);return e},seekPrev:function(e){while(--e>=0&&!this.tests[e]);return e},shiftL:function(e,t){var n=this.mask.length;if(e<0)return;for(var r=e,i=this.seekNext(t);rn.length)break}else this.buffer[i]==n.charAt(s)&&i!=this.partialPosition&&(s++,r=i);if(!e&&r+1=this.partialPosition)this.writeBuffer(),e||this.$element.val(this.$element.val().substring(0,r+1));return this.partialPosition?i:this.firstNonMaskPos}},e.fn.inputmask=function(t){return this.each(function(){var n=e(this),i=n.data("inputmask");i||n.data("inputmask",i=new r(this,t))})},e.fn.inputmask.defaults={mask:"",placeholder:"_",definitions:{9:"[0-9]",a:"[A-Za-z]","?":"[A-Za-z0-9]","*":"."}},e.fn.inputmask.Constructor=r,e(document).on("focus.inputmask.data-api","[data-mask]",function(t){var n=e(this);if(n.data("inputmask"))return;t.preventDefault(),n.inputmask(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){n=e.extend({},e.fn.rowlink.defaults,n);var r=t.nodeName.toLowerCase()=="tr"?e(t):e(t).find("tr:has(td)");r.each(function(){var t=e(this).find(n.target).first();if(!t.length)return;var r=t.attr("href");e(this).find("td").not(".nolink").click(function(){window.location=r}),e(this).addClass("rowlink"),t.replaceWith(t.html())})};e.fn.rowlink=function(n){return this.each(function(){var r=e(this),i=r.data("rowlink");i||r.data("rowlink",i=new t(this,n))})},e.fn.rowlink.defaults={target:"a"},e.fn.rowlink.Constructor=t,e(function(){e('[data-provide="rowlink"],[data-provides="rowlink"]').each(function(){e(this).rowlink(e(this).data())})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.type=this.$element.data("uploadtype")||(this.$element.find(".thumbnail").length>0?"image":"file"),this.$input=this.$element.find(":file");if(this.$input.length===0)return;this.name=this.$input.attr("name")||n.name,this.$hidden=this.$element.find('input[type=hidden][name="'+this.name+'"]'),this.$hidden.length===0&&(this.$hidden=e(''),this.$element.prepend(this.$hidden)),this.$preview=this.$element.find(".fileupload-preview");var r=this.$preview.css("height");this.$preview.css("display")!="inline"&&r!="0px"&&r!="none"&&this.$preview.css("line-height",r),this.original={exists:this.$element.hasClass("fileupload-exists"),preview:this.$preview.html(),hiddenVal:this.$hidden.val()},this.$remove=this.$element.find('[data-dismiss="fileupload"]'),this.$element.find('[data-trigger="fileupload"]').on("click.fileupload",e.proxy(this.trigger,this)),this.listen()};t.prototype={listen:function(){this.$input.on("change.fileupload",e.proxy(this.change,this)),e(this.$input[0].form).on("reset.fileupload",e.proxy(this.reset,this)),this.$remove&&this.$remove.on("click.fileupload",e.proxy(this.clear,this))},change:function(e,t){if(t==="clear")return;var n=e.target.files!==undefined?e.target.files[0]:e.target.value?{name:e.target.value.replace(/^.+\\/,"")}:null;if(!n){this.clear();return}this.$hidden.val(""),this.$hidden.attr("name",""),this.$input.attr("name",this.name);if(this.type==="image"&&this.$preview.length>0&&(typeof n.type!="undefined"?n.type.match("image.*"):n.name.match(/\.(gif|png|jpe?g)$/i))&&typeof FileReader!="undefined"){var r=new FileReader,i=this.$preview,s=this.$element;r.onload=function(e){i.html('"),s.addClass("fileupload-exists").removeClass("fileupload-new")},r.readAsDataURL(n)}else this.$preview.text(n.name),this.$element.addClass("fileupload-exists").removeClass("fileupload-new")},clear:function(e){this.$hidden.val(""),this.$hidden.attr("name",this.name),this.$input.attr("name","");if(navigator.userAgent.match(/msie/i)){var t=this.$input.clone(!0);this.$input.after(t),this.$input.remove(),this.$input=t}else this.$input.val("");this.$preview.html(""),this.$element.addClass("fileupload-new").removeClass("fileupload-exists"),e&&(this.$input.trigger("change",["clear"]),e.preventDefault())},reset:function(e){this.clear(),this.$hidden.val(this.original.hiddenVal),this.$preview.html(this.original.preview),this.original.exists?this.$element.addClass("fileupload-exists").removeClass("fileupload-new"):this.$element.addClass("fileupload-new").removeClass("fileupload-exists")},trigger:function(e){this.$input.trigger("click"),e.preventDefault()}},e.fn.fileupload=function(n){return this.each(function(){var r=e(this),i=r.data("fileupload");i||r.data("fileupload",i=new t(this,n)),typeof n=="string"&&i[n]()})},e.fn.fileupload.Constructor=t,e(document).on("click.fileupload.data-api",'[data-provides="fileupload"]',function(t){var n=e(this);if(n.data("fileupload"))return;n.fileupload(n.data());var r=e(t.target).closest('[data-dismiss="fileupload"],[data-trigger="fileupload"]');r.length>0&&(r.trigger("click.fileupload"),t.preventDefault())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery); -------------------------------------------------------------------------------- /public/assets/js/script.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | // Confirm deleting resources 4 | $("form[data-confirm]").submit(function() { 5 | if ( ! confirm($(this).attr("data-confirm"))) { 6 | return false; 7 | } 8 | }); 9 | 10 | }); 11 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bstrahija/l4-site-tutorial/15f34895815acf6a15d4a23009840327574c6ad3/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader 15 | | for our application. We just need to utilize it! We'll require it 16 | | into the script here so that we do not have to worry about the 17 | | loading of any our classes "manually". Feels great to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let's turn on the lights. 29 | | This bootstrap the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight these users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/start.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can simply call the run method, 43 | | which will execute the request and send the response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful applications we have created for them. 46 | | 47 | */ 48 | 49 | $app->run(); 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Shutdown The Application 54 | |-------------------------------------------------------------------------- 55 | | 56 | | Once the app has finished running, we will fire off the shutdown events 57 | | so that any final work may be done by the application before we shut 58 | | down the process. This is the last thing to happen to the request. 59 | | 60 | */ 61 | 62 | $app->shutdown(); 63 | -------------------------------------------------------------------------------- /public/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bstrahija/l4-site-tutorial/15f34895815acf6a15d4a23009840327574c6ad3/public/packages/.gitkeep -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/site/SiteServiceProvider.php: -------------------------------------------------------------------------------- 1 | package('app/site', 'site', public_path() . '/site'); 8 | } 9 | 10 | public function register() 11 | { 12 | require public_path() . '/site/routes.php'; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /public/site/assets/css/main.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Vollkorn:400,700); 2 | @import url(http://fonts.googleapis.com/css?family=Lobster); 3 | 4 | /* Global */ 5 | body { background: #eee url(../img/bg.png); font-family: 'Vollkorn', Georgia, "Times New Roman", serif; color: #444; font-size: 15px; } 6 | h1, h2, h3, h4, h5, h6 { font-family: Lobster, Georgia, "Times New Roman", serif; font-weight: normal; } 7 | h1 { font-size: 48px; } 8 | h2 { font-size: 36px; } 9 | h3 { font-size: 30px; } 10 | h4 { font-size: 24px; } 11 | h5 { font-size: 20px; } 12 | h6 { font-size: 16px; } 13 | p { margin: 0 0 20px 0; font-size: 15px; line-height: 160%; } 14 | a { color: #21759B; border-bottom: 1px dotted #ccc; text-decoration: none; -webkit-transition:color .1s ease-in; transition:color .1s ease-in; } 15 | a:hover { color: #1F536C; } 16 | hr { margin: 20px 0; border: 0; border-top: 1px solid #ddd; border-bottom: 1px solid #eee; } 17 | #layout { width: 960px; margin: 0 auto; padding: 30px 0 20px 0; } 18 | 19 | /* Header */ 20 | #header { height: 1%; clear: both; margin: 0 0 50px 0; } 21 | #header h1 { font-size: 48px; } 22 | #header h1 a { text-decoration: none; border: 0 none; } 23 | 24 | /* Navigation */ 25 | #nav { margin: 0 0 15px 3px; padding: 15px 0 0 0; background: transparent url(../img/l.gif) no-repeat left top; height: 1%; clear: both; } 26 | #nav:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 27 | #nav ul { list-style-type: none; margin: 0; padding: 0; } 28 | #nav li { margin-right: 25px; font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; font-size: 12px; line-height: 160%; float: left; } 29 | #nav li.active a { font-weight: bold; color: #333; } 30 | #nav li a { display: block; border: 0 none; color: #555; } 31 | #nav li a:hover { color: #21759B; } 32 | 33 | /* Footer */ 34 | #footer { padding: 10px 0; background: transparent url(../img/l.gif) no-repeat top left; clear: both; margin: 80px 0 20px 0; } 35 | #footer p { font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; font-size: 11px; line-height: 150%; color: #777; } 36 | 37 | /* Content */ 38 | .articles { margin: 40px 0; padding: 0; list-style-type: none; } 39 | .articles li { margin: 50px 0; } 40 | .articles article h3 { font-size: 28px; } 41 | .articles figure { float: right; margin: 0 0 20px 20px; } 42 | article h3 { font-size: 36px; margin: 0 0 10px 0; } 43 | article h3 a { border: none; color: #444; } 44 | article h3 a:hover { color: #21759B; } 45 | article h5 { font-size: 11px; margin: 0 0 20px 0; font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; color: #777; } 46 | -------------------------------------------------------------------------------- /public/site/assets/css/reset.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v2.1.2 | MIT License | git.io/normalize */ 2 | 3 | /* ========================================================================== 4 | HTML5 display definitions 5 | ========================================================================== */ 6 | 7 | /** 8 | * Correct `block` display not defined in IE 8/9. 9 | */ 10 | 11 | article, 12 | aside, 13 | details, 14 | figcaption, 15 | figure, 16 | footer, 17 | header, 18 | hgroup, 19 | main, 20 | nav, 21 | section, 22 | summary { 23 | display: block; 24 | } 25 | 26 | /** 27 | * Correct `inline-block` display not defined in IE 8/9. 28 | */ 29 | 30 | audio, 31 | canvas, 32 | video { 33 | display: inline-block; 34 | } 35 | 36 | /** 37 | * Prevent modern browsers from displaying `audio` without controls. 38 | * Remove excess height in iOS 5 devices. 39 | */ 40 | 41 | audio:not([controls]) { 42 | display: none; 43 | height: 0; 44 | } 45 | 46 | /** 47 | * Address styling not present in IE 8/9. 48 | */ 49 | 50 | [hidden] { 51 | display: none; 52 | } 53 | 54 | /* ========================================================================== 55 | Base 56 | ========================================================================== */ 57 | 58 | /** 59 | * 1. Set default font family to sans-serif. 60 | * 2. Prevent iOS text size adjust after orientation change, without disabling 61 | * user zoom. 62 | */ 63 | 64 | html { 65 | font-family: sans-serif; /* 1 */ 66 | -ms-text-size-adjust: 100%; /* 2 */ 67 | -webkit-text-size-adjust: 100%; /* 2 */ 68 | } 69 | 70 | /** 71 | * Remove default margin. 72 | */ 73 | 74 | body { 75 | margin: 0; 76 | } 77 | 78 | /* ========================================================================== 79 | Links 80 | ========================================================================== */ 81 | 82 | /** 83 | * Address `outline` inconsistency between Chrome and other browsers. 84 | */ 85 | 86 | a:focus { 87 | outline: thin dotted; 88 | } 89 | 90 | /** 91 | * Improve readability when focused and also mouse hovered in all browsers. 92 | */ 93 | 94 | a:active, 95 | a:hover { 96 | outline: 0; 97 | } 98 | 99 | /* ========================================================================== 100 | Typography 101 | ========================================================================== */ 102 | 103 | /** 104 | * Address variable `h1` font-size and margin within `section` and `article` 105 | * contexts in Firefox 4+, Safari 5, and Chrome. 106 | */ 107 | 108 | h1 { 109 | font-size: 2em; 110 | margin: 0.67em 0; 111 | } 112 | 113 | /** 114 | * Address styling not present in IE 8/9, Safari 5, and Chrome. 115 | */ 116 | 117 | abbr[title] { 118 | border-bottom: 1px dotted; 119 | } 120 | 121 | /** 122 | * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. 123 | */ 124 | 125 | b, 126 | strong { 127 | font-weight: bold; 128 | } 129 | 130 | /** 131 | * Address styling not present in Safari 5 and Chrome. 132 | */ 133 | 134 | dfn { 135 | font-style: italic; 136 | } 137 | 138 | /** 139 | * Address differences between Firefox and other browsers. 140 | */ 141 | 142 | hr { 143 | -moz-box-sizing: content-box; 144 | box-sizing: content-box; 145 | height: 0; 146 | } 147 | 148 | /** 149 | * Address styling not present in IE 8/9. 150 | */ 151 | 152 | mark { 153 | background: #ff0; 154 | color: #000; 155 | } 156 | 157 | /** 158 | * Correct font family set oddly in Safari 5 and Chrome. 159 | */ 160 | 161 | code, 162 | kbd, 163 | pre, 164 | samp { 165 | font-family: monospace, serif; 166 | font-size: 1em; 167 | } 168 | 169 | /** 170 | * Improve readability of pre-formatted text in all browsers. 171 | */ 172 | 173 | pre { 174 | white-space: pre-wrap; 175 | } 176 | 177 | /** 178 | * Set consistent quote types. 179 | */ 180 | 181 | q { 182 | quotes: "\201C" "\201D" "\2018" "\2019"; 183 | } 184 | 185 | /** 186 | * Address inconsistent and variable font size in all browsers. 187 | */ 188 | 189 | small { 190 | font-size: 80%; 191 | } 192 | 193 | /** 194 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 195 | */ 196 | 197 | sub, 198 | sup { 199 | font-size: 75%; 200 | line-height: 0; 201 | position: relative; 202 | vertical-align: baseline; 203 | } 204 | 205 | sup { 206 | top: -0.5em; 207 | } 208 | 209 | sub { 210 | bottom: -0.25em; 211 | } 212 | 213 | /* ========================================================================== 214 | Embedded content 215 | ========================================================================== */ 216 | 217 | /** 218 | * Remove border when inside `a` element in IE 8/9. 219 | */ 220 | 221 | img { 222 | border: 0; 223 | } 224 | 225 | /** 226 | * Correct overflow displayed oddly in IE 9. 227 | */ 228 | 229 | svg:not(:root) { 230 | overflow: hidden; 231 | } 232 | 233 | /* ========================================================================== 234 | Figures 235 | ========================================================================== */ 236 | 237 | /** 238 | * Address margin not present in IE 8/9 and Safari 5. 239 | */ 240 | 241 | figure { 242 | margin: 0; 243 | } 244 | 245 | /* ========================================================================== 246 | Forms 247 | ========================================================================== */ 248 | 249 | /** 250 | * Define consistent border, margin, and padding. 251 | */ 252 | 253 | fieldset { 254 | border: 1px solid #c0c0c0; 255 | margin: 0 2px; 256 | padding: 0.35em 0.625em 0.75em; 257 | } 258 | 259 | /** 260 | * 1. Correct `color` not being inherited in IE 8/9. 261 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 262 | */ 263 | 264 | legend { 265 | border: 0; /* 1 */ 266 | padding: 0; /* 2 */ 267 | } 268 | 269 | /** 270 | * 1. Correct font family not being inherited in all browsers. 271 | * 2. Correct font size not being inherited in all browsers. 272 | * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. 273 | */ 274 | 275 | button, 276 | input, 277 | select, 278 | textarea { 279 | font-family: inherit; /* 1 */ 280 | font-size: 100%; /* 2 */ 281 | margin: 0; /* 3 */ 282 | } 283 | 284 | /** 285 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 286 | * the UA stylesheet. 287 | */ 288 | 289 | button, 290 | input { 291 | line-height: normal; 292 | } 293 | 294 | /** 295 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 296 | * All other form control elements do not inherit `text-transform` values. 297 | * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. 298 | * Correct `select` style inheritance in Firefox 4+ and Opera. 299 | */ 300 | 301 | button, 302 | select { 303 | text-transform: none; 304 | } 305 | 306 | /** 307 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 308 | * and `video` controls. 309 | * 2. Correct inability to style clickable `input` types in iOS. 310 | * 3. Improve usability and consistency of cursor style between image-type 311 | * `input` and others. 312 | */ 313 | 314 | button, 315 | html input[type="button"], /* 1 */ 316 | input[type="reset"], 317 | input[type="submit"] { 318 | -webkit-appearance: button; /* 2 */ 319 | cursor: pointer; /* 3 */ 320 | } 321 | 322 | /** 323 | * Re-set default cursor for disabled elements. 324 | */ 325 | 326 | button[disabled], 327 | html input[disabled] { 328 | cursor: default; 329 | } 330 | 331 | /** 332 | * 1. Address box sizing set to `content-box` in IE 8/9. 333 | * 2. Remove excess padding in IE 8/9. 334 | */ 335 | 336 | input[type="checkbox"], 337 | input[type="radio"] { 338 | box-sizing: border-box; /* 1 */ 339 | padding: 0; /* 2 */ 340 | } 341 | 342 | /** 343 | * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. 344 | * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome 345 | * (include `-moz` to future-proof). 346 | */ 347 | 348 | input[type="search"] { 349 | -webkit-appearance: textfield; /* 1 */ 350 | -moz-box-sizing: content-box; 351 | -webkit-box-sizing: content-box; /* 2 */ 352 | box-sizing: content-box; 353 | } 354 | 355 | /** 356 | * Remove inner padding and search cancel button in Safari 5 and Chrome 357 | * on OS X. 358 | */ 359 | 360 | input[type="search"]::-webkit-search-cancel-button, 361 | input[type="search"]::-webkit-search-decoration { 362 | -webkit-appearance: none; 363 | } 364 | 365 | /** 366 | * Remove inner padding and border in Firefox 4+. 367 | */ 368 | 369 | button::-moz-focus-inner, 370 | input::-moz-focus-inner { 371 | border: 0; 372 | padding: 0; 373 | } 374 | 375 | /** 376 | * 1. Remove default vertical scrollbar in IE 8/9. 377 | * 2. Improve readability and alignment in all browsers. 378 | */ 379 | 380 | textarea { 381 | overflow: auto; /* 1 */ 382 | vertical-align: top; /* 2 */ 383 | } 384 | 385 | /* ========================================================================== 386 | Tables 387 | ========================================================================== */ 388 | 389 | /** 390 | * Remove most spacing between table cells. 391 | */ 392 | 393 | table { 394 | border-collapse: collapse; 395 | border-spacing: 0; 396 | } 397 | -------------------------------------------------------------------------------- /public/site/assets/img/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bstrahija/l4-site-tutorial/15f34895815acf6a15d4a23009840327574c6ad3/public/site/assets/img/bg.png -------------------------------------------------------------------------------- /public/site/assets/img/l.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bstrahija/l4-site-tutorial/15f34895815acf6a15d4a23009840327574c6ad3/public/site/assets/img/l.gif -------------------------------------------------------------------------------- /public/site/assets/js/script.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | console.log("Init..."); 3 | }); 4 | -------------------------------------------------------------------------------- /public/site/routes.php: -------------------------------------------------------------------------------- 1 | 'home', function() 5 | { 6 | return View::make('site::index')->with('entry', Page::where('slug', 'welcome')->first()); 7 | })); 8 | 9 | // Article list 10 | Route::get('blog', array('as' => 'article.list', function() 11 | { 12 | return View::make('site::articles')->with('entries', Article::orderBy('created_at', 'desc')->get()); 13 | })); 14 | 15 | // Single article 16 | Route::get('blog/{slug}', array('as' => 'article', function($slug) 17 | { 18 | $article = Article::where('slug', $slug)->first(); 19 | 20 | if ( ! $article) App::abort(404, 'Article not found'); 21 | 22 | return View::make('site::article')->with('entry', $article); 23 | })); 24 | 25 | // Single page 26 | Route::get('{slug}', array('as' => 'page', function($slug) 27 | { 28 | $page = Page::where('slug', $slug)->first(); 29 | 30 | if ( ! $page) App::abort(404, 'Page not found'); 31 | 32 | return View::make('site::page')->with('entry', $page); 33 | 34 | }))->where('slug', '^((?!admin).)*$'); 35 | 36 | // 404 Page 37 | App::missing(function($exception) 38 | { 39 | return Response::view('site::404', array(), 404); 40 | }); 41 | 42 | 43 | -------------------------------------------------------------------------------- /public/site/views/404.blade.php: -------------------------------------------------------------------------------- 1 | @include('site::_partials/header') 2 | 3 |
    4 |

    404 Error

    5 |

    The requested page was not found.

    6 |
    7 | 8 | @include('site::_partials/footer') 9 | -------------------------------------------------------------------------------- /public/site/views/_partials/footer.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 5 |
    6 | 7 | 8 | -------------------------------------------------------------------------------- /public/site/views/_partials/header.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Laravel 4 Tutorial 6 | 7 | 8 | 9 |
    10 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/site/views/_partials/navigation.blade.php: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /public/site/views/article.blade.php: -------------------------------------------------------------------------------- 1 | @include('site::_partials/header') 2 | 3 |
    4 |

    {{ $entry->title }}

    5 |
    Published at {{ $entry->created_at }} • by {{ $entry->author->email }}
    6 | {{ $entry->body }} 7 | 8 |
    9 | 10 | @if ($entry->image) 11 |
    12 |
    13 | @endif 14 | 15 | « Back to articles 16 |
    17 | 18 | @include('site::_partials/footer') 19 | -------------------------------------------------------------------------------- /public/site/views/articles.blade.php: -------------------------------------------------------------------------------- 1 | @include('site::_partials/header') 2 | 3 |

    Articles

    4 | 5 |
    6 | 7 | 23 | 24 | @include('site::_partials/footer') 25 | -------------------------------------------------------------------------------- /public/site/views/index.blade.php: -------------------------------------------------------------------------------- 1 | @include('site::_partials/header') 2 | 3 |
    4 |

    {{ $entry->title }}

    5 | {{ $entry->body }} 6 |
    7 | 8 | @include('site::_partials/footer') 9 | -------------------------------------------------------------------------------- /public/site/views/page.blade.php: -------------------------------------------------------------------------------- 1 | @include('site::_partials/header') 2 | 3 |
    4 |

    {{ $entry->title }}

    5 | {{ $entry->body }} 6 |
    7 | 8 | @include('site::_partials/footer') 9 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## Laravel 4 tutorial site 2 | 3 | [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/bstrahija/l4-site-tutorial/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 4 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 |