Skip to content

Commit

Permalink
Merge branch 'release/5.2.0'
Browse files Browse the repository at this point in the history
* release/5.2.0: (80 commits)
  compiled assets
  translation cleanup
  Apply fixes from StyleCI (#623)
  cleanup and refactor
  updated the changelog
  Apply fixes from StyleCI (#622)
  fixes #595
  refactored the media controller ambiguity
  updated the docs
  updated docs
  refactored translations
  work
  Apply fixes from StyleCI (#621)
  payload reduction and accuracy on stats pages
  work
  Apply fixes from StyleCI (#620)
  work
  Apply fixes from StyleCI (#618)
  wip
  page cleanup
  ...
  • Loading branch information
austintoddj committed Feb 9, 2020
2 parents 4aeaa2e + 9f5db79 commit 3f2b7aa
Show file tree
Hide file tree
Showing 213 changed files with 5,180 additions and 5,855 deletions.
73 changes: 63 additions & 10 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ From your Laravel app, create the authentication system and run the following co
composer require laravel/ui

php artisan ui vue --auth
php artisan:migrate
php artisan migrate
```

### Directories
Expand All @@ -84,16 +84,27 @@ php artisan storage:link
php artisan canvas:setup
```

The view stats are a core component to the project, so it's best to have a large dataset in place when developing. Assuming you passed the `--data` option during the setup process above, you'll already have posts populating the database. In which case, you can add the following snippets to your Laravel app:
Statistics are a core component to the app, so it's best to have a large dataset in place when developing. To generate some, add the following snippets to your Laravel app:

In the `run()` method of the `DatabaseSeeder`:

```php
// In the `run()` method of the `DatabaseSeeder`
$this->call(CanvasViewsTableSeeder::class);
$this->call(CanvasTrackingDataSeeder::class);
```

Create a new class named `CanvasTrackingDataSeeder` and add this to the `run()` method:

```php
\Illuminate\Support\Facades\DB::table('canvas_views')->truncate();
\Illuminate\Support\Facades\DB::table('canvas_visits')->truncate();

// Create a new class named `CanvasViewsTableSeeder` and add this to the `run()` method:
factory(\Canvas\View::class, 2500)->create();
factory(\Canvas\Visit::class, 2500)->create();
```

Create a new factory named `ViewFactory` and add this definition:

// Create a new factory named `ViewFactory` and add this definition:
```php
$factory->define(\Canvas\View::class, function (\Faker\Generator $faker) {
$referers = collect([
'https://google.com',
Expand All @@ -108,18 +119,60 @@ $factory->define(\Canvas\View::class, function (\Faker\Generator $faker) {
'https://dev.to',
'https://www.sitepoint.com',
]);


$user_agents = collect([
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.2 Safari/605.1.15',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',

]);

$timestamp = today()->subDays(rand(0, 60))->toDateTimeString();

return [
'post_id' => \Canvas\Post::all()->pluck('id')->random(),
'ip' => $faker->ipv4,
'agent' => $user_agents->random(),
'referer' => $referers->random(),
'created_at' => $timestamp,
'updated_at' => $timestamp,
];
});
```

Create a new factory named `VisitFactory` and add this definition:

```php
$factory->define(\Canvas\Visit::class, function (\Faker\Generator $faker) {
$referers = collect([
'https://google.com',
'https://twitter.com',
'https://facebook.com',
'https://medium.com',
'https://laravel-news.com',
'https://reddit.com',
'https://wordpress.com',
'https://news.ycombinator.com',
'https://hackernoon.com',
'https://dev.to',
'https://www.sitepoint.com',
]);

$user_agents = collect([
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
'Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.2 Safari/605.1.15',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',

]);
$timestamp = today()->subDays(rand(0, 30))->toDateTimeString();

$timestamp = today()->subDays(rand(0, 60))->toDateTimeString();

return [
'post_id' => \Canvas\Post::all()->pluck('id')->random(),
'ip' => $faker->ipv4,
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ yarn-error.log
Thumbs.db
.DS_Store
.phpunit.result.cache
*.code-workspace
19 changes: 19 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

## [Unreleased](https://github.com/cnvs/canvas/compare/master...develop)

## [5.2.0](https://github.com/cnvs/canvas/compare/v5.1.1...v5.2.0) (February 9, 2020)

### Fixed
- Fixed the translations based on locale ([#595](https://github.com/cnvs/canvas/issues/595), [01ec767](https://github.com/cnvs/canvas/commit/01ec767e9cdc9faedc7395f517aa2898d1342385))
- Fixed a parse error for canonical URLs ([#610](https://github.com/cnvs/canvas/issues/610), [f706204](https://github.com/cnvs/canvas/commit/f706204d21414d10277360900519e69de80b9236))

### Changed
- Removed the `og_*` and `twitter_*` tags from SEO meta
- Cleanup and refactor of all language files
- Comprehensive refactor of the image/featured image modals to utilize [FilePond](https://pqina.nl/filepond) and [vue-infinite-loading](https://peachscript.github.io/vue-infinite-loading)
- Updated the modal animations ([66bb4ac](https://github.com/cnvs/canvas/commit/66bb4ac83bffb33346cc6cc127a062b01da9c5c2))
- UI/UX improvements

### Added
- Added support for Visitor tracking
- Added a mini Publish button for mobile devices ([c0f73e9](https://github.com/cnvs/canvas/commit/c0f73e9dd2e62951aaa29316fe1d3586b1bbac35))
- Added infinite loading to Unsplash image searches
- Enhancements to link/video embedding in the editor

## [5.1.1](https://github.com/cnvs/canvas/compare/v5.0.0...v5.1.1) (January 22, 2020)

## Fixed
Expand Down
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,34 @@
"watch-poll": "npm run watch -- --watch-poll"
},
"dependencies": {
"autosize": "^4.0.2",
"axios": "^0.19.0",
"bootstrap": "^4.4.0",
"chart.js": "^2.9.3",
"cross-env": "^6.0",
"filepond": "^4.9.5",
"filepond-plugin-file-validate-size": "^2.2.0",
"filepond-plugin-file-validate-type": "^1.2.4",
"filepond-plugin-image-exif-orientation": "^1.0.6",
"filepond-plugin-image-preview": "^4.6.0",
"filepond-plugin-image-validate-size": "^1.2.3",
"jquery": "^3.4",
"laravel-mix": "^5.0",
"lodash": "^4.17.5",
"md5": "^2.2.1",
"moment": "^2.24.0",
"moment-timezone": "^0.5.27",
"nprogress": "^0.2.0",
"numeral": "^2.0.6",
"parchment": "^1.1.4",
"popper.js": "^1.16",
"quill": "1.3.7",
"resolve-url-loader": "^3.1.0",
"sass": "^1.24",
"sass-loader": "^8.0.0",
"unsplash-js": "^6.0.0",
"url-parse": "^1.4.7",
"vue": "^2.6.10",
"vue-filepond": "^6.0.2",
"vue-infinite-loading": "^2.4.4",
"vue-multiselect": "^2.1.6",
"vue-router": "^3.1.3",
Expand Down
4 changes: 2 additions & 2 deletions public/css/app-dark.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/css/app.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/js/app.js

Large diffs are not rendered by default.

167 changes: 167 additions & 0 deletions public/js/app.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
* @license MIT */

/*!
* Bootstrap v4.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/

/*!
* Chart.js v2.9.3
* https://www.chartjs.org
* (c) 2019 Chart.js Contributors
* Released under the MIT License
*/

/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/*!
* FilePond 4.10.0
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginFileValidateSize 2.2.0
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginFileValidateType 1.2.4
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginImageExifOrientation 1.0.6
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginImagePreview 4.6.1
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* FilePondPluginImageValidateSize 1.2.3
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/

/*!
* Quill Editor v1.3.7
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com
*/

/*!
* Sizzle CSS Selector Engine v2.3.4
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2019-04-08
*/

/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/

/*!
* Vue.js v2.6.11
* (c) 2014-2019 Evan You
* Released under the MIT License.
*/

/*!
* jQuery JavaScript Library v3.4.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2019-05-01T21:04Z
*/

/*!
* vue-filepond v6.0.2
* A handy FilePond adapter component for Vue
*
* Copyright (c) 2020 PQINA
* https://pqina.nl/filepond
*
* Licensed under the MIT license.
*/

/*!
* vue-infinite-loading v2.4.4
* (c) 2016-2019 PeachScript
* MIT License
*/

/*! @preserve
* numeral.js
* version : 2.0.6
* author : Adam Draper
* license : MIT
* http://adamwdraper.github.com/Numeral-js/
*/

/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/

/**
* vuex v3.1.2
* (c) 2019 Evan You
* @license MIT
*/

/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.16.1
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
6 changes: 3 additions & 3 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"/js/app.js": "/js/app.js?id=b28db4de031ebf48e43f",
"/css/app.css": "/css/app.css?id=7bfe6febf22d3f046297",
"/css/app-dark.css": "/css/app-dark.css?id=2f8397d54987fda32df0",
"/js/app.js": "/js/app.js?id=de244d2c1fa790a16043",
"/css/app.css": "/css/app.css?id=1b72078c7d5efcba44ea",
"/css/app-dark.css": "/css/app-dark.css?id=c00d27458093a6dbec9d",
"/favicon.ico": "/favicon.ico?id=b3aec2f33a001156e320"
}
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Canvas exposes a simple UI at `/canvas` by default. This can be changed by updat
|
| This is the storage disk Canvas will use to put file uploads. You may
| use any of the disks defined in the config/filesystems.php file and
| you may also change the maximum upload size from its 3MB default.
| you may also change the maximum upload size from its 3MB default.
|
*/

Expand Down Expand Up @@ -122,7 +122,7 @@ Route::get('tag/{slug}', 'BlogController@getPostsByTag');
Route::get('topic/{slug}', 'BlogController@getPostsByTopic');

// Find a single post
Route::middleware('Canvas\Http\Middleware\ViewThrottle')->get('{slug}', 'BlogController@findPostBySlug');
Route::middleware('Canvas\Http\Middleware\Session')->get('{slug}', 'BlogController@findPostBySlug');
```

Add the corresponding methods inside of a new `BlogController`:
Expand Down Expand Up @@ -185,7 +185,7 @@ public function findPostBySlug(string $slug)
'meta' => $post->meta,
];

// IMPORTANT: You must include this event for Canvas to store view data
// IMPORTANT: This event must be called for tracking visitor/view traffic
event(new \Canvas\Events\PostViewed($post));

return view('blog.show', compact('data'));
Expand Down
Loading

0 comments on commit 3f2b7aa

Please sign in to comment.