diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css index 172492c5..ea3b38a1 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css @@ -397,8 +397,42 @@ a.item-heart { .grid .grid-small .grid-item-title span { display: none } +.grid .grid-list { + width:100%; + height:auto; +} + +.grid .grid-list .item-link { + height:auto; +} + +.grid .grid-list .grid-item-logo { + height:auto; + width:30px; + float:left; + padding: 0px; + margin: 10px +} +.grid .grid-list .grid-item-logo img { + height: 30px; + width: 30px; + margin: 0px; +} +.grid .grid-list .grid-item-title { + padding: 5px; + vertical-align: top; + font-size: 12px; + line-height: 1; + text-align:left; + width:auto; + position: absolute; + top: 0px; +} +.grid .grid-list .grid-item-title h2 { font-size:18px; border-bottom: none; line-height: 40px; height: 40px; overflow: hidden; margin:0px} +.grid .grid-list .grid-item-title span { display: none } +/* Grid Image */ .grid .grid-image { width:19.2%; height:auto; @@ -425,7 +459,7 @@ a.item-heart { .grid-gutter-sizer-image { width: 1% } - +/* Preview */ .grid .grid-preview { width:19.2%; min-width:220px; @@ -433,20 +467,49 @@ a.item-heart { text-align: left; } +.grid .grid-preview .caption { padding: 9px } +.grid .grid-preview-gutter-sizer { width: 1% } + .grid .grid-preview a:hover { text-decoration: none; } -.grid .grid-preview .grid-preview-title { - margin:0px; - font-size:20px; - text-align:left; - word-wrap: break-word; +.grid .grid-preview .item-link { + height:auto; } -.grid .grid-preview .caption { padding: 9px } +.grid .grid-preview .grid-item-logo { + display: block; + width:100%; + padding: 0px; + height: auto; +} +.grid .grid-preview .grid-item-logo img { + width: 100%; + margin: 0px; +} + +.grid .grid-preview .grid-item-title { + margin:0px; + font-size:14px; + text-align:left; + word-wrap: break-word; + width: 100%; + display: block; + line-height: initial; + padding: 0px; +} + +.grid .grid-preview .grid-item-title h2 { + border: none; + margin: 0px; + padding: 0px; +} + +.grid .grid-preview .grid-item-title small { + margin-bottom: 10px; +} -.grid-gutter-sizer-preview { width: 1% } @media (max-width: 991px) { .grid .grid-preview { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php index 4f91fa94..2299e5ed 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Command/InitDataCommand.php @@ -435,7 +435,7 @@ class InitDataCommand extends ContainerAwareCommand $entityWidget->setBorder(false); $entityWidget->setOpened(true); $entityWidget->setAccess(["config","user","group"]); - $parameter = json_decode('{"fields": []}'); + $parameter = json_decode('{"fields": [{"id": "modelist", "loc": "col1", "type": "modelist", "label": "Mode Affichage", "value": "0", "mandatory": "true"}]}'); $entityWidget->setParameter($parameter); $em->persist($entityWidget); @@ -614,7 +614,7 @@ class InitDataCommand extends ContainerAwareCommand $entityWidget->setBorder(false); $entityWidget->setOpened(true); $entityWidget->setAccess(["config","user","group"]); - $parameter = json_decode('{"fields": [{"id": "url", "loc": "col1", "type": "string", "label": "URL du Flux RSS", "value": "", "mandatory": "true"},{"id": "nbarticle", "loc": "col1", "type": "integer", "label": "Nombre d\'articles affichés (0 pour tout)", "value": "10", "mandatory": "true"}]}'); + $parameter = json_decode('{"fields": [{"id": "url", "loc": "col1", "type": "string", "label": "URL du Flux RSS", "value": "", "mandatory": "true"},{"id": "nbarticle", "loc": "col1", "type": "integer", "label": "Nombre d\'articles affichés (0 pour tout)", "value": "10", "mandatory": "true"},{"id": "modelist", "loc": "col1", "type": "modelist", "label": "Mode Affichage", "value": "0", "mandatory": "true"}]}'); $entityWidget->setParameter($parameter); $em->persist($entityWidget); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php index 5b134a13..3a313dc9 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -818,7 +818,17 @@ class PagewidgetController extends Controller $em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate); if(!$cansee) throw $this->createNotFoundException('Permission denied'); } - + + // Récupération des paramétres du widget + $modelist=0; + foreach($entity->getParameter()["fields"] as $parameter) { + switch($parameter["id"]) { + case "modelist": + $modelist=$parameter["value"]; + break; + } + } + // Profilage $user=$this->getUser(); $roles=($user?$user->getRoles():["ROLE_ANONYME"]); @@ -1026,9 +1036,11 @@ class PagewidgetController extends Controller return $this->render($this->labelentity.':viewflux.html.twig', [ 'entity' => $entity, 'canupdate' => $canupdate, + 'modelist' => $modelist, 'fluxs' => $fluxsordered, 'access' => $access, 'feeds' => $feeds, + ]); } @@ -1052,6 +1064,7 @@ class PagewidgetController extends Controller // Récupération des paramétres du widget $url=""; $nbarticle="_blank"; + $modelist=0; foreach($entity->getParameter()["fields"] as $parameter) { switch($parameter["id"]) { case "url": @@ -1059,9 +1072,12 @@ class PagewidgetController extends Controller break; case "nbarticle": $nbarticle=$parameter["value"]; - break; + break; + case "modelist": + $modelist=$parameter["value"]; + break; } - } + } // On regarde si le flux a été lu il y a peu $toregen=true; @@ -1220,6 +1236,7 @@ class PagewidgetController extends Controller //'fluxs' => $fluxsordered, 'access' => $access, 'feeds' => $feeds, + 'modelist' => $modelist, ]); } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PagewidgetType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PagewidgetType.php index 45507562..1bbd1d6e 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PagewidgetType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/PagewidgetType.php @@ -118,10 +118,23 @@ class PagewidgetType extends AbstractType 'label_attr' => ['loc' => $field->loc], 'data' => $field->value, 'required' => ($field->mandatory=="true"), - 'choices' => array("Grand" => "0","Moyen" => "1", "Petit" => "2") + 'choices' => array("Grand" => "0","Moyen" => "1", "Petit" => "2", "Liste" => "3") ]) ; } + elseif($field->type=="modelist") { + $builder + ->add($field->id, ChoiceType::class, [ + 'label' => $field->label, + 'mapped'=> false, + 'label_attr' => ['loc' => $field->loc], + 'data' => $field->value, + 'required' => ($field->mandatory=="true"), + 'choices' => array("Pavet" => "0","Liste" => "1") + ]) ; + } + + elseif($field->type=="withbookmark") { $builder ->add($field->id, ChoiceType::class, [ diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Blog/view.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Blog/view.html.twig index 108857dc..25777bf5 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Blog/view.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Blog/view.html.twig @@ -80,23 +80,30 @@ -