Skip to content

Commit

Permalink
Offer template options only on public collections
Browse files Browse the repository at this point in the history
  • Loading branch information
robdekort committed Nov 11, 2021
1 parent 5278fa7 commit 59f39f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions dev/CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@
### What's improved
- Set `link_noopener: true` on common bard fields. 91020e3d by @robdekort
- Offer mount option for non public collections in `peak:add-collection`. 13cf5055 by @robdekort
- Offer template options only on public collections in `peak:add-collection`. 5594e364 by @robdekort

## v3.32.0 (2021-11-10)

Expand Down
10 changes: 7 additions & 3 deletions dev/app/Console/Commands/AddCollection.php
Expand Up @@ -157,7 +157,6 @@ public function handle()
if ($this->add_page) {
$this->page_title = $this->ask('What should be the page title for this mount?');
$this->mount = $this->addPage();
$this->setIndexTemplate($this->mount);
} else {
$choice = $this->choice('On which page existing page do you want to mount this collection?', $this->getPages());
preg_match('/\[(.*?)\]/', $choice, $id);
Expand All @@ -175,8 +174,13 @@ public function handle()
$this->date_past = $this->ask('What should be the date behavior for entries in the past?', 'public');
$this->date_future = $this->ask('What should be the date behavior for entries in the future?', 'private');
}
$this->index = ($this->confirm('Generate and apply index template?', true)) ? true : false;
$this->show = ($this->confirm('Generate and apply show template?', true)) ? true : false;
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;

try {
Expand Down

0 comments on commit 59f39f1

Please sign in to comment.