Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Commit

Permalink
Fixies
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarpsvo committed Oct 28, 2020
1 parent 81db241 commit f4098e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [9.2.2] - 2020-10-28

### Changed

- Fixed `NovaLangField` reference

## [9.2.1] - 2020-10-13

### Changed
Expand Down
15 changes: 9 additions & 6 deletions src/Nova/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@
use OptimistDigital\NovaBlog\Nova\Fields\Slug;
use OptimistDigital\NovaBlog\Nova\Fields\Title;
use OptimistDigital\NovaBlog\NovaBlog;
use OptimistDigital\NovaLang\NovaLangField\NovaLangField;
use OptimistDigital\NovaLocaleField\LocaleField;
use Whitecube\NovaFlexibleContent\Flexible;
use Laravel\Nova\Fields\Trix;
use Froala\NovaFroalaField\Froala;
use OptimistDigital\MultiselectField\Multiselect;
use OptimistDigital\NovaBlog\Models\RelatedPost;
use OptimistDigital\NovaLocaleField\LocaleField;

class Post extends TemplateResource
{
Expand Down Expand Up @@ -103,16 +107,16 @@ public function fields(Request $request)
$postContent,
config('nova-blog.include_related_posts_feature') === true ?
Multiselect
::make('Related posts', 'related_posts')
->options($relatedPostOptions)
->withMeta(['value' => $relatedPosts])
::make('Related posts', 'related_posts')
->options($relatedPostOptions)
->withMeta(['value' => $relatedPosts])
: null,


];

if (NovaBlog::hasNovaLang()) {
$fields[] = \OptimistDigital\NovaLang\NovaLangField\NovaLangField::make('Locale', 'locale', 'locale_parent_id')->onlyOnForms();
$fields[] = \OptimistDigital\NovaLang\NovaLangField::make('Locale', 'locale', 'locale_parent_id')->onlyOnForms();
} else {
$fields[] = LocaleField::make('Locale', 'locale', 'locale_parent_id')
->locales($locales)
Expand All @@ -124,7 +128,6 @@ public function fields(Request $request)
->locales($locales)
->exceptOnForms()
->maxLocalesOnIndex(3);

} else if ($hasManyDifferentLocales) {
$fields[] = Text::make('Locale', 'locale')->exceptOnForms();
}
Expand Down

0 comments on commit f4098e9

Please sign in to comment.