Skip to content
Open
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
45 changes: 38 additions & 7 deletions lang/en/fieldsets/defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,46 @@
'json_ld_section' => 'JSON-LD',

'json_ld_entity_section' => 'Entity Information',
'json_ld_entity_section_instruct' => 'Basic details about the organization or person this site represents. This schema is only output on the homepage, as [recommended by Google](https://developers.google.com/search/docs/appearance/structured-data/organization).',
'json_ld_entity_section_instruct' => 'Details about the organization, person, or business this site represents. This schema is only output on the homepage, as [recommended by Google](https://developers.google.com/search/docs/appearance/structured-data/organization).',
'json_ld_entity' => 'Entity',
'json_ld_entity_instruct' => 'This helps search engines understand the structured data on your site and improves the likelihood of it appearing with rich search results.',
'json_ld_organization_name' => 'Organization Name',
'json_ld_organization_name_instruct' => 'The name of the organization this site represents.',
'json_ld_organization_logo' => 'Organization Logo',
'json_ld_organization_logo_instruct' => 'The logo of the organization this site represents.',
'json_ld_person_name' => 'Person Name',
'json_ld_person_name_instruct' => 'The full name of the person this site represents.',
'json_ld_entity_name' => 'Name',
'json_ld_entity_name_instruct' => 'The name of the entity this site represents.',
'json_ld_entity_alternate_name' => 'Alternate Name',
'json_ld_entity_alternate_name_instruct' => 'An alternative name the entity is also known by.',
'json_ld_entity_description' => 'Description',
'json_ld_entity_description_instruct' => 'A short description of the entity.',
'json_ld_entity_url' => 'URL',
'json_ld_entity_url_instruct' => 'The canonical URL for the entity. Defaults to the homepage URL when left blank.',
'json_ld_entity_logo' => 'Logo / Image',
'json_ld_entity_logo_instruct' => 'The logo or image representing the entity.',
'json_ld_entity_telephone' => 'Telephone',
'json_ld_entity_telephone_instruct' => 'The primary contact telephone number.',
'json_ld_entity_email' => 'Email',
'json_ld_entity_email_instruct' => 'The primary contact email address.',
'json_ld_entity_same_as' => 'Same As URLs',
'json_ld_entity_same_as_add_row' => 'Add URL',
'json_ld_entity_same_as_instruct' => 'URLs of social media profiles and other web presences that reference the entity.',
'json_ld_entity_street_address' => 'Street Address',
'json_ld_entity_street_address_instruct' => 'The street address of the entity that owns this site.',
'json_ld_entity_locality' => 'Locality / City',
'json_ld_entity_locality_instruct' => 'The locality (city) of the entity that owns this site.',
'json_ld_entity_region' => 'Region / State / Province',
'json_ld_entity_region_instruct' => 'The region, state or province of the entity that owns this site.',
'json_ld_entity_postal_code' => 'Postal Code',
'json_ld_entity_postal_code_instruct' => 'The postal code of the entity that owns this site.',
'json_ld_entity_country' => 'Country',
'json_ld_entity_country_instruct' => 'The country of the entity that owns this site. Recommended to be in 2-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1) format.',
'json_ld_entity_latitude' => 'Latitude',
'json_ld_entity_latitude_instruct' => 'You can find an addresses coordinates using [latlong.net](https://www.latlong.net/convert-address-to-lat-long.html).',
'json_ld_entity_longitude' => 'Longitude',
'json_ld_entity_longitude_instruct' => 'You can find an addresses coordinates using [latlong.net](https://www.latlong.net/convert-address-to-lat-long.html).',
'json_ld_entity_price_range' => 'Price Range',
'json_ld_entity_price_range_instruct' => 'The relative price range of the business.',
'json_ld_entity_opening_hours' => 'Opening Hours',
'json_ld_entity_opening_hours_instruct' => 'Leave a day blank to mark it as closed.',
'json_ld_entity_ticker_symbol' => 'Ticker Symbol',
'json_ld_entity_ticker_symbol_instruct' => 'The stock exchange ticker symbol, e.g. `NASDAQ:AAPL`.',

'json_ld_custom_section' => 'Custom Schema',
'json_ld_custom_section_instruct' => 'Add a custom JSON-LD schema that will be output on every page across your site.',
Expand Down
11 changes: 11 additions & 0 deletions lang/en/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,18 @@
'never' => 'Never',
'organization' => 'Organization',
'person' => 'Person',
'local_business' => 'Local Business',
'corporation' => 'Corporation',
'disabled' => 'Disabled',
'monday' => 'Monday',
'tuesday' => 'Tuesday',
'wednesday' => 'Wednesday',
'thursday' => 'Thursday',
'friday' => 'Friday',
'saturday' => 'Saturday',
'sunday' => 'Sunday',
'opening' => 'Opening',
'closing' => 'Closing',
'test_redirect' => 'Test Redirect',
'enabled' => 'Enabled',
'active' => 'Active',
Expand Down
22 changes: 20 additions & 2 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"build": "vite build"
},
"dependencies": {
"@internationalized/date": "^3.12.2",
"@tailwindcss/vite": "^4.2.4",
"cross-env": "^7.0.2",
"striptags": "^3.2.0",
Expand Down
59 changes: 59 additions & 0 deletions resources/js/components/fieldtypes/OpeningHoursFieldtype.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<script setup>
import { Fieldtype } from '@statamic/cms';
import { TimePicker } from '@statamic/cms/ui';
import { parseTime } from '@internationalized/date';

const emit = defineEmits(Fieldtype.emits);
const props = defineProps(Fieldtype.props);
const { isReadOnly, update, expose } = Fieldtype.use(emit, props);
defineExpose(expose);

function timeValue(day, type) {
const time = props.value?.[day]?.[type];

return time ? parseTime(time) : null;
}

function updateDay(day, type, time) {
update({
...(props.value || {}),
[day]: {
...(props.value?.[day] || {}),
[type]: time ? time.toString().slice(0, 5) : null,
},
});
}
</script>

<template>
<table class="w-full">
<thead>
<tr class="text-start text-sm text-gray-700 dark:text-gray-300">
<th class="p-2 font-medium"></th>
<th class="p-2 font-medium text-start">{{ __('seo-pro::messages.opening') }}</th>
<th class="p-2 font-medium text-start">{{ __('seo-pro::messages.closing') }}</th>
</tr>
</thead>
<tbody>
<tr v-for="(label, day) in meta.days" :key="day">
<td class="p-2 text-sm font-medium whitespace-nowrap">{{ label }}</td>
<td class="p-2">
<TimePicker
granularity="minute"
:model-value="timeValue(day, 'opening')"
:read-only="isReadOnly"
@update:model-value="updateDay(day, 'opening', $event)"
/>
</td>
<td class="p-2">
<TimePicker
granularity="minute"
:model-value="timeValue(day, 'closing')"
:read-only="isReadOnly"
@update:model-value="updateDay(day, 'closing', $event)"
/>
</td>
</tr>
</tbody>
</table>
</template>
2 changes: 2 additions & 0 deletions resources/js/cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import SeoProFieldtype from './components/fieldtypes/SeoProFieldtype.vue';
import PreviewsFieldtype from "./components/fieldtypes/PreviewsFieldtype.vue";
import SourceFieldtype from './components/fieldtypes/SourceFieldtype.vue';
import RedirectSourceFieldtype from './components/fieldtypes/RedirectSourceFieldtype.vue';
import OpeningHoursFieldtype from './components/fieldtypes/OpeningHoursFieldtype.vue';
import SeoProWidget from "./components/widgets/SeoProWidget.vue";
import RecentErrorsWidget from "./components/widgets/RecentErrorsWidget.vue";

Expand All @@ -33,6 +34,7 @@ Statamic.booting(() => {
Statamic.$components.register('seo_pro_previews-fieldtype', PreviewsFieldtype);
Statamic.$components.register('seo_pro_source-fieldtype', SourceFieldtype);
Statamic.$components.register('redirect_source-fieldtype', RedirectSourceFieldtype);
Statamic.$components.register('seo_pro_opening_hours-fieldtype', OpeningHoursFieldtype);

Statamic.$components.register('seo-pro-widget', SeoProWidget);
Statamic.$components.register('seo-pro-recent-errors-widget', RecentErrorsWidget);
Expand Down
Loading