mode liste

This commit is contained in:
afornerot 2019-08-30 11:51:18 +02:00
parent 9f7cfc6ad3
commit 82d8ee90ce
11 changed files with 185 additions and 62 deletions

View File

@ -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 {

View File

@ -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);

View File

@ -819,6 +819,16 @@ class PagewidgetController extends Controller
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":
@ -1060,6 +1073,9 @@ class PagewidgetController extends Controller
case "nbarticle":
$nbarticle=$parameter["value"];
break;
case "modelist":
$modelist=$parameter["value"];
break;
}
}
@ -1220,6 +1236,7 @@ class PagewidgetController extends Controller
//'fluxs' => $fluxsordered,
'access' => $access,
'feeds' => $feeds,
'modelist' => $modelist,
]);
}

View File

@ -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, [

View File

@ -80,24 +80,31 @@
</ul>
</nav>
<div class="grid clearfix" style="margin-top:10px;">
<div class="grid clearfix">
{% for blogarticle in blogarticles %}
{% if loop.index==1 %}
<div class="grid-sizer grid-preview"></div>
<div class="grid-gutter-sizer grid-gutter-sizer-preview"></div>
<div class="grid-gutter-sizer grid-preview-gutter-sizer"></div>
{% endif %}
<div class="grid-item grid-preview">
<div class="grid-item-content">
<a href="{{ path('cadoles_portal_'~access~'_blogarticle_view',{'id':blogarticle.id}) }}">
{% if blogarticle.image is not empty %}
<img src="/{{alias}}/{{blogarticle.image|replace({"/blogarticle/":"/blogarticle/thumb-"})}}" width="100%">
<div class="grid-item-logo">
<img class="grid-item-img" src="/{{alias}}/{{blogarticle.image|replace({"/blogarticle/":"/blogarticle/thumb-"})}}" width="100%">
</div>
{% endif %}
<div class="caption">
<h1 class="grid-preview-title">{{ blogarticle.name}}</h1>
<div class="grid-item-title">
<h2>{{blogarticle.name }}</h2>
<small>publié par {{ blogarticle.user.username }} le {{ blogarticle.submit|date("d/m/Y à H:i") }}<br>dans le blog {{blogarticle.blog.name }}</small>
</div>
</div>
</a>
</div>
</div>
{% endfor %}
</div>
</div>

View File

@ -17,6 +17,8 @@
{% set stylegrid="grid-medium" %}
{% elseif modedesktop==2 %}
{% set stylegrid="grid-small" %}
{% elseif modedesktop==3 %}
{% set stylegrid="grid-list" %}
{% endif %}
{% set colorbodyfont = "" %}

View File

@ -52,20 +52,27 @@
{% for blogarticle in blogarticles %}
{% if loop.index==1 %}
<div class="grid-sizer grid-preview"></div>
<div class="grid-gutter-sizer grid-gutter-sizer-preview"></div>
<div class="grid-gutter-sizer grid-preview-gutter-sizer"></div>
{% endif %}
<div class="grid-item grid-preview" style="{{ stylewidgetbodyreverse }};">
<div class="grid-item-content">
<a href onClick="showFrameitem('blog','{{ path('cadoles_portal_'~access~'_blogarticle_view',{'id':blogarticle.id}) }}',true)">
{% if blogarticle.image is not empty %}
<img src="/{{alias}}/{{blogarticle.image|replace({"/blogarticle/":"/blogarticle/thumb-"})}}" width="100%">
<div class="grid-item-logo">
<img class="grid-item-img" src="/{{alias}}/{{blogarticle.image|replace({"/blogarticle/":"/blogarticle/thumb-"})}}" width="100%">
</div>
{% endif %}
<div class="caption">
<h1 class="grid-preview-title" style="{{ stylewidgetbodyreverse }};">{{ blogarticle.name}}</h1>
<div class="caption" style="{{ stylewidgetbodyreverse }};">
<div class="grid-item-title" style="{{ stylewidgetbodyreverse }};">
<h2>{{blogarticle.name }}</h2>
<small>publié par {{ blogarticle.user.username }} le {{ blogarticle.submit|date("d/m/Y à H:i") }}<br>dans le blog {{blogarticle.blog.name }}</small>
</div>
</div>
</a>
</div>
</div>
{% endfor %}
</div>
</div>

View File

@ -16,6 +16,8 @@
{% set stylegrid="grid-medium" %}
{% elseif modedesktop==2 %}
{% set stylegrid="grid-small" %}
{% elseif modedesktop==3 %}
{% set stylegrid="grid-list" %}
{% endif %}
{% set colorbodyfont = "" %}
@ -48,7 +50,7 @@
</div>
{% if bookmarks is not empty %}
<div class="widgetbody" style="{{ stylewidgetbody }} {% if not entity.border %} padding-top:10px; {% endif %}">
<div class="widgetbody" style="{{ stylewidgetbody }}">
<div class="bookmark-container">
<div class="grid clearfix">
<div class="grid-sizer {{ stylegrid }}"></div>

View File

@ -30,11 +30,11 @@
{% endif %}
{% endif %}
<style>
</style>
{% if modelist==0 %}
{% set stylegrid="grid-preview" %}
{% elseif modelist==1 %}
{% set stylegrid="grid-list" %}
{% endif %}
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
@ -56,7 +56,7 @@
{% set firstflux="" %}
<div class="widgetbody" style="{{ stylewidgetbody }}">
<div class="widgetbody" style="{{ stylewidgetbody }} ">
{% if fluxs is defined %}
{% if fluxs|length > 1 %}
<div class="cat-list-feed" onClick="showFlux({{ entity.id}},'all')" style="color:#{{ color['fontcolorhover'] }}; background-color: #{{ color['main'] }}">Tout</div>
@ -69,18 +69,14 @@
<div class="cat-list-feed" onClick="showFlux({{ entity.id}},{{ flux.id }})" style="{{ stylefeed }} color:#{{ color['fontcolorhover'] }};">{{ flux.title }}</div>
{% endfor %}
{% else %}
<p></p>
{% endif %}
{% else %}
<p></p>
{% endif %}
<div class="grid clearfix">
{% for feed in feeds %}
{% if loop.index==1 %}
<div class="grid-sizer grid-preview"></div>
<div class="grid-gutter-sizer grid-gutter-sizer-preview"></div>
<div class="grid-sizer {{stylegrid}}"></div>
<div class="grid-gutter-sizer {{stylegrid}}-gutter-sizer"></div>
{% endif %}
@ -93,18 +89,30 @@
{% set stylefeed = stylefeed ~ "background: url(" ~ feed.image ~ ") no-repeat center; background-size: cover;" %}
{% endif %}
<div class="grid-item grid-preview feed flux-{{ feed.fluxid }}">
<div class="grid-item {{ stylegrid }} feed flux-{{ feed.fluxid }}">
<div class="grid-item-content" style="{{ stylecolor }};">
<a class="linktosonde" data-sonde="Flux = {{ feed.fluxtitle }}" href="{{ feed.link }}" target="_blank">
<div class="item-link clearfix">
{% if feed.image is not empty %}
<img src="{{feed.image}}" width="100%">
<div class="grid-item-logo">
<img class="grid-item-img" src="{{feed.image}}" width="100%">
</div>
{% endif %}
<div class="caption" style="{{ stylecolor }}">
<h1 class="grid-preview-title" style="{{ stylecolor }};padding:0px;">{{ feed.title }}</h1>
<div class="caption" style="{{ stylecolor }};">
<div class="grid-item-title">
<h2>{{ feed.title }}</h2>
{% if modelist==0 %}
<small>le {{ feed.date|date("d/m/Y à H:i") }}</small><br>
{{ feed.description | nl2br }}
{% endif %}
</div>
</div>
</div>
</a>
</div>
</div>
{% endfor %}
</div>
</div>

View File

@ -18,6 +18,8 @@
{% set stylegrid="grid-medium" %}
{% elseif modedesktop==2 %}
{% set stylegrid="grid-small" %}
{% elseif modedesktop==3 %}
{% set stylegrid="grid-list" %}
{% endif %}
{% set colorbodyfont = "" %}
@ -93,7 +95,7 @@
{% endif %}
<div class="grid clearfix">
<div class="grid-sizer {{ stylegrid }}" data-idcategory="bookmark"></div>
<div class="grid-gutter-sizer"></div>
<div class="grid-gutter-sizer {{ stylegrid }}-gutter-sizer"></div>
{% for bookmark in bookmarks %}
<div class="grid-item {{ stylegrid }}" data-idcategory="bookmark" data-title="{{ bookmark.title|lower }}">
<div class="grid-item-content" style="background-color: {{ bookmark.color ? "#"~bookmark.color : '#'~colormain }};">
@ -110,9 +112,9 @@
<div class="item-link clearfix">
<div class="grid-item-logo">
{% if bookmark.icon %}
<img class="grid-item-img" height="110" src="/{{ alias }}/{{ bookmark.icon.label }}">
<img class="grid-item-img" src="/{{ alias }}/{{ bookmark.icon.label }}">
{% else %}
<img class="grid-item-img" height="110" src="/{{ alias }}/uploads/icon/icon_pin.png">
<img class="grid-item-img" src="/{{ alias }}/uploads/icon/icon_pin.png">
{% endif %}
</div>

View File

@ -17,6 +17,8 @@
{% set stylegrid="grid-medium" %}
{% elseif modedesktop==2 %}
{% set stylegrid="grid-small" %}
{% elseif modedesktop==3 %}
{% set stylegrid="grid-list" %}
{% endif %}
{% set colorbodyfont = "" %}