From dbe85dd49847a0f2df30ae6362c26d85e3c09859 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Thu, 30 Apr 2020 15:15:31 +0400 Subject: [PATCH 01/15] PHRAS-3047 Tools metadatas tab --- .../Controller/Prod/SubdefsController.php | 1 + .../Controller/Prod/ToolsController.php | 4 +- .../web/prod/actions/Tools/index.html.twig | 56 ++++++++++++------- .../web/prod/actions/Tools/metadata.html.twig | 2 +- 4 files changed, 42 insertions(+), 21 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Prod/SubdefsController.php b/lib/Alchemy/Phrasea/Controller/Prod/SubdefsController.php index eb5741d492..31658384d9 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/SubdefsController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/SubdefsController.php @@ -48,6 +48,7 @@ class SubdefsController extends Controller return $this->render('prod/actions/Tools/metadata.html.twig', [ 'record' => $record, 'metadatas' => $metadataBag, + 'subdef_name' => $subdef_name ]); } diff --git a/lib/Alchemy/Phrasea/Controller/Prod/ToolsController.php b/lib/Alchemy/Phrasea/Controller/Prod/ToolsController.php index 20291ec2c3..3b88e81237 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/ToolsController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/ToolsController.php @@ -47,6 +47,8 @@ class ToolsController extends Controller $record = $records->first(); $databox = $record->getDatabox(); + /**Array list of subdefs**/ + $listsubdef = array_keys($record-> get_subdefs()); // fetch subdef list: $subdefs = $record->get_subdefs(); @@ -57,7 +59,6 @@ class ToolsController extends Controller && $acl->has_right_on_base($record->getBaseId(), \ACL::IMGTOOLS) ) { $databoxSubdefs = $record->getDatabox()->get_subdef_structure()->getSubdefGroup($record->getType()); - foreach ($subdefs as $subdef) { $label = $subdefName = $subdef->get_name(); if (null === $permalink = $subdef->get_permalink()) { @@ -94,6 +95,7 @@ class ToolsController extends Controller 'record' => $record, 'recordSubdefs' => $recordAccessibleSubdefs, 'metadatas' => $metadatas, + 'listsubdef' => $listsubdef ]); } diff --git a/templates/web/prod/actions/Tools/index.html.twig b/templates/web/prod/actions/Tools/index.html.twig index 3d4cb6029c..8a043a16a6 100644 --- a/templates/web/prod/actions/Tools/index.html.twig +++ b/templates/web/prod/actions/Tools/index.html.twig @@ -194,6 +194,14 @@ {# exiftool section #} {% if metadatas %}
+
+ +
@@ -202,13 +210,12 @@
{% for subdef in recordSubdefs %} -
-
+
+
{{ subdef.label }}
-
-

- -

{% endfor %} @@ -288,20 +294,32 @@ }; {% if record is not null %} + function loadMetadataTab (url) { + console.log(url); + $.ajax({ + "url": url, + "type": "GET", + beforeSend: function () { + $('#metadata-content').empty(); + $('#metadata-load').removeClass('hidden').addClass('loading'); + }, + success: function (data) { + $('#metadata-load').removeClass('loading').addClass('hidden'); + $('#metadata-content').append(data); + } + }); + } $(document).ready(function(){ - $('.tool-metadata').click(function(e){ - $.ajax({ - "url": "{{ path('prod_subdefs_metadata', {'databox_id': record.get_sbas_id(), 'record_id': record.get_record_id, 'subdef_name': 'document'}) }}", - "type": "GET", - beforeSend: function(){ - $('#metadata-content').empty(); - $('#metadata-load').removeClass('hidden').addClass('loading'); - }, - success: function (data) { - $('#metadata-load').removeClass('loading').addClass('hidden'); - $('#metadata-content').append(data); - } - }); + /**load default Subdef info **/ + loadMetadataTab( '{{ path('prod_subdefs_metadata', {'databox_id': record.get_sbas_id(), 'record_id': record.get_record_id, 'subdef_name': 'document' }) }}'); + /**load selected Subdef info **/ + $('#select-meta-subdef').on('change', function (e) { + var selectedSubdef = $(this).children('option:selected'); + if (selectedSubdef.val() !== "") { + var url = '{{ path('prod_subdefs_metadata', {'databox_id': record.get_sbas_id(), 'record_id': record.get_record_id, 'subdef_name': 'subdefName' }) }}'; + url = url.replace("subdefName", selectedSubdef.val() ); + loadMetadataTab(url); + } }); }); {% endif %} diff --git a/templates/web/prod/actions/Tools/metadata.html.twig b/templates/web/prod/actions/Tools/metadata.html.twig index 04c2f48da0..9d3515c05d 100644 --- a/templates/web/prod/actions/Tools/metadata.html.twig +++ b/templates/web/prod/actions/Tools/metadata.html.twig @@ -6,7 +6,7 @@ height="{{thumbnail.get_height()}}" />
-

Metadatas

+

{{"prod::tool:metadata:metadatas" | trans}} : {{ subdef_name }}


From b4eebb4e4fd316835270f30a78062ed6a239e601 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Thu, 30 Apr 2020 23:18:53 +0400 Subject: [PATCH 02/15] PHRAS-3047 --- package.json | 2 +- templates/web/prod/actions/Tools/index.html.twig | 1 + yarn.lock | 16 ++++++++-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index a3f3ae6a84..0daefafed5 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "normalize-css": "^2.1.0", "npm": "^6.0.0", "npm-modernizr": "^2.8.3", - "phraseanet-production-client": "0.34.186-d", + "phraseanet-production-client": "0.34.187-d", "requirejs": "^2.3.5", "tinymce": "^4.0.28", "underscore": "^1.8.3", diff --git a/templates/web/prod/actions/Tools/index.html.twig b/templates/web/prod/actions/Tools/index.html.twig index 8a043a16a6..c14917f472 100644 --- a/templates/web/prod/actions/Tools/index.html.twig +++ b/templates/web/prod/actions/Tools/index.html.twig @@ -312,6 +312,7 @@ $(document).ready(function(){ /**load default Subdef info **/ loadMetadataTab( '{{ path('prod_subdefs_metadata', {'databox_id': record.get_sbas_id(), 'record_id': record.get_record_id, 'subdef_name': 'document' }) }}'); + $('#exiftool').height($('#prod-tool-box').height() - 50 ); /**load selected Subdef info **/ $('#select-meta-subdef').on('change', function (e) { var selectedSubdef = $(this).children('option:selected'); diff --git a/yarn.lock b/yarn.lock index bff3caa51b..48fbc0bdb4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4834,10 +4834,10 @@ insert-css@0.0.0: resolved "https://registry.yarnpkg.com/insert-css/-/insert-css-0.0.0.tgz#2304bfa6f893abecb8ff9ca8d9c7605d94cf2911" integrity sha1-IwS/pviTq+y4/5yo2cdgXZTPKRE= -interpret@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" - integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== +interpret@^0.6.2: + version "0.6.6" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-0.6.6.tgz#fecd7a18e7ce5ca6abfb953e1f86213a49f1625b" + integrity sha1-/s16GOfOXKar+5U+H4YhOknxYls= invariant@^2.2.0: version "2.2.4" @@ -7578,10 +7578,10 @@ phraseanet-common@^0.4.5-d: js-cookie "^2.1.0" pym.js "^1.3.1" -phraseanet-production-client@0.34.186-d: - version "0.34.186-d" - resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.34.186-d.tgz#3ad595280e8b97d3554a193345b49c9597b73f62" - integrity sha512-HvZ1e3DldxN+KFFu8vXmv1b80nvAyW7MVfxcdBJt18NH6bbZlqaaVL3Ga7r3WZWYKBgGqYmc5q2mrxUc1HX+dQ== +phraseanet-production-client@0.34.187-d: + version "0.34.187-d" + resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.34.187-d.tgz#4b1fc48c5968540ae8d96a840aa9775aab9ef17c" + integrity sha512-IRK35vuVb2JjElud8fuCUKrNKFOdB9FLadDDoEwZoI5JVHRWYuOoIUn2WBuBKvDP2G7rwcS8A2E8iN4iWODYsQ== dependencies: "@mapbox/mapbox-gl-language" "^0.9.2" "@turf/turf" "^5.1.6" From fa256b6b3240ced5f141c0ac932b5683f1e2b015 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Mon, 4 May 2020 15:18:26 +0400 Subject: [PATCH 03/15] PHRAS-3044 Fix on video tools --- package.json | 2 +- templates/web/prod/index.html.twig | 2 ++ yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a3f3ae6a84..78a2972998 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "normalize-css": "^2.1.0", "npm": "^6.0.0", "npm-modernizr": "^2.8.3", - "phraseanet-production-client": "0.34.186-d", + "phraseanet-production-client": "0.34.189-d", "requirejs": "^2.3.5", "tinymce": "^4.0.28", "underscore": "^1.8.3", diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index 3dff7692e5..83ad088bdb 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -995,6 +995,8 @@ + +