-
Notifications
You must be signed in to change notification settings - Fork 42
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
96e0fbb
commit b5bbf28
Showing
38 changed files
with
2,357 additions
and
95 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
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,65 @@ | ||
<template> | ||
<div class="max-w-lg mt-4 mx-auto"> | ||
|
||
<div class="rounded p-6 lg:px-20 lg:py-10 shadow bg-white dark:bg-dark-600 dark:shadow-dark"> | ||
<header class="text-center mb-16"> | ||
<h1 class="mb-6">{{ __('Create Tax Class') }}</h1> | ||
<!-- <p class="text-gray" v-text="__('messages.collection_configure_intro')" />--> | ||
</header> | ||
<div class="mb-10"> | ||
<label class="font-bold text-base mb-1" for="name">{{ __('Name') }}</label> | ||
<input type="text" v-model="name" class="input-text" autofocus tabindex="1"> | ||
<!-- <div class="text-2xs text-gray-600 mt-2 flex items-center">--> | ||
<!-- {{ __('messages.collection_configure_title_instructions') }}--> | ||
<!-- </div>--> | ||
</div> | ||
</div> | ||
|
||
<div class="flex justify-center mt-8"> | ||
<button tabindex="4" class="btn-primary mx-auto btn-lg" :disabled="! canSubmit" @click="submit"> | ||
{{ __('Create Tax Class')}} | ||
</button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
route: { | ||
type: String | ||
} | ||
}, | ||
data() { | ||
return { | ||
name: null, | ||
} | ||
}, | ||
computed: { | ||
canSubmit() { | ||
return Boolean(this.name); | ||
}, | ||
}, | ||
methods: { | ||
submit() { | ||
this.$axios.post(this.route, {name: this.name}).then(response => { | ||
window.location = response.data.redirect; | ||
}).catch(error => { | ||
this.$toast.error(error.response.data.message); | ||
}); | ||
} | ||
}, | ||
mounted() { | ||
this.$keys.bindGlobal(['return'], e => { | ||
if (this.canSubmit) { | ||
this.submit(); | ||
} | ||
}); | ||
} | ||
} | ||
</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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<template> | ||
<data-list :rows="rows" :columns="columns"> | ||
<div class="card p-0" slot-scope="{ }"> | ||
<data-list-table> | ||
<template slot="cell-name" slot-scope="{ row: taxClass, index }"> | ||
<a :href="taxClass.edit_url">{{ __(taxClass.name) }}</a> | ||
</template> | ||
<template slot="actions" slot-scope="{ row: taxClass, index }"> | ||
<dropdown-list> | ||
<dropdown-item :text="__('Edit')" :redirect="taxClass.edit_url" /> | ||
<dropdown-item | ||
:text="__('Delete')" | ||
class="warning" | ||
@click="$refs[`deleter_${taxClass.id}`].confirm()" | ||
> | ||
<resource-deleter | ||
:ref="`deleter_${taxClass.id}`" | ||
:resource="taxClass" | ||
@deleted="removeRow(taxClass)"> | ||
</resource-deleter> | ||
</dropdown-item> | ||
</dropdown-list> | ||
</template> | ||
</data-list-table> | ||
</div> | ||
</data-list> | ||
</template> | ||
|
||
<script> | ||
import Listing from '../../../../vendor/statamic/cms/resources/js/components/Listing.vue' | ||
export default { | ||
mixins: [Listing], | ||
props: [ | ||
'initialRows', | ||
'initialColumns', | ||
], | ||
data() { | ||
return { | ||
rows: this.initialRows, | ||
columns: this.initialColumns | ||
} | ||
} | ||
} | ||
</script> |
Oops, something went wrong.