Unverified Commit a267dab4 authored by Sebastian Castro's avatar Sebastian Castro
Browse files

refactor: fix templates

parent d5f59e0c
......@@ -13,7 +13,7 @@ sonata_admin:
templates:
# default global templates
layout: SonataAdminBundle::layout.html.twig
edit: "@BiopenAdmin/core_custom/base_edit.html.twig"
edit: "admin/core_custom/base_edit.html.twig"
dashboard:
blocks:
# display a dashboard block
......
......@@ -6,4 +6,4 @@ sonata_core:
sonata_doctrine_mongo_db_admin:
templates:
form:
- "@BiopenAdmin/core_custom/form_admin_fields.html.twig"
- "admin/core_custom/form_admin_fields.html.twig"
......@@ -14,11 +14,7 @@ twig:
oauth_google: '%env(oauth_google_id)%'
oauth_facebook: '%env(oauth_facebook_id)%'
paths:
"%kernel.root_dir%/../templates/geo-directory/": BiopenGeoDirectory
"%kernel.root_dir%/../templates/geo-directory/admin": BiopenAdmin
"%kernel.root_dir%/../templates/core": BiopenCoreBundle
"%kernel.root_dir%/../templates/bundles/SonataUserBundle": UserBundle
"%kernel.root_dir%/../web": RootDir
"%kernel.root_dir%/../templates/saas": BiopenSaasBundle
form_themes:
- '@SonataFormatter/Form/formatter.html.twig'
......@@ -34,7 +34,7 @@ class CategoryAdmin extends AbstractAdmin
public function getTemplate($name)
{
switch ($name) {
case 'edit': return '@BiopenAdmin/edit/edit_option_category.html.twig';
case 'edit': return 'admin/edit/edit_option_category.html.twig';
break;
default : return parent::getTemplate($name);
break;
......@@ -92,7 +92,7 @@ class CategoryAdmin extends AbstractAdmin
->add('name')
->add('_action', 'actions', array(
'actions' => array(
'tree' => array('template' => '@BiopenAdmin/partials/list__action_tree.html.twig')
'tree' => array('template' => 'admin/partials/list__action_tree.html.twig')
)
));
}
......
......@@ -14,7 +14,7 @@ class ConfigurationAbstractAdmin extends AbstractAdmin
{
switch ($name) {
// overwrite edit template so we hide delete button in actions menu
case 'edit': return '@BiopenAdmin/edit/edit_configuration.html.twig';
case 'edit': return 'admin/edit/edit_configuration.html.twig';
break;
default : return parent::getTemplate($name);
break;
......
......@@ -22,7 +22,7 @@ class ElementAdminList extends ElementAdminFilters
public function getTemplate($name)
{
switch ($name) {
case 'list': return '@BiopenAdmin/list/base_list_custom_batch.html.twig';
case 'list': return 'admin/list/base_list_custom_batch.html.twig';
break;
default : return parent::getTemplate($name);
break;
......@@ -47,16 +47,16 @@ class ElementAdminList extends ElementAdminFilters
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->add('name', null, array('editable' => false, 'template' => '@BiopenAdmin/partials/list_name.html.twig'))
->add('name', null, array('editable' => false, 'template' => 'admin/partials/list_name.html.twig'))
->add('status', ChoiceType::class, [
'choices'=> $this->statusChoices,
'editable'=>true,
'template' => '@BiopenAdmin/partials/list_choice_status.html.twig'
'template' => 'admin/partials/list_choice_status.html.twig'
])
->add('updatedAt','date', array("format" => "d/m/Y"))
->add('sourceKey', null, array('label' => 'Source'))
->add('optionValues', null, [
'template' => '@BiopenAdmin/partials/list_option_values.html.twig',
'template' => 'admin/partials/list_option_values.html.twig',
'header_style' => 'width: 250px',
'collapse' => true,
'choices' => $this->optionList,
......@@ -66,18 +66,18 @@ class ElementAdminList extends ElementAdminFilters
'label' => "Modération",
'choices'=> $this->moderationChoices,
'editable'=>true,
'template' => '@BiopenAdmin/partials/list_choice_moderation.html.twig'
'template' => 'admin/partials/list_choice_moderation.html.twig'
])
// use fake attribute createdAt, we then access full object inside template
->add('createdAt', null, array('template' => '@BiopenAdmin/partials/list_votes.html.twig', 'label' => 'Votes'))
->add('createdAt', null, array('template' => 'admin/partials/list_votes.html.twig', 'label' => 'Votes'))
->add('_action', 'actions', array(
'actions' => array(
'show-edit' => array('template' => '@BiopenAdmin/partials/list__action_show_edit.html.twig'),
//'edit' => array('template' => '@BiopenAdmin/partials/list__action_edit.html.twig'),
//'delete' => array('template' => '@BiopenAdmin/partials/list__action_delete.html.twig'),
'redirect-show' => array('template' => '@BiopenAdmin/partials/list__action_redirect_show.html.twig'),
'redirect-edit' => array('template' => '@BiopenAdmin/partials/list__action_redirect_edit.html.twig')
'show-edit' => array('template' => 'admin/partials/list__action_show_edit.html.twig'),
//'edit' => array('template' => 'admin/partials/list__action_edit.html.twig'),
//'delete' => array('template' => 'admin/partials/list__action_delete.html.twig'),
'redirect-show' => array('template' => 'admin/partials/list__action_redirect_show.html.twig'),
'redirect-edit' => array('template' => 'admin/partials/list__action_redirect_edit.html.twig')
)
));
}
......
......@@ -39,7 +39,7 @@ class ElementAdminShowEdit extends ElementAdminList
{
$show
->with('En attente', array('class' => $statusClass))
->add('currContribution', null, array('template' => '@BiopenAdmin/partials/show_one_contribution.html.twig'))->end();
->add('currContribution', null, array('template' => 'admin/partials/show_one_contribution.html.twig'))->end();
}
else
{
......@@ -53,9 +53,9 @@ class ElementAdminShowEdit extends ElementAdminList
->add('moderationState', ChoiceType::class, [
'label' => 'Moderation',
'choices'=> $this->moderationChoices,
'template' => '@BiopenAdmin/partials/show_choice_moderation.html.twig'
'template' => 'admin/partials/show_choice_moderation.html.twig'
])
->add('reports', null, array('template' => '@BiopenAdmin/partials/show_pending_reports.html.twig', 'label' => 'Signalements'))
->add('reports', null, array('template' => 'admin/partials/show_pending_reports.html.twig', 'label' => 'Signalements'))
->end();
}
......@@ -63,11 +63,11 @@ class ElementAdminShowEdit extends ElementAdminList
->with('Autre infos', array('class' => 'col-md-6 col-sm-12'))
->add('id')
->add('optionValues', null, [
'template' => '@BiopenAdmin/partials/show_option_values.html.twig',
'template' => 'admin/partials/show_option_values.html.twig',
'choices' => $this->optionList,
'label' => 'Catégories' ])
->add('email', EmailType::class, array('label' => 'Email de contact'))
->add('images', null, array('template' => '@BiopenAdmin/partials/show_element_images.html.twig'))
->add('images', null, array('template' => 'admin/partials/show_element_images.html.twig'))
->add('randomHash')
->add('oldId', null, array('label' => 'Id dans la base de données importée'))
->add('sourceKey', null, array('label' => 'Source'))
......@@ -86,11 +86,11 @@ class ElementAdminShowEdit extends ElementAdminList
->end()
->with('Champs personnalisés', array('class' => 'col-md-12 col-sm-12'))
->add('data', null, array('template' => '@BiopenAdmin/partials/show_element_data.html.twig'))
->add('data', null, array('template' => 'admin/partials/show_element_data.html.twig'))
->end()
->with('Historique des contributions', array('class' => 'col-sm-12'))
->add('contributions', null, array('template' => '@BiopenAdmin/partials/show_contributions.html.twig'))
->add('contributions', null, array('template' => 'admin/partials/show_contributions.html.twig'))
->end();
$show
......
......@@ -18,9 +18,9 @@ class ImportAdmin extends AbstractAdmin
{
$isDynamic = $this->getClass() == "App\Document\ImportDynamic";
switch ($name) {
case 'edit': return '@BiopenAdmin/edit/edit_import.html.twig';
case 'edit': return 'admin/edit/edit_import.html.twig';
break;
case 'list': return $isDynamic ? '@BiopenAdmin/list/list_import_dynamic.html.twig' : '@BiopenAdmin/list/list_import.html.twig';
case 'list': return $isDynamic ? 'admin/list/list_import_dynamic.html.twig' : 'admin/list/list_import.html.twig';
break;
default : return parent::getTemplate($name);
break;
......@@ -154,21 +154,21 @@ Transformer un attribut
$listMapper
->addIdentifier('sourceName', null, array('label' => 'Nom de la source'))
// Total count
->add('logs', null, array('label' => "Nombre d'éléments", 'template' => '@BiopenAdmin/partials/import/list_total_count.html.twig'))
->add('logs', null, array('label' => "Nombre d'éléments", 'template' => 'admin/partials/import/list_total_count.html.twig'))
// non visibles count
;
if ($isDynamic)
$listMapper
->add('idsToIgnore', null, array('label' => "Infos", 'template' => '@BiopenAdmin/partials/import/list_non_visibles_count.html.twig', 'choices' => $deletedElementsCount))
->add('refreshFrequencyInDays', null, array('label' => 'Mise à jour', 'template' => '@BiopenAdmin/partials/import/list_refresh_frequency.html.twig'));
->add('idsToIgnore', null, array('label' => "Infos", 'template' => 'admin/partials/import/list_non_visibles_count.html.twig', 'choices' => $deletedElementsCount))
->add('refreshFrequencyInDays', null, array('label' => 'Mise à jour', 'template' => 'admin/partials/import/list_refresh_frequency.html.twig'));
$listMapper
->add('lastRefresh', null, array('label' => 'Dernier import', 'template' => '@BiopenAdmin/partials/import/list_last_refresh.html.twig'))
->add('lastRefresh', null, array('label' => 'Dernier import', 'template' => 'admin/partials/import/list_last_refresh.html.twig'))
->add('_action', 'actions', array(
'actions' => array(
'edit' => array(),
'delete' => array(),
'refresh' => array('template' => '@BiopenAdmin/partials/list__action_refresh.html.twig'),
'refresh' => array('template' => 'admin/partials/list__action_refresh.html.twig'),
)
))
;
......
......@@ -33,7 +33,7 @@ class OptionAdmin extends AbstractAdmin
public function getTemplate($name)
{
switch ($name) {
case 'edit': return '@BiopenAdmin/edit/edit_option_category.html.twig';
case 'edit': return 'admin/edit/edit_option_category.html.twig';
break;
default : return parent::getTemplate($name);
break;
......
......@@ -28,7 +28,7 @@ class ProjectAdmin extends AbstractAdmin
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->add('name', null, array('template' => '@BiopenAdmin/partials/list_project_name.html.twig'))
->add('name', null, array('template' => 'admin/partials/list_project_name.html.twig'))
->add('domainName')
->add('description')
->add('dataSize')
......
......@@ -231,7 +231,7 @@ class UserAdmin extends AbstractAdmin
public function getTemplate($name)
{
switch ($name) {
case 'list': return '@BiopenAdmin/list/list_user.html.twig';
case 'list': return 'admin/list/list_user.html.twig';
break;
default : return parent::getTemplate($name);
break;
......
......@@ -141,7 +141,7 @@ class ChartBlockService extends AbstractBlockService
$contribsAddResolvedPie = $this->createChartFormContribution([InteractionType::Add], "Ajouts résolus", 'contribsAddResolvedPie');
$contribsEditResolvedPie = $this->createChartFormContribution([InteractionType::Edit], "Modifications résolues", 'contribsEditResolvedPie');
return $this->renderResponse('@BiopenAdmin/blocks/block_charts.html.twig', array(
return $this->renderResponse('admin/blocks/block_charts.html.twig', array(
'block' => $blockContext->getBlock(),
'settings' => $blockContext->getSettings(),
'userInteractChart' => $userInteractChart,
......
......@@ -64,7 +64,7 @@ class MonitoringElementsBlockService extends AbstractBlockService
// merge settings
$settings = $blockContext->getSettings();
return $this->renderResponse('@BiopenAdmin/blocks/block_monitoring.html.twig', array(
return $this->renderResponse('admin/blocks/block_monitoring.html.twig', array(
'block' => $blockContext->getBlock(),
'settings' => $settings,
'pendingCount' => $pendings,
......
......@@ -65,7 +65,7 @@ class RecentElementsBlockService extends AbstractAdminBlockService
'title' => 'Derniers elements',
'class' => '',
'filterStatus' => 0,
'template' => '@BiopenAdmin/blocks/block_recent_elements.html.twig',
'template' => 'admin/blocks/block_recent_elements.html.twig',
));
}
/**
......
......@@ -75,7 +75,7 @@ class BulkActionsAbstractController extends Controller
return $this->redirectToIndex();
}
return $this->render('@BiopenAdmin/pages/bulks/bulk_abstract.html.twig', array(
return $this->render('admin/pages/bulks/bulk_abstract.html.twig', array(
'isStillElementsToProceed' => $isStillElementsToProceed,
'renderedViews' => $renderedViews,
'firstId' => $batchFromStep,
......
......@@ -10,6 +10,6 @@ class BulkCoreController extends Controller
{
public function indexAction()
{
return $this->render('@BiopenAdmin/pages/bulks/bulk_index.html.twig');
return $this->render('admin/pages/bulks/bulk_index.html.twig');
}
}
\ No newline at end of file
......@@ -61,7 +61,7 @@ class DuplicatesActionsController extends BulkActionsAbstractController
$element->setIsDuplicateNode(true);
}
return $this->render('@BiopenAdmin/pages/bulks/bulk_duplicates.html.twig', array(
return $this->render('admin/pages/bulks/bulk_duplicates.html.twig', array(
'duplicates' => $duplicates,
'automaticMerge' => count($perfectMatches) > 0,
'needHumanMerge' => count($otherDuplicates) > 0,
......
......@@ -21,7 +21,7 @@ class CategoryAdminController extends Controller
$config = $dm->getRepository('App\Document\Configuration')->findConfiguration();
$rootCategories = $dm->getRepository('App\Document\Category')->findRootCategories();
return $this->render('@BiopenAdmin/list/tree_category.html.twig', array(
return $this->render('admin/list/tree_category.html.twig', array(
'categories' => $rootCategories, 'config' => $config
), null);
}
......
......@@ -59,7 +59,7 @@ class ElementAdminController extends ElementAdminBulkController
$this->get('twig')->getRuntime(\Symfony\Component\Form\FormRenderer::class)
->setTheme($view, $this->admin->getFormTheme());
return $this->render('@BiopenAdmin/edit/edit_element.html.twig', array(
return $this->render('admin/edit/edit_element.html.twig', array(
'action' => 'edit',
'form' => $view,
'object' => $object,
......
......@@ -38,7 +38,7 @@ class ImportAdminController extends Controller
$dataDisplay = print_r($result, true);
$url = $this->admin->generateUrl('edit', ['id' => $object->getId()]);
return $this->render('@BiopenAdmin/pages/import/show-data.html.twig', [
return $this->render('admin/pages/import/show-data.html.twig', [
'dataDisplay' => $dataDisplay,
'redirectUrl' => $url,
'import' => $object
......@@ -69,7 +69,7 @@ class ImportAdminController extends Controller
$redirectionUrl = $this->admin->generateUrl('edit', ['id' => $object->getId()]);
$stateUrl = $this->generateUrl('biopen_import_state', ['id' => $object->getId()]);
return $this->render('@BiopenAdmin/pages/import/import-progress.html.twig', [
return $this->render('admin/pages/import/import-progress.html.twig', [
'import' => $object,
'redirectUrl' => $redirectionUrl,
'redirectListUrl' => $redirectionUrl = $this->admin->generateUrl('list'),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment