-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
1 parent
d57f964
commit 1f0acc6
Showing
10 changed files
with
107 additions
and
166 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
File renamed without changes.
File renamed without changes.
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,49 @@ | ||
<template> | ||
<div> | ||
<header class="mb-6"> | ||
<div class="flex items-center"> | ||
<h1 class="flex-1" v-text="__(title)" /> | ||
|
||
<div> | ||
<a v-if="canCreate" class="btn-primary" :href="createUrl" v-text="createLabel" /> | ||
</div> | ||
</div> | ||
</header> | ||
|
||
<runway-listing | ||
:resource="handle" | ||
:initial-sort-column="sortColumn" | ||
:initial-sort-direction="sortDirection" | ||
:initial-columns="columns" | ||
:filters="filters" | ||
:action-url="actionUrl" | ||
:primary-column="primaryColumn" | ||
:has-publish-states="hasPublishStates" | ||
></runway-listing> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import RunwayListing from './Listing.vue' | ||
export default { | ||
components: { | ||
RunwayListing, | ||
}, | ||
props: { | ||
title: { type: String, required: true }, | ||
handle: { type: String, required: true }, | ||
canCreate: { type: Boolean, required: true }, | ||
createUrl: { type: String, required: true }, | ||
createLabel: { type: String, required: true }, | ||
sortColumn: { type: String, required: true }, | ||
sortDirection: { type: String, required: true }, | ||
columns: { type: Array, required: true }, | ||
filters: { type: Array, required: true }, | ||
actionUrl: { type: String, required: true }, | ||
primaryColumn: { type: String, required: true}, | ||
hasPublishStates: { type: Boolean, required: true }, | ||
}, | ||
} | ||
</script> |
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,7 +1,5 @@ | ||
import PublishForm from './components/Publish/PublishForm.vue' | ||
import RunwayListing from './components/Listing/RunwayListing.vue' | ||
import HasManyFieldtypeIndex from '../../vendor/statamic/cms/resources/js/components/fieldtypes/relationship/RelationshipIndexFieldtype.vue' | ||
import PublishForm from './components/resources/PublishForm.vue' | ||
import ResourceView from './components/resources/View.vue' | ||
|
||
Statamic.$components.register('runway-publish-form', PublishForm) | ||
Statamic.$components.register('runway-listing', RunwayListing) | ||
Statamic.$components.register('has_many-fieldtype-index', HasManyFieldtypeIndex) | ||
Statamic.$components.register('resource-view', ResourceView) |
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,36 +1,22 @@ | ||
@inject('str', 'Statamic\Support\Str') | ||
@extends('statamic::layout') | ||
@section('title', $title) | ||
@section('title', $resource->name()) | ||
@section('wrapper_class', 'max-w-full') | ||
|
||
@section('content') | ||
<div class="flex items-center justify-between mb-6"> | ||
<h1 class="flex-1">{{ $title }}</h1> | ||
|
||
@can('configure fields') | ||
<dropdown-list @if($canCreate) class="mr-2" @endif> | ||
<dropdown-item :text="__('Edit Blueprint')" redirect="{{ cp_route('blueprints.edit', ['namespace' => 'runway', 'handle' => $resource->handle()]) }}"></dropdown-item> | ||
</dropdown-list> | ||
@endcan | ||
|
||
@if($canCreate) | ||
<a | ||
class="btn-primary" | ||
href="{{ cp_route('runway.create', ['resource' => $resource->handle()]) }}" | ||
> | ||
{{ __('Create :resource', [ | ||
'resource' => $resource->singular() | ||
]) }} | ||
</a> | ||
@endif | ||
</div> | ||
|
||
<runway-listing | ||
<resource-view | ||
title="{{ $resource->name() }}" | ||
handle="{{ $resource->handle() }}" | ||
:can-create="{{ Statamic\Support\Str::bool($canCreate) }}" | ||
create-url="{{ $createUrl }}" | ||
create-label="{{ $createLabel }}" | ||
sort-column="{{ $resource->orderBy() }}" | ||
sort-direction="{{ $resource->orderByDirection() }}" | ||
:columns="{{ $columns->toJson() }}" | ||
:filters="{{ $filters->toJson() }}" | ||
:listing-config='@json($listingConfig)' | ||
:initial-columns='@json($columns)' | ||
action-url="{{ $actionUrl }}" | ||
initial-primary-column="{{ $primaryColumn }}" | ||
:has-publish-states="{{ $str::bool($hasPublishStates) }}" | ||
></runway-listing> | ||
primary-column="{{ $primaryColumn }}" | ||
:has-publish-states="{{ Statamic\Support\Str::bool($resource->hasPublishStates()) }}" | ||
></resource-view> | ||
|
||
@endsection |
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
Oops, something went wrong.