diff --git a/sites/all/modules/figli/edlp_studio/edlp_studio.module b/sites/all/modules/figli/edlp_studio/edlp_studio.module index 38d36884f..c5bcec9bc 100644 --- a/sites/all/modules/figli/edlp_studio/edlp_studio.module +++ b/sites/all/modules/figli/edlp_studio/edlp_studio.module @@ -33,6 +33,37 @@ function edlp_studio_page_attachments(array &$attachments) { } +/** + * Implements hook_theme(). + */ +function edlp_studio_theme($existing, $type, $theme, $path) { + // @see https://www.drupal.org/docs/8/theming/twig/create-custom-twig-templates-from-custom-module + + return array( + 'edlp_chutier_ui' => array( + 'file' => 'includes/edlp_chutier_ui.inc', + 'variables' => array( + 'documents' => array(), + ), + ), + 'edlp_composition_ui' => array( + 'file' => 'includes/edlp_composition_ui.inc', + 'variables' => array( + 'compositions' => array(), + ), + ), + 'edlp_studio_ui' => array( + 'file' => 'includes/edlp_studio_ui.inc', + 'variables' => array( + 'chutier' => null, + 'compositions' => null, + ), + ), + ); +} + + + /** * hook_entity_extra_field_info() * diff --git a/sites/all/modules/figli/edlp_studio/edlp_studio.routing.yml b/sites/all/modules/figli/edlp_studio/edlp_studio.routing.yml index e09de976e..c469fd984 100644 --- a/sites/all/modules/figli/edlp_studio/edlp_studio.routing.yml +++ b/sites/all/modules/figli/edlp_studio/edlp_studio.routing.yml @@ -14,3 +14,11 @@ edlp_studio.chutier_controller_ajax_add_content: cid: null requirements: _permission: 'use chutier' + +edlp_studio.studio_ui: + path: '/edlp/studio-ui' + defaults: + _controller: '\Drupal\edlp_studio\Controller\StudioUIController::StudioUI' + _title: 'Studio User Interface' + requirements: + _permission: 'use chutier' diff --git a/sites/all/modules/figli/edlp_studio/includes/edlp_chutier_ui.inc b/sites/all/modules/figli/edlp_studio/includes/edlp_chutier_ui.inc new file mode 100644 index 000000000..c125cf7ea --- /dev/null +++ b/sites/all/modules/figli/edlp_studio/includes/edlp_chutier_ui.inc @@ -0,0 +1,12 @@ +getViewBuilder($vars['entity_type']); + // $vars['content'] = $view_builder->view($vars['entity'], $vars['view_mode']); +} diff --git a/sites/all/modules/figli/edlp_studio/includes/edlp_composition_ui.inc b/sites/all/modules/figli/edlp_studio/includes/edlp_composition_ui.inc new file mode 100644 index 000000000..f789599df --- /dev/null +++ b/sites/all/modules/figli/edlp_studio/includes/edlp_composition_ui.inc @@ -0,0 +1,12 @@ +getViewBuilder($vars['entity_type']); + // $vars['content'] = $view_builder->view($vars['entity'], $vars['view_mode']); +} diff --git a/sites/all/modules/figli/edlp_studio/includes/edlp_studio_ui.inc b/sites/all/modules/figli/edlp_studio/includes/edlp_studio_ui.inc new file mode 100644 index 000000000..82f846160 --- /dev/null +++ b/sites/all/modules/figli/edlp_studio/includes/edlp_studio_ui.inc @@ -0,0 +1,12 @@ +getViewBuilder($vars['entity_type']); + // $vars['content'] = $view_builder->view($vars['entity'], $vars['view_mode']); +} diff --git a/sites/all/modules/figli/edlp_studio/src/Controller/ChutierController.php b/sites/all/modules/figli/edlp_studio/src/Controller/ChutierController.php index 38375a9ec..9a0ee629d 100644 --- a/sites/all/modules/figli/edlp_studio/src/Controller/ChutierController.php +++ b/sites/all/modules/figli/edlp_studio/src/Controller/ChutierController.php @@ -3,9 +3,9 @@ namespace Drupal\edlp_studio\Controller; use Drupal\Core\Controller\ControllerBase; +use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Session\AccountInterface; use Drupal\User\UserDataInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Drupal\edlp_studio\Entity\Chutier; diff --git a/sites/all/modules/figli/edlp_studio/src/Controller/StudioUIController.php b/sites/all/modules/figli/edlp_studio/src/Controller/StudioUIController.php new file mode 100644 index 000000000..a987ab29d --- /dev/null +++ b/sites/all/modules/figli/edlp_studio/src/Controller/StudioUIController.php @@ -0,0 +1,73 @@ +user = $account; + $this->userdata = $userdata; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + // Instantiates this form class. + return new static( + // Load the service required to construct this class. + $container->get('current_user'), + $container->get('user.data') + ); + } + + + /** + * Studioui. + * + * @return string + * Return Hello string. + */ + public function StudioUI() { + // get current user + // done by DependencyInjection of AccountInterface + dpm($this->user->id()); + + // get his docs in chutier + $docs = Chutier::getUserChutiersContents($this->user->id()); + dpm($docs); + + // TODO: add chutier theme, preprocess, twig template to studio module + // TODO: build content renderable array + + // TODO: get compositions + // TODO: add compositions theme, preprocess, twig template to studio module + // TODO: build content renderable array + + // TODO: add studio theme, preprocess, twig template to studio module + // TODO: build global studio renderable array + + return [ + '#type' => 'markup', + '#markup' => $this->t('Implement method: StudioUI') + ]; + } + +} diff --git a/sites/all/modules/figli/edlp_studio/templates/edlp_chutier_ui.html.twig b/sites/all/modules/figli/edlp_studio/templates/edlp_chutier_ui.html.twig new file mode 100644 index 000000000..e69de29bb diff --git a/sites/all/modules/figli/edlp_studio/templates/edlp_composition_ui.html.twig b/sites/all/modules/figli/edlp_studio/templates/edlp_composition_ui.html.twig new file mode 100644 index 000000000..e69de29bb diff --git a/sites/all/modules/figli/edlp_studio/templates/edlp_studio_ui.html.twig b/sites/all/modules/figli/edlp_studio/templates/edlp_studio_ui.html.twig new file mode 100644 index 000000000..e69de29bb diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/random.svg b/sites/all/themes/custom/edlptheme/assets/dist/img/random.svg new file mode 100644 index 000000000..743c1f94e --- /dev/null +++ b/sites/all/themes/custom/edlptheme/assets/dist/img/random.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/search.svg b/sites/all/themes/custom/edlptheme/assets/dist/img/search.svg index 8fe35e6d6..267ad00c5 100644 --- a/sites/all/themes/custom/edlptheme/assets/dist/img/search.svg +++ b/sites/all/themes/custom/edlptheme/assets/dist/img/search.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/sites/all/themes/custom/edlptheme/assets/dist/img/studio.svg b/sites/all/themes/custom/edlptheme/assets/dist/img/studio.svg new file mode 100644 index 000000000..180d64214 --- /dev/null +++ b/sites/all/themes/custom/edlptheme/assets/dist/img/studio.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css b/sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css index f269f2b0f..48f995bbf 100644 --- a/sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css +++ b/sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css @@ -1822,7 +1822,7 @@ footer { position: relative; width: 20px; height: 20px; - background-image: url(../img/user.svg); + background-image: url(../img/studio.svg); background-size: contain; text-indent: 40px; margin: 0; diff --git a/sites/all/themes/custom/edlptheme/assets/img/random.svg b/sites/all/themes/custom/edlptheme/assets/img/random.svg new file mode 100644 index 000000000..29ffd8779 --- /dev/null +++ b/sites/all/themes/custom/edlptheme/assets/img/random.svg @@ -0,0 +1,72 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/sites/all/themes/custom/edlptheme/assets/img/search.svg b/sites/all/themes/custom/edlptheme/assets/img/search.svg index 00e0d9f68..69c9cd1ca 100644 --- a/sites/all/themes/custom/edlptheme/assets/img/search.svg +++ b/sites/all/themes/custom/edlptheme/assets/img/search.svg @@ -1,19 +1,44 @@ + + + id="svg15566" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" + sodipodi:docname="search.svg"> + id="defs15560" /> + + id="metadata15563"> @@ -25,11 +50,29 @@ - + inkscape:label="Calque 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-293.03123)"> + + + + diff --git a/sites/all/themes/custom/edlptheme/assets/img/studio.svg b/sites/all/themes/custom/edlptheme/assets/img/studio.svg new file mode 100644 index 000000000..1ff8e795a --- /dev/null +++ b/sites/all/themes/custom/edlptheme/assets/img/studio.svg @@ -0,0 +1,72 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/sites/all/themes/custom/edlptheme/assets/styles/app.scss b/sites/all/themes/custom/edlptheme/assets/styles/app.scss index 3de4b37d2..8f90b27de 100644 --- a/sites/all/themes/custom/edlptheme/assets/styles/app.scss +++ b/sites/all/themes/custom/edlptheme/assets/styles/app.scss @@ -844,7 +844,7 @@ footer{ h2{ position: relative; width:$wh; height:$wh; - background-image: url(../img/user.svg); + background-image: url(../img/studio.svg); // background-color: red; background-size: contain; text-indent: $wh*2;