mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
PHRAS-3047 Tools metadatas tab
This commit is contained in:
@@ -48,6 +48,7 @@ class SubdefsController extends Controller
|
|||||||
return $this->render('prod/actions/Tools/metadata.html.twig', [
|
return $this->render('prod/actions/Tools/metadata.html.twig', [
|
||||||
'record' => $record,
|
'record' => $record,
|
||||||
'metadatas' => $metadataBag,
|
'metadatas' => $metadataBag,
|
||||||
|
'subdef_name' => $subdef_name
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,6 +47,8 @@ class ToolsController extends Controller
|
|||||||
$record = $records->first();
|
$record = $records->first();
|
||||||
$databox = $record->getDatabox();
|
$databox = $record->getDatabox();
|
||||||
|
|
||||||
|
/**Array list of subdefs**/
|
||||||
|
$listsubdef = array_keys($record-> get_subdefs());
|
||||||
// fetch subdef list:
|
// fetch subdef list:
|
||||||
$subdefs = $record->get_subdefs();
|
$subdefs = $record->get_subdefs();
|
||||||
|
|
||||||
@@ -57,7 +59,6 @@ class ToolsController extends Controller
|
|||||||
&& $acl->has_right_on_base($record->getBaseId(), \ACL::IMGTOOLS)
|
&& $acl->has_right_on_base($record->getBaseId(), \ACL::IMGTOOLS)
|
||||||
) {
|
) {
|
||||||
$databoxSubdefs = $record->getDatabox()->get_subdef_structure()->getSubdefGroup($record->getType());
|
$databoxSubdefs = $record->getDatabox()->get_subdef_structure()->getSubdefGroup($record->getType());
|
||||||
|
|
||||||
foreach ($subdefs as $subdef) {
|
foreach ($subdefs as $subdef) {
|
||||||
$label = $subdefName = $subdef->get_name();
|
$label = $subdefName = $subdef->get_name();
|
||||||
if (null === $permalink = $subdef->get_permalink()) {
|
if (null === $permalink = $subdef->get_permalink()) {
|
||||||
@@ -94,6 +95,7 @@ class ToolsController extends Controller
|
|||||||
'record' => $record,
|
'record' => $record,
|
||||||
'recordSubdefs' => $recordAccessibleSubdefs,
|
'recordSubdefs' => $recordAccessibleSubdefs,
|
||||||
'metadatas' => $metadatas,
|
'metadatas' => $metadatas,
|
||||||
|
'listsubdef' => $listsubdef
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -194,6 +194,14 @@
|
|||||||
{# exiftool section #}
|
{# exiftool section #}
|
||||||
{% if metadatas %}
|
{% if metadatas %}
|
||||||
<div id="exiftool" class="tabBox">
|
<div id="exiftool" class="tabBox">
|
||||||
|
<div class="metadatas-top-block">
|
||||||
|
<select id="select-meta-subdef" name="metaSubdef" class="input-medium check-filters" >
|
||||||
|
<option value="" disabled >{{"prod::tool:select subdef" | trans}}</option>
|
||||||
|
{% for subdef in listsubdef %}
|
||||||
|
<option value= "{{ subdef }}" {{ subdef== 'document'? 'selected' : 'false' }}>{{ subdef }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<div id="metadata-load" style="height: 100%"></div>
|
<div id="metadata-load" style="height: 100%"></div>
|
||||||
<div id="metadata-content"></div>
|
<div id="metadata-content"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -202,13 +210,12 @@
|
|||||||
<div id="tools-sharing" class="tabBox">
|
<div id="tools-sharing" class="tabBox">
|
||||||
<div class="well-large">
|
<div class="well-large">
|
||||||
{% for subdef in recordSubdefs %}
|
{% for subdef in recordSubdefs %}
|
||||||
<div class="row-fluid">
|
<div class="row-fluid tools-sharing-row">
|
||||||
<div class="span6">
|
<div class="span6 tools-sharing-title">
|
||||||
<span class="status-marker {{ subdef.state ? 'status-active' : 'status-inactive' }}"></span>{{ subdef.label }}
|
<span class="status-marker {{ subdef.state ? 'status-active' : 'status-inactive' }}"></span>{{ subdef.label }}
|
||||||
</div>
|
</div>
|
||||||
<div class="span6">
|
<div class="span6 text-right">
|
||||||
<p class="text-right">
|
<button type="button" class="tools-sharing-btn stateChange_button btn btn-inverse text-right"
|
||||||
<button type="button" class="stateChange_button btn btn-inverse text-right"
|
|
||||||
data-name="{{ subdef.name }}" data-state="{{ subdef.state }}">
|
data-name="{{ subdef.name }}" data-state="{{ subdef.state }}">
|
||||||
{% if subdef.state %}
|
{% if subdef.state %}
|
||||||
{{- "Disable document type sharing"|trans -}}
|
{{- "Disable document type sharing"|trans -}}
|
||||||
@@ -216,7 +223,6 @@
|
|||||||
{{- "Enable document type sharing"|trans -}}
|
{{- "Enable document type sharing"|trans -}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -288,20 +294,32 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
{% if record is not null %}
|
{% 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(){
|
$(document).ready(function(){
|
||||||
$('.tool-metadata').click(function(e){
|
/**load default Subdef info **/
|
||||||
$.ajax({
|
loadMetadataTab( '{{ path('prod_subdefs_metadata', {'databox_id': record.get_sbas_id(), 'record_id': record.get_record_id, 'subdef_name': 'document' }) }}');
|
||||||
"url": "{{ path('prod_subdefs_metadata', {'databox_id': record.get_sbas_id(), 'record_id': record.get_record_id, 'subdef_name': 'document'}) }}",
|
/**load selected Subdef info **/
|
||||||
"type": "GET",
|
$('#select-meta-subdef').on('change', function (e) {
|
||||||
beforeSend: function(){
|
var selectedSubdef = $(this).children('option:selected');
|
||||||
$('#metadata-content').empty();
|
if (selectedSubdef.val() !== "") {
|
||||||
$('#metadata-load').removeClass('hidden').addClass('loading');
|
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() );
|
||||||
success: function (data) {
|
loadMetadataTab(url);
|
||||||
$('#metadata-load').removeClass('loading').addClass('hidden');
|
}
|
||||||
$('#metadata-content').append(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
height="{{thumbnail.get_height()}}" />
|
height="{{thumbnail.get_height()}}" />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h1><b>Metadatas</b></h1>
|
<h3>{{"prod::tool:metadata:metadatas" | trans}} : {{ subdef_name }}</h3>
|
||||||
<hr>
|
<hr>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
Reference in New Issue
Block a user