Skip to content

Commit

Permalink
Merge branch 'release/4.2.2'
Browse files Browse the repository at this point in the history
* release/4.2.2:
  updates the changelog
  compiled assets
  updates the changelog
  improve translations
  fix some es translations
  updates the changelog
  updates the font displays
  updated the font displays
  bumped axios version to patch security vulnerability axios/axios#2183
  Apply fixes from StyleCI (#493)
  updates the command output
  applied fixes from phpinsights
  small language improvements
  Update stats.php
  added phpinsights as a dev dependency
  • Loading branch information
austintoddj committed Jun 1, 2019
2 parents e9c7dfa + 83d72db commit c2fb624
Show file tree
Hide file tree
Showing 24 changed files with 164 additions and 120 deletions.
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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

## [4.2.2](https://github.com/cnvs/canvas/compare/v4.2.1...v4.2.2)

## Changed
- Updated the German translations ([89e5f76](https://github.com/cnvs/canvas/commit/89e5f76f8f53c4337fd468e5b8e2b78830a25281), [c77fa7a](https://github.com/cnvs/canvas/commit/c77fa7ad9c84a85fc777fe985d99ccef99528de2))
- Updated the Spanish translations ([#495](https://github.com/cnvs/canvas/pull/495), [f7ab6c2](https://github.com/cnvs/canvas/commit/f7ab6c2bb2f911131442eba80d100f9822e2ccef), [54ecb39](https://github.com/cnvs/canvas/commit/54ecb39b99e77efb71e11be01f3401de70a8639a))
- Minor updates from PHP Insights ([7a297c2](https://github.com/cnvs/canvas/commit/7a297c284f5fc68f9cda9b8a208d3b184db9d010))
- Refactored the command output lines ([7466c19](https://github.com/cnvs/canvas/commit/7466c19ed2bd7b65852e007140fc2d0ecd5b4bf0))
- Reverted the font display options ([b9326c1](https://github.com/cnvs/canvas/commit/b9326c1f36882e06c24673b13bcb485062126726))

## Fixed
- Bumped Axios version to patch a security vulnerability ([4a2140f](https://github.com/cnvs/canvas/commit/4a2140f723e987c9408d091650a54f5225319357))

## [4.2.1](https://github.com/cnvs/canvas/compare/v4.2.0...v4.2.1)

## Changed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.8",
"autosize": "^4.0.2",
"axios": "^0.18",
"axios": "^0.19",
"bootstrap": "^4.3.1",
"cross-env": "^5.1",
"jquery": "^3.4",
Expand Down
2 changes: 1 addition & 1 deletion public/css/app-dark.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/css/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"/js/app.js": "/js/app.js?id=342571a1a82e4b65d324",
"/css/app.css": "/css/app.css?id=bafeafc7e5cd7b9f1014",
"/css/app-dark.css": "/css/app-dark.css?id=2a976d8eadd9cb34f895",
"/js/app.js.map": "/js/app.js.map?id=e165e8de620ee390255a",
"/js/app.js": "/js/app.js?id=767a911cb95bfbbd5cca",
"/css/app.css": "/css/app.css?id=eb7fb7a5d8ba4b6dd0a4",
"/css/app-dark.css": "/css/app-dark.css?id=799369a3e5ded6772726",
"/js/app.js.map": "/js/app.js.map?id=5729db3fcef3925224ce",
"/favicon.ico": "/favicon.ico?id=dbb0c05daa3432643753"
}
8 changes: 4 additions & 4 deletions resources/lang/de/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
'details' => [
'created' => 'Erstellt',
'published' => 'Veröffentlicht auf',
'views' => 'Aufrufe nach Verkehrsquelle',
'views' => 'Aufrufe nach Traffic Quelle',
'reading' => [
'header' => 'Beliebte Lesezeiten',
'time' => 'mindest',
'read' => 'lesen',
'time' => 'min',
'read' => 'Lesezeit',
],
'empty' => 'Warten Sie, bis Ihr Beitrag mehr Aufrufe enthält, um diese Einsichten anzuzeigen.',
'empty' => 'Warten Sie, bis Ihr Beitrag mehr Aufrufe enthält, um diese Sichten anzuzeigen.',
'referer' => [
'other' => 'Andere',
'unknown' => 'Post Ansichten in dieser Kategorie konnten einen Referrer nicht zuverlässig ermitteln. z.B. Inkognito-Modus',
Expand Down
12 changes: 6 additions & 6 deletions resources/lang/es/blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

'title' => 'Blog',
'buttons' => [
'learn' => 'Aprende más',
'next' => 'Lee esto siguiente',
'learn' => 'Conoce más',
'next' => 'A continuación lee',
'enjoy' => 'Usted podría disfrutar',
'edit' => 'Editar post',
'stats' => 'Ver estadísticas',
],
'empty' => [
'description' => 'No se encontraron publicaciones, comienza por',
'action' => 'añadiendo una nueva publicación',
'action' => 'añadir una nueva publicación',
],
'nav' => [
'user' => [
'posts' => 'Mensajes',
'posts' => 'Publicaciones',
'tags' => 'Etiquetas',
'topics' => 'Los temas',
'topics' => 'Temas',
'stats' => 'Estadísticas',
'login' => 'Registrarse',
'logout' => 'Desconectar',
],
],
'posts' => [
'label' => 'Mensajes recientes',
'label' => 'Publicaciones recientes',
],
'tags' => [
'label' => 'Etiquetas',
Expand Down
4 changes: 2 additions & 2 deletions resources/lang/es/nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
'success' => '¡Salvado!',
],
'user' => [
'posts' => 'Mensajes',
'posts' => 'Publicaciones',
'tags' => 'Etiquetas',
'topics' => 'Los temas',
'topics' => 'Temas',
'stats' => 'Estadísticas',
'logout' => 'Desconectar',
],
Expand Down
8 changes: 4 additions & 4 deletions resources/lang/es/posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

return [

'header' => 'Mensajes',
'header' => 'Publicaciones',
'empty' => [
'description' => 'No se encontraron publicaciones, comienza por',
'action' => 'añadiendo una nueva publicación',
Expand Down Expand Up @@ -99,8 +99,8 @@
'settings' => [
'header' => 'Configuración general',
'slug' => [
'label' => 'Babosa',
'placeholder' => 'una-babosa-única',
'label' => 'Etiqueta',
'placeholder' => 'una-etiqueta-única',
],
'summary' => [
'label' => 'Resumen',
Expand All @@ -116,7 +116,7 @@
],
'delete' => [
'header' => 'Borrar',
'warning' => 'Las publicaciones eliminadas se han ido para siempre. ¿Estás seguro?',
'warning' => 'Las publicaciones eliminadas se irán para siempre. ¿Estás seguro?',
],

];
8 changes: 4 additions & 4 deletions resources/lang/es/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
'title' => 'Vistas (30 días)',
],
'posts' => [
'title' => 'Total de mensajes',
'title' => 'Total de publicaciones',
],
'publishing' => [
'title' => 'Publicación',
'details' => [
'published' => 'Publicaciones publicadas',
'published' => 'Articulose publicados',
'drafts' => 'Borradores)',
],
],
Expand All @@ -34,10 +34,10 @@
'time' => 'min',
'read' => 'leer',
],
'empty' => 'Esperando hasta que tu publicación tenga más vistas para mostrar estas ideas.',
'empty' => 'Espera hasta que tu publicación tenga más vistas para mostrar estos datos.',
'referer' => [
'other' => 'Otro',
'unknown' => 'Las vistas de publicación en esta categoría no pudieron determinar de manera confiable una referencia. p.ej. Modo incognito',
'unknown' => 'Las vistas en esta categoría no pudieron determinar de manera confiable una referencia. p.ej. Modo incognito',
],
],

Expand Down
2 changes: 1 addition & 1 deletion resources/sass/app-dark.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Fonts
@import url("https://fonts.googleapis.com/css?family=Nunito|Merriweather:300,400,700&display=swap");
@import url("https://fonts.googleapis.com/css?family=Nunito|Merriweather:300,400,700");
@import "~@fortawesome/fontawesome-free/scss/regular";
@import "~@fortawesome/fontawesome-free/scss/solid";
@import "~@fortawesome/fontawesome-free/scss/fontawesome";
Expand Down
2 changes: 1 addition & 1 deletion resources/sass/app.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Fonts
@import url("https://fonts.googleapis.com/css?family=Nunito|Merriweather:300,400,700&display=swap");
@import url("https://fonts.googleapis.com/css?family=Nunito|Merriweather:300,400,700");
@import "~@fortawesome/fontawesome-free/scss/regular";
@import "~@fortawesome/fontawesome-free/scss/solid";
@import "~@fortawesome/fontawesome-free/scss/fontawesome";
Expand Down
4 changes: 2 additions & 2 deletions routes/canvas.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Route::get('posts', 'PostController@index')->name('canvas.post.index');
Route::get('posts/create', 'PostController@create')->name('canvas.post.create');
Route::post('posts', 'PostController@store')->name('canvas.post.store');
Route::get('posts/{id}/edit', 'PostController@edit')->name(('canvas.post.edit'));
Route::get('posts/{id}/edit', 'PostController@edit')->name('canvas.post.edit');
Route::put('posts/{id}', 'PostController@update')->name('canvas.post.update');
Route::delete('posts/{id}', 'PostController@destroy')->name('canvas.post.destroy');

Expand All @@ -21,7 +21,7 @@
Route::get('tags', 'TagController@index')->name('canvas.tag.index');
Route::get('tags/create', 'TagController@create')->name('canvas.tag.create');
Route::post('tags', 'TagController@store')->name('canvas.tag.store');
Route::get('tags/{id}/edit', 'TagController@edit')->name(('canvas.tag.edit'));
Route::get('tags/{id}/edit', 'TagController@edit')->name('canvas.tag.edit');
Route::put('tags/{id}', 'TagController@update')->name('canvas.tag.update');
Route::delete('tags/{id}', 'TagController@destroy')->name('canvas.tag.destroy');

Expand Down
5 changes: 2 additions & 3 deletions src/CanvasServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ class CanvasServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->handleConfig();
$this->handleEvents();
$this->handleRoutes();
$this->handleMigrations();
$this->handlePublishing();
$this->handleResources();
$this->handleTranslations();
$this->handleCommands();
}

/**
Expand All @@ -40,7 +38,8 @@ public function boot()
*/
public function register()
{
//
$this->handleConfig();
$this->handleCommands();
}

/**
Expand Down
7 changes: 0 additions & 7 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@ class InstallCommand extends Command
*/
public function handle()
{
$this->comment('Publishing the service provider...');
$this->callSilent('vendor:publish', ['--tag' => 'canvas-provider']);

$this->comment('Publishing the assets...');
$this->callSilent('vendor:publish', ['--tag' => 'canvas-assets']);

$this->comment('Publishing the configuration file...');
$this->callSilent('vendor:publish', ['--tag' => 'canvas-config']);

$this->comment('Running the database migrations...');
$this->callSilent('migrate');

$this->registerCanvasServiceProvider();
Expand Down
51 changes: 32 additions & 19 deletions src/Console/SetupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,10 @@ class SetupCommand extends Command
*/
public function handle()
{
$this->comment('Creating the view directories...');
$this->createDirectories();

$this->comment('Building the views...');
$this->exportViews();

$this->comment('Compiling the controller...');
file_put_contents(
app_path('Http/Controllers/BlogController.php'),
$this->compileControllerStub()
);

$this->comment('Writing the routes...');
file_put_contents(
base_path('routes/web.php'),
file_get_contents(dirname(__DIR__, 2).'/stubs/routes.stub'),
FILE_APPEND
);
$this->exportController();
$this->registerRoutes();

$this->info('Setup complete. Head over to <comment>'.url('/blog').'</comment> to get started.');
}
Expand All @@ -70,7 +56,7 @@ public function handle()
*
* @return void
*/
protected function createDirectories()
private function createDirectories()
{
if (! is_dir($directory = resource_path('views/blog/layouts'))) {
mkdir($directory, 0755, true);
Expand All @@ -86,7 +72,7 @@ protected function createDirectories()
*
* @return void
*/
protected function exportViews()
private function exportViews()
{
foreach ($this->views as $key => $value) {
if (file_exists($view = resource_path('views/blog/'.$value))) {
Expand All @@ -107,12 +93,39 @@ protected function exportViews()
*
* @return string
*/
protected function compileControllerStub()
private function compileControllerStub()
{
return str_replace(
'{{namespace}}',
$this->getAppNamespace(),
file_get_contents(dirname(__DIR__, 2).'/stubs/controllers/BlogController.stub')
);
}

/**
* Export the new controller.
*
* @return void
*/
private function exportController()
{
file_put_contents(
app_path('Http/Controllers/BlogController.php'),
$this->compileControllerStub()
);
}

/**
* Register the new routes.
*
* @return void
*/
private function registerRoutes()
{
file_put_contents(
base_path('routes/web.php'),
file_get_contents(dirname(__DIR__, 2).'/stubs/routes.stub'),
FILE_APPEND
);
}
}
11 changes: 6 additions & 5 deletions src/Http/Controllers/LangController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ class LangController extends Controller
public function __invoke(): void
{
$files = glob(dirname(__DIR__, 3).'/resources/lang/'.config('app.locale').'/*.php');
$strings = collect();
$lines = collect();

foreach ($files as $file) {
$name = basename($file, '.php');
$strings->put($name, require $file);
$filename = basename($file, '.php');
$lines->put($filename, require $file);
}

header('Content-Type: text/javascript');
echo 'window.i18n = '.json_encode($strings->toArray()).';';
exit();
echo 'window.i18n = '.json_encode($lines->toArray()).';';

die();
}
}
6 changes: 3 additions & 3 deletions src/Http/Controllers/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ private function collectTags(array $incomingTags): array
/**
* Assign a given topic.
*
* @param $incomingTopic
* @return mixed
* @param array $incomingTopic
* @return array
*/
private function assignTopic(array $incomingTopic)
private function assignTopic(array $incomingTopic): array
{
if ($incomingTopic) {
$topic = Topic::where('slug', $incomingTopic['slug'])->first();
Expand Down
2 changes: 1 addition & 1 deletion src/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Post extends Model
*
* @var array
*/
public $dates = [
protected $dates = [
'published_at',
];

Expand Down
Loading

0 comments on commit c2fb624

Please sign in to comment.