Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.DS_Store
node_modules
vendor
mix-manifest.json
.env
composer.lock
/vendor
.phpunit.result.cache
.phpunit.cache
.idea/
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

### What's fixed
- Ampersands and other special characters are now run through `htmlspecialchars()` to make sure the XML validates correctly.



## 1.0.0 (2021-07-29)

### What's new
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
},
"require": {
"statamic/cms": "<=6.0"
"statamic/cms": "^6.0.0-alpha.18"
},
"extra": {
"statamic": {
Expand Down
364 changes: 0 additions & 364 deletions dist/js/addon.js

This file was deleted.

10,891 changes: 1,257 additions & 9,634 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 5 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
"dev": "rm -rf resources/dist/build && vite",
"build": "vite build"
},
"devDependencies": {
"cross-env": "^5.1",
"laravel-mix": "^5.0.9",
"vue": "^2.6.12",
"vue-loader": "^15.9.5",
"vue-template-compiler": "^2.6.11"
"@statamic/cms": "file:./vendor/statamic/cms/resources/dist-package",
"laravel-vite-plugin": "^1.3.0",
"vite": "^6.4.1"
}
}
1 change: 1 addition & 0 deletions resources/dist/build/assets/cp-CeFyRnK7.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions resources/dist/build/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"resources/js/cp.js": {
"file": "assets/cp-CeFyRnK7.js",
"name": "cp",
"src": "resources/js/cp.js",
"isEntry": true
}
}
16 changes: 16 additions & 0 deletions resources/js/components/fieldtypes/PodcastCategories.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script setup>
import { Fieldtype } from '@statamic/cms';
import { Select } from '@statamic/cms/ui';

const emit = defineEmits(Fieldtype.emits);
const props = defineProps(Fieldtype.props);
const { update } = Fieldtype.use(emit, props);
</script>

<template>
<Select
:options="meta.categories"
:model-value="value"
@update:model-value="update"
/>
</template>
5 changes: 5 additions & 0 deletions resources/js/cp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import PodcastCategoriesFieldtype from './components/fieldtypes/PodcastCategories.vue'

Statamic.booting(() => {
Statamic.component('podcast_categories-fieldtype', PodcastCategoriesFieldtype);
});
124 changes: 123 additions & 1 deletion src/Fieldtypes/PodcastCategories.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,129 @@

class PodcastCategories extends Fieldtype
{
protected $icon = 'tags';
protected $icon = 'fieldtype-taxonomy';

public function preload()
{
$categories = [
'Arts',
'Arts » Books',
'Arts » Design',
'Arts » Fashion & Beauty',
'Arts » Food',
'Arts » Performing Arts',
'Arts » Visual Arts',
'Business',
'Business » Careers',
'Business » Entrepreneurship',
'Business » Investing',
'Business » Management',
'Business » Marketing',
'Business » Non-Profit',
'Comedy',
'Comedy » Comedy Interviews',
'Comedy » Improv',
'Comedy » Stand-Up',
'Education',
'Education » Courses',
'Education » How To',
'Education » Language Learning',
'Education » Self-Improvement',
'Fiction',
'Fiction » Comedy Fiction',
'Fiction » Drama',
'Fiction » Science Fiction',
'Government',
'History',
'Health & Fitness',
'Health & Fitness » Alternative Health',
'Health & Fitness » Fitness',
'Health & Fitness » Medicine',
'Health & Fitness » Mental Health',
'Health & Fitness » Nutrition',
'Health & Fitness » Sexuality',
'Kids & Family',
'Kids & Family » Education for Kids',
'Kids & Family » Parenting',
'Kids & Family » Pets & Animals',
'Kids & Family » Stories for Kids',
'Leisure',
'Leisure » Animation & Manga',
'Leisure » Automotive',
'Leisure » Aviation',
'Leisure » Crafts',
'Leisure » Games',
'Leisure » Hobbies',
'Leisure » Home & Garden',
'Leisure » Video Games',
'Music',
'Music » Music Commentary',
'Music » Music History',
'Music » Music Interviews',
'News',
'News » Business News',
'News » Daily News',
'News » Entertainment News',
'News » News Commentary',
'News » Politics',
'News » Sports News',
'News » Tech News',
'Religion & Spirituality',
'Religion & Spirituality » Buddhism',
'Religion & Spirituality » Christianity',
'Religion & Spirituality » Hinduism',
'Religion & Spirituality » Islam',
'Religion & Spirituality » Judaism',
'Religion & Spirituality » Religion',
'Religion & Spirituality » Spirituality',
'Science',
'Science » Astronomy',
'Science » Chemistry',
'Science » Earth Sciences',
'Science » Life Sciences',
'Science » Mathematics',
'Science » Natural Sciences',
'Science » Nature',
'Science » Physics',
'Science » Social Sciences',
'Society & Culture',
'Society & Culture » Documentary',
'Society & Culture » Personal Journals',
'Society & Culture » Philosophy',
'Society & Culture » Places & Travel',
'Society & Culture » Relationships',
'Sports',
'Sports » Baseball',
'Sports » Basketball',
'Sports » Cricket',
'Sports » Fantasy Sports',
'Sports » Football',
'Sports » Golf',
'Sports » Hockey',
'Sports » Rugby',
'Sports » Running',
'Sports » Soccer',
'Sports » Swimming',
'Sports » Tennis',
'Sports » Volleyball',
'Sports » Wilderness',
'Sports » Wrestling',
'Technology',
'True Crime',
'TV & Film',
'TV & Film » After Shows',
'TV & Film » Film History',
'TV & Film » Film Interviews',
'TV & Film » Film Reviews',
'TV & Film » TV Reviews',
];

return [
'categories' => collect($categories)
->map(fn (string $category) => ['label' => $category, 'value' => $category])
->all(),
];
}

public function augment($value)
{
Expand Down
10 changes: 4 additions & 6 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@

class ServiceProvider extends AddonServiceProvider
{
protected $fieldtypes = [
Fieldtypes\PodcastCategories::class,
];

protected $scripts = [
__DIR__.'/../dist/js/addon.js',
protected $vite = [
'input' => ['resources/js/cp.js'],
'publicDirectory' => 'resources/dist',
'hotFile' => __DIR__.'/../resources/dist/hot',
];
}
5 changes: 0 additions & 5 deletions src/resources/js/addon.js

This file was deleted.

141 changes: 0 additions & 141 deletions src/resources/js/components/fieldtypes/PodcastCategories.vue

This file was deleted.

Loading