This commit is contained in:
Florian Bouillon 2019-03-06 09:43:45 +01:00
parent 110bb31616
commit 47524fec34
6 changed files with 47 additions and 9 deletions

View File

@ -938,3 +938,24 @@ table {
.bloc-filter label { .bloc-filter label {
width: 80%; width: 80%;
} }
.post u {
font-weight: 700;
}
.post i {
font-style: italic;
}
.post ol {
list-style: decimal-leading-zero;
}
.post ul {
list-style: disc;
}
.bloc-search a {
color: inherit;
text-decoration: inherit;
}

View File

@ -5,6 +5,7 @@
<script src="/assets/js/script.js" defer=""></script> <script src="/assets/js/script.js" defer=""></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" /> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" />
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote.css" rel="stylesheet" /> <link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote.css" rel="stylesheet" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote.js"></script>

View File

@ -9,7 +9,7 @@
<tag type="includes" file="header" /> <tag type="includes" file="header" />
</header> </header>
<main class="container"> <main class="container">
<div class="bloc-recent"> <div class="bloc-recent recent">
<div class="contenue-recent-search"> <div class="contenue-recent-search">
<div class="titre-recent"> <div class="titre-recent">
<p>récent</p> <p>récent</p>
@ -19,7 +19,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <tag type="search" /> -->
<div class="bloc-search"> <div class="bloc-search">
<tag type="loop" limit="20"> <tag type="loop" limit="20">
<a class="column-link"> <a class="column-link">

View File

@ -102,8 +102,10 @@ var submit = () => {
http.open("POST", "./", true); http.open("POST", "./", true);
http.onreadystatechange = function() {//Call a function when the state changes. http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) { if(http.readyState == 4 && http.status == 200) {
document.write(http.responseText); // document.write(http.responseText);
// window.location = window.location.href.replace("edit/", ""); let href = window.location.href.replace("edit/", "");
href.replace("new/", "");
window.location = href;
} }
} }
http.send(data); http.send(data);
@ -124,7 +126,23 @@ document.querySelectorAll(".filtre").forEach(function(el) {
var tag = (tagW != null ? "&tag=" + tagW : ""); var tag = (tagW != null ? "&tag=" + tagW : "");
var termW = new URL(window.location).searchParams.get("term"); var termW = new URL(window.location).searchParams.get("term");
var term = (termW != null ? "&term=" + termW : ""); var term = (termW != null ? "&term=" + termW : "");
window.location = "/search/?category=" + this.getAttribute("data-category") + tag + term; var recentW = new URL(window.location).searchParams.get("recent");
var recent = (recentW != null ? "&recent=" + recentW : "");
window.location = "/search/?category=" + this.getAttribute("data-category") + tag + term + recent;
})
})
document.querySelectorAll(".recent").forEach(function(el) {
el.addEventListener("click", function() {
var tagW = new URL(window.location).searchParams.get("tag");
var tag = (tagW != null ? "&tag=" + tagW : "");
var termW = new URL(window.location).searchParams.get("term");
var term = (termW != null ? "&term=" + termW : "");
var recentW = new URL(window.location).searchParams.get("recent");
var recent = "?recent=" + (recentW != null && recentW == "false" ? "true" : "false");
var categoryW = new URL(window.location).searchParams.get("category");
var cetagory = (categoryW != null ? "&category=" + categoryW : "");
window.location = "/search/" + recent + tag + term + cetagory;
}) })
}) })
@ -145,15 +163,13 @@ $(document).ready(function() {
} }
}, },
toolbar: [ toolbar: [
['style', ['style']],
['font', ['bold', 'italic', 'underline', 'clear']], ['font', ['bold', 'italic', 'underline', 'clear']],
['fontname', ['fontname']],
['color', ['color']], ['color', ['color']],
['para', ['ul', 'ol', 'paragraph']], ['para', ['ul', 'ol', 'paragraph']],
['height', ['height']], ['height', ['height']],
['table', ['table']], ['table', ['table']],
['insert', ['link', 'picture', 'hr']], ['insert', ['link', 'picture', 'hr']],
['view', ['fullscreen', 'codeview']], ['view', ['codeview']],
['help', ['help']] ['help', ['help']]
] ]
}); });

View File

@ -20,6 +20,7 @@ class Tags extends Tag {
$url = "?tag=" . $tag->getId(); $url = "?tag=" . $tag->getId();
if(isset($_GET["term"])) $url .= "&term=" . $_GET["term"]; if(isset($_GET["term"])) $url .= "&term=" . $_GET["term"];
if(isset($_GET["category"])) $url .= "&category=" . $_GET["category"]; if(isset($_GET["category"])) $url .= "&category=" . $_GET["category"];
if(isset($_GET["recent"])) $url .= "&recent=" . $_GET["recent"];
$res->setAttribute("href", "/search/" . $url); $res->setAttribute("href", "/search/" . $url);
$classes = "tag"; $classes = "tag";
if(isset($_GET["tag"]) && $tag->getId() == $_GET["tag"]) $classes .= " active"; if(isset($_GET["tag"]) && $tag->getId() == $_GET["tag"]) $classes .= " active";

View File

@ -245,7 +245,7 @@ class Post {
$content = $post->getContent(); $content = $post->getContent();
$category = $post->getCategory()->getId(); $category = $post->getCategory()->getId();
$author = $post->getAuthor()->getId(); $author = $post->getAuthor()->getId();
$dt = (new DateTime())->format("d/m/Y h:i:s"); $dt = (new DateTime())->format("d/m/Y");
$pdo = Functions::connect(); $pdo = Functions::connect();