Skip to content

Commit

Permalink
Add Edit Blueprint option to term publish form (#6851)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksleight authored Oct 10, 2022
1 parent 5869ccc commit fb5e184
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resources/js/components/terms/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
</div>
</h1>

<dropdown-list class="mr-2" v-if="canEditBlueprint">
<dropdown-item :text="__('Edit Blueprint')" :redirect="actions.editBlueprint" />
</dropdown-list>

<div class="pt-px text-2xs text-grey-60 flex mr-2" v-if="readOnly">
<svg-icon name="lock" class="w-4 mr-sm -mt-sm" /> {{ __('Read Only') }}
</div>
Expand Down Expand Up @@ -277,6 +281,7 @@ export default {
initialPermalink: String,
revisionsEnabled: Boolean,
preloadedAssets: Array,
canEditBlueprint: Boolean,
createAnotherUrl: String,
listingUrl: String,
previewTargets: Array,
Expand Down
1 change: 1 addition & 0 deletions resources/views/terms/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
:initial-read-only="{{ $str::bool($readOnly) }}"
:preloaded-assets="{{ json_encode($preloadedAssets) }}"
:breadcrumbs="{{ $breadcrumbs->toJson() }}"
:can-edit-blueprint="{{ $str::bool($user->can('configure fields')) }}"
create-another-url="{{ cp_route('taxonomies.terms.create', [$taxonomy, $locale]) }}"
listing-url="{{ cp_route('taxonomies.show', $taxonomy) }}"
:preview-targets="{{ json_encode($previewTargets) }}"
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/CP/Taxonomies/TermsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public function edit(Request $request, $taxonomy, $term)
'revisions' => $term->revisionsUrl(),
'restore' => $term->restoreRevisionUrl(),
'createRevision' => $term->createRevisionUrl(),
'editBlueprint' => cp_route('taxonomies.blueprints.edit', [$taxonomy, $blueprint]),
],
'values' => array_merge($values, ['id' => $term->id()]),
'meta' => $meta,
Expand Down

0 comments on commit fb5e184

Please sign in to comment.