diff --git a/.gitignore b/.gitignore index 188291eb8..a01bdcf71 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,6 @@ Homestead.yaml .idea /public/plugins /public/css +/public/js/all* /public/bower /storage/images \ No newline at end of file diff --git a/app/Http/routes.php b/app/Http/routes.php index 3065f7eb5..0b723b98a 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -78,7 +78,10 @@ Route::group(['middleware' => 'auth'], function() { Route::get('/pages/search/all', 'PageController@searchAll'); Route::get('/', function () { - return view('base'); + return view('home'); + }); + Route::get('/home', function () { + return view('home'); }); diff --git a/config/app.php b/config/app.php index 690d5fb96..4667c23f3 100644 --- a/config/app.php +++ b/config/app.php @@ -78,7 +78,7 @@ return [ | */ - 'key' => env('APP_KEY', 'SomeRandomString'), + 'key' => env('APP_KEY', 'AbAZchsay4uBTU33RubBzLKw203yqSqr'), 'cipher' => 'AES-256-CBC', diff --git a/gulpfile.js b/gulpfile.js index f5d59ff8e..654f78d51 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,4 @@ var elixir = require('laravel-elixir'); -//require('laravel-elixir-livereload'); /* |-------------------------------------------------------------------------- @@ -13,5 +12,6 @@ var elixir = require('laravel-elixir'); */ elixir(function(mix) { - mix.sass('styles.scss');//.livereload(); + mix.sass('styles.scss'); + mix.babel('image-manager.js'); }); diff --git a/resources/assets/js/image-manager.js b/resources/assets/js/image-manager.js new file mode 100644 index 000000000..0bece9894 --- /dev/null +++ b/resources/assets/js/image-manager.js @@ -0,0 +1,63 @@ + +class ImageList extends React.Component { + + constructor(props) { + super(props); + this.state = { + images: [], + hasMore: false, + page: 0 + }; + } + + componentDidMount() { + $.getJSON('/images/all', data => { + this.setState({ + images: data.images, + hasMore: data.hasMore + }); + }); + } + + loadMore() { + this.state.page++; + $.getJSON('/images/all/' + this.state.page, data => { + this.setState({ + images: this.state.images.concat(data.images), + hasMore: data.hasMore + }); + }); + } + + render() { + var images = this.state.images.map(function(image) { + return ( +