Skip to content

Commit

Permalink
Fix bug in add command
Browse files Browse the repository at this point in the history
  • Loading branch information
robdekort committed Nov 11, 2021
1 parent b246880 commit 0a6545d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions dev/app/Console/Commands/AddCollection.php
Expand Up @@ -50,7 +50,7 @@ class AddCollection extends Command
*
* @var bool
*/
protected $public = true;
protected $public = false;

/**
* The collection route.
Expand All @@ -64,7 +64,7 @@ class AddCollection extends Command
*
* @var bool
*/
protected $add_page = true;
protected $add_page = false;

/**
* The page title.
Expand Down Expand Up @@ -134,7 +134,14 @@ class AddCollection extends Command
*
* @var bool
*/
protected $index = true;
protected $index = false;

/**
* Show template.
*
* @var bool
*/
protected $show = false;

/**
* Grant permissions.
Expand All @@ -161,7 +168,6 @@ public function handle()
$choice = $this->choice('On which page existing page do you want to mount this collection?', $this->getPages());
preg_match('/\[(.*?)\]/', $choice, $id);
$this->mount = $id[1];
$this->setIndexTemplate($id[1]);
}
if ($this->public) {
$this->route = $this->ask('What should be the route for this collection?', '/{mount}/{slug}');
Expand All @@ -176,9 +182,6 @@ public function handle()
}
if ($this->public) {
$this->index = ($this->confirm('Generate and apply index template?', true)) ? true : false;
if ($this->index) {
$this->setIndexTemplate($this->mount);
}
$this->show = ($this->confirm('Generate and apply show template?', true)) ? true : false;
}
$this->permissions = ($this->confirm('Grant edit permissions to editor role?', true)) ? true : false;
Expand Down

0 comments on commit 0a6545d

Please sign in to comment.