80 lines
3.3 KiB
Twig
80 lines
3.3 KiB
Twig
{% set theme = app.session.get('theme') %}
|
|
{% if theme is not empty %}
|
|
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
|
{% endif %}
|
|
|
|
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
|
|
|
{% set stylewidget = constants.mystylewidget(entity) %}
|
|
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
|
|
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
|
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
|
{% set color = app.session.get('color') %}
|
|
|
|
{% set colorbodyfont = entity.colorbodyfont %}
|
|
{% if colorbodyfont is null %}
|
|
{% set colorbodyfont = color['fontcolorhover'] %}
|
|
{% endif %}
|
|
|
|
{% set colorbodyback = entity.colorbodyback %}
|
|
{% if colorbodyback is null %}
|
|
{% set colorbodyback = color['main'] %}
|
|
{% endif %}
|
|
|
|
{% set colorbodyfont = entity.colorbodyfont %}
|
|
{% if colorbodyfont is null %}
|
|
{% if colorbodyback==color['fontcolorhover'] %}
|
|
{% set colorbodyfont = color['main'] %}
|
|
{% else %}
|
|
{% set colorbodyfont = color['fontcolorhover'] %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
<style>
|
|
|
|
|
|
|
|
</style>
|
|
|
|
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
|
<div class="widgetmenu">
|
|
{% if canupdate %}
|
|
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
|
<i class="fa fa-file fa-fw" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
|
{% endif %}
|
|
|
|
<a onClick="showFrameitem('blog','{{ path('cadoles_portal_'~access~'_blog_view') }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-paper-plane fa-fw"></i></a>
|
|
</div>
|
|
|
|
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
|
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
|
|
<span class="title">{{ entity.name }}</span>
|
|
</div>
|
|
|
|
<div class="widgetbody" style="{{ stylewidgetbody }} {% if not entity.border %} padding-top:10px; {% endif %}">
|
|
<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>
|
|
{% endif %}
|
|
|
|
<div class="grid-item grid-preview">
|
|
<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%">
|
|
{% endif %}
|
|
<div class="caption" style="background-color: #{{ colorbodyfont }}; color: #{{ colorbodyback }};">
|
|
<h1 class="grid-preview-title" style="color: #{{ colorbodyback }};">{{ blogarticle.name}}</h1>
|
|
<small>publié par {{ blogarticle.user.username }} le {{ blogarticle.submit|date("d/m/Y à H:i") }}<br>dans le blog {{blogarticle.blog.name }}</small>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|