-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
363 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6.0 | ||
6.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
|
||
class UpdateLinks extends Command | ||
{ | ||
|
||
protected $signature = 'update:links'; | ||
|
||
protected $description = 'Remove old URLs from blocks'; | ||
|
||
public function handle() | ||
{ | ||
|
||
foreach( config('app.scrub_domains') as $url ) { | ||
$blocks = \A17\Twill\Models\Block::whereRaw("content::text LIKE '%" . $url . "%'"); | ||
|
||
$blocks = $blocks->cursor(); | ||
|
||
foreach( $blocks as $block ) { | ||
$content = $block->getOriginal('content'); | ||
$content = str_replace("http:\/\/" . $url, '', $content); | ||
$content = str_replace("https:\/\/" . $url, '', $content); | ||
$content = str_replace('"' . $url, '"', $content); | ||
$block->content = $block->fromJson( $content ); // $casts as array | ||
$block->save(); | ||
$this->info('Updated ' . $url . ' in ' . $block->blockable_type . ', #' . $block->blockable_id); | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Admin; | ||
|
||
use A17\Twill\Http\Controllers\Admin\ModuleController; | ||
use App\Repositories\IssueRepository; | ||
|
||
class IssueArticleController extends ModuleController | ||
{ | ||
protected $moduleName = 'issues.articles'; | ||
protected $modelName = 'IssueArticle'; | ||
|
||
protected function getParentModuleForeignKey() | ||
{ | ||
return 'issue_id'; | ||
} | ||
|
||
protected $indexColumns = [ | ||
'image' => [ | ||
'title' => 'Hero', | ||
'thumb' => true, | ||
'variant' => [ | ||
'role' => 'hero', | ||
'crop' => 'default', | ||
], | ||
], | ||
'title' => [ | ||
'title' => 'Title', | ||
'edit_link' => true, | ||
'sort' => true, | ||
'field' => 'title', | ||
], | ||
'date' => [ | ||
'title' => 'Date', | ||
'edit_link' => true, | ||
'sort' => true, | ||
'field' => 'date', | ||
'present' => true, | ||
], | ||
'issue_number' => [ | ||
'title' => 'Issue No.', | ||
'edit_link' => true, | ||
'sort' => true, | ||
'field' => 'issueNumber', | ||
'present' => true, | ||
], | ||
]; | ||
|
||
protected $defaultOrders = ['position' => 'asc']; | ||
|
||
protected function indexData($request) | ||
{ | ||
$issue = app(IssueRepository::class)->getById(request('issue')); | ||
return [ | ||
'breadcrumb' => [ | ||
[ | ||
'label' => 'Issues', | ||
'url' => moduleRoute('issues', 'collection', 'index'), | ||
], | ||
[ | ||
'label' => $issue->title, | ||
'url' => moduleRoute('issues', 'collection', 'edit', $issue->id), | ||
], | ||
[ | ||
'label' => 'Articles', | ||
], | ||
|
||
], | ||
]; | ||
} | ||
|
||
protected function formData($request) | ||
{ | ||
$issue = app(IssueRepository::class)->getById(request('issue')); | ||
return [ | ||
'breadcrumb' => [ | ||
[ | ||
'label' => 'Issues', | ||
'url' => moduleRoute('issues', 'collection', 'index'), | ||
], | ||
[ | ||
'label' => $issue->title, | ||
'url' => moduleRoute('issues', 'collection', 'edit', $issue->id), | ||
], | ||
[ | ||
'label' => 'Articles', | ||
'url' => moduleRoute('issues.articles', 'collection', 'index', $request->route('issue')), | ||
], | ||
[ | ||
'label' => $issue->title, | ||
], | ||
], | ||
]; | ||
} | ||
|
||
protected function getPermalinkBaseUrl() | ||
{ | ||
$issue = app(IssueRepository::class)->getById(request('issue')); | ||
return request()->getScheme() . '://' . config('app.url') . '/journal/issue/' . $issue->id . '/' . $issue->getSlug() . '/'; | ||
} | ||
/* | ||
protected function formData($request) | ||
{ | ||
$item = $this->repository->getById(request('article') ?? request('id')); | ||
$baseUrl = '//' . config('app.url') . '/' .$this->permalinkBase . $item->present()->issue_number . '/'; | ||
$baseUrl .= $item->issue ? $item->issue->getSlug() : ''; | ||
$baseUrl .= '/' . $item->id . '/'; | ||
return [ | ||
'baseUrl' => $baseUrl, | ||
]; | ||
} | ||
*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace App\Models\Revisions; | ||
|
||
use A17\Twill\Models\Revision; | ||
|
||
class IssueArticleRevision extends Revision | ||
{ | ||
protected $table = "issue_article_revisions"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace App\Models\Revisions; | ||
|
||
use A17\Twill\Models\Revision; | ||
|
||
class IssueRevision extends Revision | ||
{ | ||
protected $table = "issue_revisions"; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.