svg
This commit is contained in:
parent
829e99318b
commit
51a9b9dfd6
@ -91,6 +91,15 @@ class CropController extends AbstractController
|
||||
$thumb_image_location = "uploads/$type/thumb_".$file;
|
||||
$cropped = $this->resizeThumbnailImage($thumb_image_location, $large_image_location,$data["ws"],$data["hs"],$data["xs"],$data["ys"],$scale);
|
||||
|
||||
if($type=="illustration") {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$illustration=$em->getRepository("App:Illustration")->findOneBy(["illustration"=>$file]);
|
||||
if($illustration) {
|
||||
$illustration->setUpdatetime(new \DateTime());
|
||||
$em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('Crop/crop03.html.twig', [
|
||||
'useheader' => false,
|
||||
'usesidebar' => false,
|
||||
|
@ -13,20 +13,6 @@ class HomeController extends AbstractController
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
if($this->getUser()) {
|
||||
// Entete
|
||||
$headers = ['Accept' => 'application/json', 'key' => $this->getParameter("appNinegatesecret")];
|
||||
$query = [];
|
||||
$url=$this->getParameter("appNinegateurl");
|
||||
// Paramétrage unirest
|
||||
|
||||
\Unirest\Request::verifyPeer(false);
|
||||
\Unirest\Request::verifyHost(false);
|
||||
\Unirest\Request::timeout(5);
|
||||
//dd($url.'/rest/user/'.$this->getUser()->getUsername());
|
||||
$response = \Unirest\Request::get($url.'/rest/user/'.$this->getUser()->getUsername(),$headers,["only"=>"user,groups"]);
|
||||
}
|
||||
|
||||
$users = $em->getRepository("App:User")->findBy([],["pseudo"=>"ASC"]);
|
||||
$illustrations = $em->getRepository("App:Illustration")->findBy([],["submittime"=>"DESC"]);
|
||||
$links = $em->getRepository("App:Link")->findBy(["user"=>null]);
|
||||
|
@ -81,6 +81,7 @@ class IllustrationController extends AbstractController
|
||||
if ($form->get('submit')->isClicked() && $form->isValid()) {
|
||||
$data = $form->getData();
|
||||
$data->setSubmittime(new \DateTime());
|
||||
$data->setUpdatetime(new \DateTime());
|
||||
$em->persist($data);
|
||||
$em->flush();
|
||||
|
||||
|
@ -34,6 +34,11 @@ class Illustration
|
||||
*/
|
||||
private $submittime;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
private $updatetime;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
@ -95,6 +100,18 @@ class Illustration
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUpdatetime(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->updatetime;
|
||||
}
|
||||
|
||||
public function setUpdatetime(\DateTimeInterface $updatetime): self
|
||||
{
|
||||
$this->updatetime = $updatetime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getWidth(): ?int
|
||||
{
|
||||
return $this->width;
|
||||
|
@ -310,9 +310,9 @@
|
||||
{% if appthumbheight!=0 %}
|
||||
{% set source="thumbori_"~illustration.illustration %}
|
||||
{% endif %}
|
||||
|
||||
{% set source=source~"?"~illustration.updatetime|date('ymdHis') %}
|
||||
<a href="{{ path("app_illustration_view",{"by":"home","idcat":illustration.category.id,"id":illustration.id}) }}">
|
||||
<div id="illustration{{illustration.id}}" class="grid-item grid-item-size {{class}} {{classmini}} cssfilter no-cache-bg" data-width="{{illustration.width}}" data-background-image="/{{ appAlias }}/uploads/illustration/{{source}}" data-height="{{illustration.height}}" style="height:auto;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/illustration/{{source}}");">
|
||||
<div id="illustration{{illustration.id}}" class="grid-item grid-item-size {{class}} {{classmini}} cssfilter" data-width="{{illustration.width}}" data-background-image="/{{ appAlias }}/uploads/illustration/{{source}}" data-height="{{illustration.height}}" style="height:auto;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/illustration/{{source}}");">
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
@ -338,7 +338,7 @@
|
||||
{% set class=" grid-item-size-2 grid-item-size-page" %}
|
||||
|
||||
<a href="{{ path("app_webzine_view",{"by":"home","idcat":webzine.id,"id":page.id}) }}">
|
||||
<div id="webzine{{webzine.id}}" class="grid-item grid-item-size {{class}} cssfilter no-cache-bg" data-width="{{page.width}}" data-background-image="/{{ appAlias }}/uploads/webzine/{{source}}" data-height="{{page.height}}" style="height:auto;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/webzine/{{source}}");">
|
||||
<div id="webzine{{webzine.id}}" class="grid-item grid-item-size {{class}} cssfilter" data-width="{{page.width}}" data-background-image="/{{ appAlias }}/uploads/webzine/{{source}}" data-height="{{page.height}}" style="height:auto;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/webzine/{{source}}");">
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
@ -393,28 +393,6 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
function getNoCacheBgElements() {
|
||||
return document.querySelectorAll('.no-cache-bg');
|
||||
}
|
||||
|
||||
function loadBgImageForElement(element) {
|
||||
element.style['background-image'] =
|
||||
'url('+ element.attributes['data-background-image'].value + '?' + (new Date()).getTime() +')';
|
||||
}
|
||||
|
||||
function loadBgImages() {
|
||||
for(
|
||||
var i = 0, elements = getNoCacheBgElements();
|
||||
i < elements.length;
|
||||
loadBgImageForElement(elements[i]), i++
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
window.onload = function() {
|
||||
loadBgImages();
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
$('body').imagesLoaded(function() {
|
||||
height=Math.max(500,$(window).height());
|
||||
|
@ -281,10 +281,10 @@
|
||||
{% if appthumbheight!=0 %}
|
||||
{% set source="thumbori_"~illustration.illustration %}
|
||||
{% endif %}
|
||||
|
||||
{% set source=source~"?"~illustration.updatetime|date('ymdHis') %}
|
||||
|
||||
<a href="{{ path("app_illustration_view",{"by":"user","idcat":category.id,"id":illustration.id}) }}">
|
||||
<div id="illustration{{illustration.id}}" class="grid-item grid-item-size {{class}} {{classmini}} cssfilter cssfilter-{{category.id}} no-cache-bg" data-width="{{illustration.width}}" data-background-image="/{{ appAlias }}/uploads/illustration/{{source}}" data-height="{{illustration.height}}" style="height:auto;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/illustration/{{source}}");">
|
||||
<div id="illustration{{illustration.id}}" class="grid-item grid-item-size {{class}} {{classmini}} cssfilter cssfilter-{{category.id}}" data-width="{{illustration.width}}" data-background-image="/{{ appAlias }}/uploads/illustration/{{source}}" data-height="{{illustration.height}}" style="height:auto;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/illustration/{{source}}");">
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
@ -311,7 +311,7 @@
|
||||
{% set class=" grid-item-size-2 grid-item-size-page" %}
|
||||
|
||||
<a href="{{ path("app_webzine_view",{"idcat":webzine.id,"id":page.id,"by":"user"}) }}">
|
||||
<div id="webzine{{webzine.id}}" class="grid-item grid-item-size {{class}} cssfilter no-cache-bg" data-width="{{page.width}}" data-background-image="/{{ appAlias }}/uploads/webzine/{{source}}" data-height="{{page.height}}" style="height:auto;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/webzine/{{source}}");">
|
||||
<div id="webzine{{webzine.id}}" class="grid-item grid-item-size {{class}} cssfilter" data-width="{{page.width}}" data-background-image="/{{ appAlias }}/uploads/webzine/{{source}}" data-height="{{page.height}}" style="height:auto;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/webzine/{{source}}");">
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
@ -400,28 +400,6 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
function getNoCacheBgElements() {
|
||||
return document.querySelectorAll('.no-cache-bg');
|
||||
}
|
||||
|
||||
function loadBgImageForElement(element) {
|
||||
element.style['background-image'] =
|
||||
'url('+ element.attributes['data-background-image'].value + '?' + (new Date()).getTime() +')';
|
||||
}
|
||||
|
||||
function loadBgImages() {
|
||||
for(
|
||||
var i = 0, elements = getNoCacheBgElements();
|
||||
i < elements.length;
|
||||
loadBgImageForElement(elements[i]), i++
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
window.onload = function() {
|
||||
loadBgImages();
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
$('body').imagesLoaded(function() {
|
||||
height=Math.max(500,$(window).height());
|
||||
|
@ -57,7 +57,7 @@ ILLUSTRATIONS
|
||||
{% set height=30*90/21 %}
|
||||
{% endif %}
|
||||
|
||||
<div style="width:90px; height:{{ height }}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/illustration/{{source}}?v={{ random(0, 10000) }}");">
|
||||
<div style="width:90px; height:{{ height }}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/illustration/{{source}}?{{illustration.updatetime|date('ymdHis')}});">
|
||||
|
||||
</td>
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
{% set height=30*90/21 %}
|
||||
{% endif %}
|
||||
|
||||
<div style="width:90px; height:{{ height }}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/illustration/{{source}}?v={{ random(0, 10000) }}");">
|
||||
<div style="width:90px; height:{{ height }}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/illustration/{{source}}?{{illustration.updatetime|date('ymdHis')}});">
|
||||
|
||||
</td>
|
||||
<td>{{ illustration.submittime|date("Y-m-d H:i") }}</td>
|
||||
|
Loading…
Reference in New Issue
Block a user