Merge branch 'master' into dist/envole/6/master

This commit is contained in:
Arnaud Fornerot 2020-10-07 11:14:49 +02:00
commit 30e4609f6f
5 changed files with 34 additions and 48 deletions

View File

@ -1085,29 +1085,17 @@ class PagewidgetController extends Controller
}
public function viewbookmarkAction(Request $request,$id,$access="config") {
$look=$request->query->get('look');
$selwidget=$request->query->get('selwidget');
// Récupération de la requete
$this->setRequest($request,$id,$access);
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository($this->labelentity)->find($id);
if (!$entity) throw $this->createNotFoundException('Unable to find entity.');
// Permissions
if($access=="config") {
$canupdate = true;
}
else {
// On s'assure que l'utilisateur à la permission de voir
$page=$entity->getPage();
$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
// Valeur par défaut
$modedesktop=0;
foreach($entity->getParameter()["fields"] as $parameter) {
$bookmarks=null;
// Datas associées au widget
if(!$this->mini) {
// Récupération des paramétres du widget
foreach($this->entity->getParameter()["fields"] as $parameter) {
switch($parameter["id"]) {
case "modedesktop":
$modedesktop=$parameter["value"];
@ -1115,25 +1103,14 @@ class PagewidgetController extends Controller
}
}
// Préference utilisateur
$this->getPreference($entity);
// Profilage
$user=$this->getUser();
// Bookmark du widget
$bookmarks=$em->getRepository("CadolesPortalBundle:Bookmark")->findBy(["pagewidget"=>$entity]);
$bookmarks=$this->em->getRepository("CadolesPortalBundle:Bookmark")->findBy(["pagewidget"=>$this->entity]);
}
// Render
return $this->render($this->labelentity.':viewbookmark.html.twig', [
'entity' => $entity,
'canadd' => $canupdate,
'canupdate' => $canupdate,
return $this->getRender('viewbookmark.html.twig', [
'modedesktop' => $modedesktop,
'bookmarks' => $bookmarks,
'access' => $access,
'look' => $look,
'mini' => ($look=="list"&&$entity->getId()!=$selwidget),
]);
}

View File

@ -6,6 +6,12 @@
#R1C1:first-child {
margin-top: 30px;
}
.widget-mini .logo {
background-color: #{{color["main"]}};
padding: 3px;
border-radius: 100%;
}
{% endif %}
{% endblock %}
{% block pagewrapper %}

View File

@ -51,9 +51,6 @@
{% if canupdate %}
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
{% endif %}
{% if canadd %}
<i class="fa fa-plus fa-fw" title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" style="{{ stylewidgetmenu }}"></i>
{% endif %}
@ -113,7 +110,7 @@
</div>
{% endfor %}
{% if canadd %}
{% if canupdate %}
<div class="grid-item {{ stylegrid }}">
<div title="Ajouter un Favori" onClick="addBookmark({{ entity.id }},false)" class="grid-item-content" style="background-color: #{{color['main']}};cursor:pointer;">
<div class="item-link clearfix">

View File

@ -42,12 +42,18 @@
</div>
{% else %}
<div class="widget {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} widget-chat" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
{% if canupdate %}
<div class="widgetmenu">
{% if canupdate %}
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
</div>
{% endif %}
{% if look=="list" %}
<i class="glyphicon glyphicon-resize-small" title="Réduire le Widget" onClick="smallWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
{% else %}
<i class="glyphicon glyphicon-resize-full" title="Agrandir le Widget" onClick="bigWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
{% endif %}
</div>
{% if onheader %}

View File

@ -53,7 +53,7 @@
<div class="widgetheader" style="{{ stylewidgetheader }}">
{% if icon %}
<img src="/{{ alias }}{{ icon }}" class="logo" />
<img src="/{{ alias }}{{ icon }}" class="logo" style="border-radius:100%"/>
{% else %}
<img src="/{{ alias }}/uploads/icon/icon_users.png" class="logo"/>
{% endif %}