petit ajustement look sur pagewidget look list
This commit is contained in:
parent
b648fecb32
commit
bd547d9a21
|
@ -1085,55 +1085,32 @@ 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) {
|
||||
switch($parameter["id"]) {
|
||||
case "modedesktop":
|
||||
$modedesktop=$parameter["value"];
|
||||
break;
|
||||
$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"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Bookmark du widget
|
||||
$bookmarks=$this->em->getRepository("CadolesPortalBundle:Bookmark")->findBy(["pagewidget"=>$this->entity]);
|
||||
}
|
||||
|
||||
// Préference utilisateur
|
||||
$this->getPreference($entity);
|
||||
|
||||
// Profilage
|
||||
$user=$this->getUser();
|
||||
|
||||
// Bookmark du widget
|
||||
$bookmarks=$em->getRepository("CadolesPortalBundle:Bookmark")->findBy(["pagewidget"=>$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),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
{% 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>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
{% if onheader %}
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in New Issue