Commit a3fbbdfd authored by Marianne's avatar Marianne

css livvvvve

parent 77df3cb8
......@@ -32,24 +32,24 @@ class __TwigTemplate_e2605bc4f884de1c2debcc97ac51a5dc521c94e7d8e947ad67852e4d274
";
// line 5
$this->displayBlock('head', $context, $blocks);
// line 21
// line 20
echo "</head>
<body>
";
// line 24
// line 23
$this->displayBlock('header', $context, $blocks);
// line 26
// line 25
echo "
";
// line 27
// line 26
$this->displayBlock('body', $context, $blocks);
// line 29
// line 28
echo "
";
// line 30
// line 29
$this->displayBlock('javascripts', $context, $blocks);
// line 33
// line 32
echo $this->getAttribute(($context["assets"] ?? null), "js", [], "method");
echo "
......@@ -79,16 +79,14 @@ class __TwigTemplate_e2605bc4f884de1c2debcc97ac51a5dc521c94e7d8e947ad67852e4d274
// line 11
echo " ";
$this->displayBlock('stylesheets', $context, $blocks);
// line 16
// line 17
echo " ";
echo $this->getAttribute(($context["assets"] ?? null), "css", [], "method");
echo "
<style type=\"text/css\" id=\"style\">
";
";
// line 18
echo $this->env->getExtension('Grav\Plugin\PadTwigExtension')->padToCss();
echo "
</style>
";
}
......@@ -100,28 +98,31 @@ class __TwigTemplate_e2605bc4f884de1c2debcc97ac51a5dc521c94e7d8e947ad67852e4d274
$this->getAttribute(($context["assets"] ?? null), "addCss", [0 => "theme://assets/css/main.css", 1 => 100], "method");
// line 13
echo " ";
if (($this->getAttribute(($context["page"] ?? null), "template", []) == "poster")) {
if ((($this->getAttribute(($context["page"] ?? null), "template", []) == "poster") && ($this->getAttribute($this->getAttribute(($context["page"] ?? null), "parent", []), "route", []) == $this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "plugins", []), "padtocss", []), "historyRoute", [])))) {
// line 14
echo " ";
echo " <link rel=\"stylesheet\" type=\"text/css\" href=\"/2019/01-fig/tools-for-fig/site/user/pages/historique/";
echo $this->getAttribute(($context["page"] ?? null), "folder", []);
echo "/pad.css\">
";
}
// line 15
// line 16
echo " ";
}
// line 24
// line 23
public function block_header($context, array $blocks = [])
{
}
// line 27
// line 26
public function block_body($context, array $blocks = [])
{
}
// line 30
// line 29
public function block_javascripts($context, array $blocks = [])
{
// line 31
// line 30
echo " ";
$this->getAttribute(($context["assets"] ?? null), "addJs", [0 => "theme://assets/js/main.js", 1 => 100], "method");
}
......@@ -138,7 +139,7 @@ class __TwigTemplate_e2605bc4f884de1c2debcc97ac51a5dc521c94e7d8e947ad67852e4d274
public function getDebugInfo()
{
return array ( 125 => 31, 122 => 30, 117 => 27, 112 => 24, 108 => 15, 105 => 14, 102 => 13, 99 => 12, 96 => 11, 89 => 18, 83 => 16, 80 => 11, 78 => 10, 68 => 7, 65 => 6, 62 => 5, 53 => 33, 51 => 30, 48 => 29, 46 => 27, 43 => 26, 41 => 24, 36 => 21, 34 => 5, 29 => 3, 26 => 2, 24 => 1,);
return array ( 126 => 30, 123 => 29, 118 => 26, 113 => 23, 109 => 16, 103 => 14, 100 => 13, 97 => 12, 94 => 11, 88 => 18, 83 => 17, 80 => 11, 78 => 10, 68 => 7, 65 => 6, 62 => 5, 53 => 32, 51 => 29, 48 => 28, 46 => 26, 43 => 25, 41 => 23, 36 => 20, 34 => 5, 29 => 3, 26 => 2, 24 => 1,);
}
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
......@@ -163,13 +164,12 @@ class __TwigTemplate_e2605bc4f884de1c2debcc97ac51a5dc521c94e7d8e947ad67852e4d274
{% include 'partials/metadata.html.twig' %}
{% block stylesheets %}
{% do assets.addCss('theme://assets/css/main.css', 100) %}
{% if page.template == \"poster\" %}
{% if page.template == \"poster\" and page.parent.route == config.plugins.padtocss.historyRoute %}
<link rel=\"stylesheet\" type=\"text/css\" href=\"/2019/01-fig/tools-for-fig/site/user/pages/historique/{{ page.folder }}/pad.css\">
{% endif %}
{% endblock %}
{{ assets.css() }}
<style type=\"text/css\" id=\"style\">
{{ loadPad() }}
</style>
{{ loadPad() }}
{% endblock head %}
</head>
<body>
......
......@@ -32,24 +32,24 @@ class __TwigTemplate_4bd349af12852d014a4938a1974aff3f501394ff3e6526367483f15acbe
";
// line 5
$this->displayBlock('head', $context, $blocks);
// line 21
// line 20
echo "</head>
<body>
";
// line 24
// line 23
$this->displayBlock('header', $context, $blocks);
// line 26
// line 25
echo "
";
// line 27
// line 26
$this->displayBlock('body', $context, $blocks);
// line 29
// line 28
echo "
";
// line 30
// line 29
$this->displayBlock('javascripts', $context, $blocks);
// line 33
// line 32
echo $this->getAttribute(($context["assets"] ?? null), "js", [], "method");
echo "
......@@ -79,16 +79,14 @@ class __TwigTemplate_4bd349af12852d014a4938a1974aff3f501394ff3e6526367483f15acbe
// line 11
echo " ";
$this->displayBlock('stylesheets', $context, $blocks);
// line 16
// line 17
echo " ";
echo $this->getAttribute(($context["assets"] ?? null), "css", [], "method");
echo "
<style type=\"text/css\" id=\"style\">
";
";
// line 18
echo call_user_func_array($this->env->getFunction('loadPad')->getCallable(), []);
echo "
</style>
";
}
......@@ -100,28 +98,31 @@ class __TwigTemplate_4bd349af12852d014a4938a1974aff3f501394ff3e6526367483f15acbe
$this->getAttribute(($context["assets"] ?? null), "addCss", [0 => "theme://assets/css/main.css", 1 => 100], "method");
// line 13
echo " ";
if (($this->getAttribute(($context["page"] ?? null), "template", []) == "poster")) {
if ((($this->getAttribute(($context["page"] ?? null), "template", []) == "poster") && ($this->getAttribute($this->getAttribute(($context["page"] ?? null), "parent", []), "route", []) == $this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "plugins", []), "padtocss", []), "historyRoute", [])))) {
// line 14
echo " ";
echo " <link rel=\"stylesheet\" type=\"text/css\" href=\"/2019/01-fig/tools-for-fig/site/user/pages/historique/";
echo $this->getAttribute(($context["page"] ?? null), "folder", []);
echo "/pad.css\">
";
}
// line 15
// line 16
echo " ";
}
// line 24
// line 23
public function block_header($context, array $blocks = [])
{
}
// line 27
// line 26
public function block_body($context, array $blocks = [])
{
}
// line 30
// line 29
public function block_javascripts($context, array $blocks = [])
{
// line 31
// line 30
echo " ";
$this->getAttribute(($context["assets"] ?? null), "addJs", [0 => "theme://assets/js/main.js", 1 => 100], "method");
}
......@@ -138,7 +139,7 @@ class __TwigTemplate_4bd349af12852d014a4938a1974aff3f501394ff3e6526367483f15acbe
public function getDebugInfo()
{
return array ( 125 => 31, 122 => 30, 117 => 27, 112 => 24, 108 => 15, 105 => 14, 102 => 13, 99 => 12, 96 => 11, 89 => 18, 83 => 16, 80 => 11, 78 => 10, 68 => 7, 65 => 6, 62 => 5, 53 => 33, 51 => 30, 48 => 29, 46 => 27, 43 => 26, 41 => 24, 36 => 21, 34 => 5, 29 => 3, 26 => 2, 24 => 1,);
return array ( 126 => 30, 123 => 29, 118 => 26, 113 => 23, 109 => 16, 103 => 14, 100 => 13, 97 => 12, 94 => 11, 88 => 18, 83 => 17, 80 => 11, 78 => 10, 68 => 7, 65 => 6, 62 => 5, 53 => 32, 51 => 29, 48 => 28, 46 => 26, 43 => 25, 41 => 23, 36 => 20, 34 => 5, 29 => 3, 26 => 2, 24 => 1,);
}
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
......@@ -163,13 +164,12 @@ class __TwigTemplate_4bd349af12852d014a4938a1974aff3f501394ff3e6526367483f15acbe
{% include 'partials/metadata.html.twig' %}
{% block stylesheets %}
{% do assets.addCss('theme://assets/css/main.css', 100) %}
{% if page.template == \"poster\" %}
{% if page.template == \"poster\" and page.parent.route == config.plugins.padtocss.historyRoute %}
<link rel=\"stylesheet\" type=\"text/css\" href=\"/2019/01-fig/tools-for-fig/site/user/pages/historique/{{ page.folder }}/pad.css\">
{% endif %}
{% endblock %}
{{ assets.css() }}
<style type=\"text/css\" id=\"style\">
{{ loadPad() }}
</style>
{{ loadPad() }}
{% endblock head %}
</head>
<body>
......
This diff is collapsed.
{"09-02-2019":154,"12-02-2019":30,"13-02-2019":611,"14-02-2019":142}
\ No newline at end of file
{"09-02-2019":154,"12-02-2019":30,"13-02-2019":611,"14-02-2019":236}
\ No newline at end of file
{"02-2019":937}
\ No newline at end of file
{"02-2019":1031}
\ No newline at end of file
{"\/":676,"\/index":9,"\/jean-pierre-fourchette":8,"\/1962-versioned-physical-sculptures":135,"\/historique":42,"\/historique\/bisous":13,"\/get-css":33,"\/historique\/poster_1550143089":21}
\ No newline at end of file
{"\/":766,"\/index":9,"\/jean-pierre-fourchette":8,"\/1962-versioned-physical-sculptures":135,"\/historique":42,"\/historique\/bisous":13,"\/get-css":33,"\/historique\/poster_1550143089":25}
\ No newline at end of file
{"363baea9cba210afac6d7a556fca596e30c46333":1550144848,"25ba44ec3b391ba4ce5fbbd2979635e254775e7d":1549740367}
\ No newline at end of file
{"363baea9cba210afac6d7a556fca596e30c46333":1550148600,"25ba44ec3b391ba4ce5fbbd2979635e254775e7d":1549740367}
\ No newline at end of file
---
title: Ressources
title: Poster
routable: true
visible: true
media_order: ''
......
......@@ -52,14 +52,19 @@ class PadtocssPlugin extends Plugin{
}
public function fileRoute(){
$posterRoute = $this->posterRoute();
return "user/pages/".$posterRoute."/pad.css";
}
public function onTwigExtensions(){
if ($this->isPosterPage()){
$css = $this->getCss();
$file = $this->fileRoute();
$css = file_get_contents($file);
require_once(__DIR__ . '/twig/PadTwigExtension.php');
$this->grav['twig']->twig->addExtension(new PadTwigExtension($css));
......@@ -71,10 +76,10 @@ class PadtocssPlugin extends Plugin{
public function onPluginsInitialized(){
if ($this->isPosterPage()){
$file = $this->fileRoute();
$css = $this->getCss();
$posterRoute = $this->posterRoute();
$file = "user/pages/".$posterRoute."/pad.css";
file_put_contents($file, $css);
......
......@@ -23,6 +23,6 @@ class PadTwigExtension extends \Twig_Extension{
public function padToCss(){
return $this->css;
return '<style type="text/css" id="style">'.$this->css."</style>";
}
}
\ No newline at end of file
......@@ -3,7 +3,15 @@ function ajax(receiver, target){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange=function() {
if (this.readyState == 4 && this.status == 200) {
receiver.innerHTML = this.responseText;
var str = '<style type="text/css" id="style">';
var begin = this.responseText.indexOf(str);
var l = str.length;
var end = this.responseText.indexOf("</style>");
var length = end-(begin+l);
receiver.innerText= this.responseText.substr(begin+l, length);
}
};
xhttp.open("GET", target);
......@@ -15,12 +23,14 @@ function refresh(){
var receiver = document.getElementById("style");
var button = document.getElementById("refresh");
var target = receiver.dataset.pad;
var target = window.location.href;
button.addEventListener("click", function(){
ajax(receiver, target);
});
}
......
......@@ -10,13 +10,12 @@
{% include 'partials/metadata.html.twig' %}
{% block stylesheets %}
{% do assets.addCss('theme://assets/css/main.css', 100) %}
{% if page.template == "poster" %}
{% if page.template == "poster" and page.parent.route == config.plugins.padtocss.historyRoute %}
<link rel="stylesheet" type="text/css" href="/2019/01-fig/tools-for-fig/site/user/pages/historique/{{ page.folder }}/pad.css">
{% endif %}
{% endblock %}
{{ assets.css() }}
<style type="text/css" id="style">
{{ loadPad() }}
</style>
{{ loadPad() }}
{% endblock head %}
</head>
<body>
......
{% extends 'partials/base.html.twig' %}
{% set about = pages.find("/fig-festival") %}
{% set path = (page.parent.slug != "historique") ? "" : "../" %}
{% block body %}
<main>
<section id="poster">
......@@ -34,8 +33,8 @@
<div class="images">
{% for image in resource.header.images %}
<div class="image">
{% set path = (page.parent.route == config.plugins.padtocss.historyRoute) ? "../user/pages/" ~ page.parent.folder ~ "/" ~ page.folder ~ "/" ~ resource.folder ~ "/" ~ image.name : "user/pages/" ~ page.folder ~ "/" ~ resource.folder ~ "/" ~ image.name %}
<img src="{{ path }}">
{% set imgPath = (page.parent.route == config.plugins.padtocss.historyRoute) ? "../user/pages/" ~ page.parent.folder ~ "/" ~ page.folder ~ "/" ~ resource.folder ~ "/" ~ image.name : "user/pages/" ~ page.folder ~ "/" ~ resource.folder ~ "/" ~ image.name %}
<img src="{{ imgPath }}">
</div>
{% endfor %}
</div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment