diff --git a/.gitignore b/.gitignore index 34d871359..5095a345b 100644 --- a/.gitignore +++ b/.gitignore @@ -68,10 +68,12 @@ bundle-report.*.html /webroot/*.hot-update.* /webroot/vendors/async/*.hot-update.* /webroot/css/admin-index* +/webroot/css/admin-statistics* /webroot/css/app* /webroot/css/category* /webroot/css/date-range* /webroot/css/date-input* +/webroot/css/edit-children-params* /webroot/css/email-input* /webroot/css/flash-message* /webroot/css/folder-picker* @@ -82,6 +84,7 @@ bundle-report.*.html /webroot/css/menu* /webroot/css/object-categories* /webroot/css/object-nav* +/webroot/css/object-captions* /webroot/css/object-property* /webroot/css/objects-history* /webroot/css/permission* diff --git a/config/app_local.example.php b/config/app_local.example.php index 2f2cc1588..2c79ee2a8 100644 --- a/config/app_local.example.php +++ b/config/app_local.example.php @@ -808,4 +808,16 @@ // 'Captions', // ], // ], + + /** + * Configuration for "Captions". + * - formats.allowed: allowed formats for captions + * - formats.default: default format for captions + */ + // 'Captions' => [ + // 'formats' => [ + // 'allowed' => ['srt', 'sub', 'webvtt'], + // 'default' => 'webvtt', + // ], + // ], ]; diff --git a/locales/default.pot b/locales/default.pot index 87976a2e3..d9fee31b3 100644 --- a/locales/default.pot +++ b/locales/default.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: BEdita 4 \n" -"POT-Creation-Date: 2024-10-24 09:51:55 \n" +"POT-Creation-Date: 2024-11-22 13:38:50 \n" "MIME-Version: 1.0 \n" "Content-Transfer-Encoding: 8bit \n" "Language-Team: BEdita I18N & I10N Team \n" @@ -115,6 +115,9 @@ msgstr "" msgid "Cannot produce a thumbnail for this file" msgstr "" +msgid "Captions" +msgstr "" + msgid "Categories" msgstr "" @@ -1513,7 +1516,7 @@ msgstr "" msgid "Related items order will be changed." msgstr "" -msgid "Continue?" +msgid "OK" msgstr "" msgid "Hide" @@ -1629,6 +1632,30 @@ msgstr "" msgid "Search on categories" msgstr "" +msgid "Caption" +msgstr "" + +msgid "Format" +msgstr "" + +msgid "New caption" +msgstr "" + +msgid "New" +msgstr "" + +msgid "No captions" +msgstr "" + +msgid "Not valid" +msgstr "" + +msgid "Parameters" +msgstr "" + +msgid "Valid" +msgstr "" + msgid "Password" msgstr "" diff --git a/locales/en_US/default.po b/locales/en_US/default.po index cb0d47571..fab580bec 100644 --- a/locales/en_US/default.po +++ b/locales/en_US/default.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: BEdita Manager \n" -"POT-Creation-Date: 2024-10-24 09:51:55 \n" +"POT-Creation-Date: 2024-11-22 13:38:50 \n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: BEdita I18N & I10N Team \n" @@ -118,6 +118,9 @@ msgstr "" msgid "Cannot produce a thumbnail for this file" msgstr "" +msgid "Captions" +msgstr "" + msgid "Categories" msgstr "" @@ -1516,7 +1519,7 @@ msgstr "" msgid "Related items order will be changed." msgstr "" -msgid "Continue?" +msgid "OK" msgstr "" msgid "Hide" @@ -1632,6 +1635,30 @@ msgstr "" msgid "Search on categories" msgstr "" +msgid "Caption" +msgstr "" + +msgid "Format" +msgstr "" + +msgid "New caption" +msgstr "" + +msgid "New" +msgstr "" + +msgid "No captions" +msgstr "" + +msgid "Not valid" +msgstr "" + +msgid "Parameters" +msgstr "" + +msgid "Valid" +msgstr "" + msgid "Password" msgstr "" diff --git a/locales/it_IT/default.po b/locales/it_IT/default.po index 7600569a8..439ad9684 100644 --- a/locales/it_IT/default.po +++ b/locales/it_IT/default.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: BEdita Manager \n" -"POT-Creation-Date: 2024-10-24 09:51:55 \n" +"POT-Creation-Date: 2024-11-22 13:38:50 \n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: BEdita I18N & I10N Team \n" @@ -120,6 +120,9 @@ msgstr "Impossibile creare oggetti astratti o oggetti senza schema" msgid "Cannot produce a thumbnail for this file" msgstr "Impossibile produrre una miniatura per questo file" +msgid "Captions" +msgstr "Sottotitoli" + msgid "Categories" msgstr "Categorie" @@ -1533,8 +1536,8 @@ msgstr "Ordina per" msgid "Related items order will be changed." msgstr "L'ordine degli elementi correlati verrà modificato." -msgid "Continue?" -msgstr "Vuoi continuare?" +msgid "OK" +msgstr "" msgid "Hide" msgstr "Nascondi" @@ -1649,6 +1652,30 @@ msgstr "Errore nella cancellazione della proprietà " msgid "Search on categories" msgstr "Cerca tra le categorie" +msgid "Caption" +msgstr "Sottotitolo" + +msgid "Format" +msgstr "Formato" + +msgid "New caption" +msgstr "Nuovo sottotitolo" + +msgid "New" +msgstr "Nuovo" + +msgid "No captions" +msgstr "Nessun sottotitolo" + +msgid "Not valid" +msgstr "Non valido" + +msgid "Parameters" +msgstr "Parametri" + +msgid "Valid" +msgstr "Valido" + msgid "Password" msgstr "Password" diff --git a/package.json b/package.json index 93ffbb707..f4b928b88 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ "vue": "^2.5.16", "vue-chartjs": "^5.3.1", "vuejs-title": "^1.0.16", - "webpack-manifest-plugin": "^5.0.0" + "webpack-manifest-plugin": "^5.0.0", + "webvtt-parser": "^2.2.0" }, "devDependencies": { "@babel/core": "^7.20.12", @@ -74,4 +75,4 @@ "webpack-cli": "^4.9.0", "webpack-watch-files-plugin": "^1.2.0" } -} \ No newline at end of file +} diff --git a/resources/js/app/app.js b/resources/js/app/app.js index dd4203c86..2d8446bee 100644 --- a/resources/js/app/app.js +++ b/resources/js/app/app.js @@ -87,6 +87,7 @@ const _vueInstance = new Vue({ UserAccesses:() => import(/* webpackChunkName: "user-accesses" */'app/components/user-accesses/user-accesses'), LanguageSelector:() => import(/* webpackChunkName: "language-selector" */'app/components/language-selector/language-selector'), ClipboardItem: () => import(/* webpackChunkName: "clipboard-item" */'app/components/clipboard-item/clipboard-item'), + ObjectCaptions: () => import(/* webpackChunkName: "object-captions" */'app/components/object-captions/object-captions'), ObjectCategories: () => import(/* webpackChunkName: "object-categories" */'app/components/object-categories/object-categories'), PlaceholderList: () => import(/* webpackChunkName: "placeholder-list" */'app/components/placeholder-list/placeholder-list'), BarChart:() => import(/* webpackChunkName: "bar-chart" */'app/components/charts/bar-chart'), diff --git a/resources/js/app/components/menu.js b/resources/js/app/components/menu.js index 9834bd846..e80630f92 100644 --- a/resources/js/app/components/menu.js +++ b/resources/js/app/components/menu.js @@ -29,7 +29,9 @@ export default { let key = e.which || e.keyCode || 0; switch (key) { case 13: - this.go(); + if (!e.shiftKey) { + this.go(); + } break; case 27: this.popUpAction = ''; diff --git a/resources/js/app/components/object-captions/object-captions.vue b/resources/js/app/components/object-captions/object-captions.vue new file mode 100644 index 000000000..683958101 --- /dev/null +++ b/resources/js/app/components/object-captions/object-captions.vue @@ -0,0 +1,722 @@ + + + + {{ msgNoCaptions }} + + + + {{ msgCaption }} + + + {{ msgTitle }} + + + {{ msgLang }} + + + {{ msgStatus }} + + + + + + + + + + + {{ truncate(item.caption_text, 100) }} + + {{ item.label }} + {{ languages[item.lang] }} + {{ item.status }} + + + + + + + {{ msgEdit }} + + + + + + {{ msgRemove }} + + + + + {{ msgNew }} + + + + + + + + {{ msgTitle }} + + + + {{ msgLang }} + + + {{ lang.label }} + + + + + {{ msgStatus }} + + + {{ status.label }} + + + + + {{ msgFormat }} + + + {{ format }} + + + + + {{ msgCaption }} + + + + + {{ msgValid }} + + + + {{ msgNotValid }} + + + + Line {{ error.line }}: {{ error.message }} + + + + + + + + {{ msgOk }} + + + + + + {{ msgCancel }} + + + + + + + + + + + + {{ msgNewCaption }} + + + + + + + + + {{ msgTitle }} + + + + {{ msgLang }} + + + {{ lang.label }} + + + + + {{ msgStatus }} + + + {{ status.label }} + + + + + {{ msgFormat }} + + + {{ format }} + + + + + {{ msgCaption }} + + + + + {{ msgValid }} + + + + {{ msgNotValid }} + + + + Line {{ error.line }}: {{ error.message }} + + + + + + + + {{ msgAdd }} + + + + + + {{ msgCancel }} + + + + + + + + + + + + {{ msgSave }} + + + + + {{ msgCancel }} + + + + + + diff --git a/resources/js/app/components/property-view/property-view.js b/resources/js/app/components/property-view/property-view.js index b38ace489..1e10a820f 100644 --- a/resources/js/app/components/property-view/property-view.js +++ b/resources/js/app/components/property-view/property-view.js @@ -44,6 +44,7 @@ export default { PermissionToggle: () => import(/* webpackChunkName: "permission-toggle" */'app/components/permission-toggle/permission-toggle'), LanguageSelector:() => import(/* webpackChunkName: "language-selector" */'app/components/language-selector/language-selector'), ClipboardItem: () => import(/* webpackChunkName: "clipboard-item" */'app/components/clipboard-item/clipboard-item'), + ObjectCaptions: () => import(/* webpackChunkName: "object-captions" */'app/components/object-captions/object-captions'), ObjectCategories: () => import(/* webpackChunkName: "object-categories" */'app/components/object-categories/object-categories'), PlaceholderList: () => import(/* webpackChunkName: "placeholder-list" */'app/components/placeholder-list/placeholder-list'), }, diff --git a/src/Controller/Component/PropertiesComponent.php b/src/Controller/Component/PropertiesComponent.php index a950e4993..72ed34ecd 100644 --- a/src/Controller/Component/PropertiesComponent.php +++ b/src/Controller/Component/PropertiesComponent.php @@ -89,6 +89,7 @@ class PropertiesComponent extends Component 'tags', 'lang', 'children_order', + 'captions', ]; /** diff --git a/templates/Element/Form/captions.twig b/templates/Element/Form/captions.twig new file mode 100644 index 000000000..9c9bf0d9c --- /dev/null +++ b/templates/Element/Form/captions.twig @@ -0,0 +1,26 @@ +{% if schema.properties.captions %} +{% set captions = object.attributes.captions %} + + + + {{ __('Captions') }} + {{ captions|length }} + + + + + + {% do Form.unlockField('captions') %} + {{ write_config('_jsonKeys', config('_jsonKeys', [])|merge(['captions'])) }} + + + + +{% endif %} diff --git a/templates/Pages/Modules/view.twig b/templates/Pages/Modules/view.twig index 00e44a989..4b0cbe96b 100644 --- a/templates/Pages/Modules/view.twig +++ b/templates/Pages/Modules/view.twig @@ -62,6 +62,8 @@ {{ element('Form/media') }} + {{ element('Form/captions') }} + {{ element('Form/map') }} {{ element('Form/other_properties') }} diff --git a/yarn.lock b/yarn.lock index 1640612e3..30f14cdaa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2082,9 +2082,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001629: - version "1.0.30001632" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001632.tgz" - integrity sha512-udx3o7yHJfUxMLkGohMlVHCvFvWmirKh9JAH/d7WOLPetlH+LTL5cocMZ0t7oZx/mdlOWXti97xLZWc8uURRHg== + version "1.0.30001680" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz" + integrity sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA== chalk@4.1.2, chalk@^4.0.0: version "4.1.2" @@ -5696,6 +5696,11 @@ webpack@^5.94.0: watchpack "^2.4.1" webpack-sources "^3.2.3" +webvtt-parser@^2.2.0: + version "2.2.0" + resolved "https://registry.npmjs.org/webvtt-parser/-/webvtt-parser-2.2.0.tgz#79029fb9067edcb210820fa6101c37d9b8b78d9f" + integrity sha512-FzmaED+jZyt8SCJPTKbSsimrrnQU8ELlViE1wuF3x1pgiQUM8Llj5XWj2j/s6Tlk71ucPfGSMFqZWBtKn/0uEA== + whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"