Work on blog
This commit is contained in:
@@ -118,11 +118,23 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.text-article p {
|
.text-article p {
|
||||||
padding-left: 2vw;
|
padding-left: 2vw;
|
||||||
padding-right:2vw;
|
padding-right:2vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-article pre {
|
||||||
|
padding-left: 2vw;
|
||||||
|
padding-right:2vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-article blockquote {
|
||||||
|
padding-left: 2vw;
|
||||||
|
padding-right:2vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.text-article h2, h3, h4, h5 {
|
.text-article h2, h3, h4, h5 {
|
||||||
padding-left: 1vw;
|
padding-left: 1vw;
|
||||||
padding-right:1vw;
|
padding-right:1vw;
|
||||||
|
|||||||
@@ -123,6 +123,16 @@ a {
|
|||||||
padding-right:2vw;
|
padding-right:2vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-article pre {
|
||||||
|
padding-left: 2vw;
|
||||||
|
padding-right:2vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-article blockquote {
|
||||||
|
padding-left: 2vw;
|
||||||
|
padding-right:2vw;
|
||||||
|
}
|
||||||
|
|
||||||
.text-article h2, h3, h4, h5 {
|
.text-article h2, h3, h4, h5 {
|
||||||
padding-left: 1vw;
|
padding-left: 1vw;
|
||||||
padding-right:1vw;
|
padding-right:1vw;
|
||||||
|
|||||||
@@ -124,6 +124,16 @@
|
|||||||
padding-right:2vw;
|
padding-right:2vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-article pre {
|
||||||
|
padding-left: 2vw;
|
||||||
|
padding-right:2vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-article blockquote {
|
||||||
|
padding-left: 2vw;
|
||||||
|
padding-right:2vw;
|
||||||
|
}
|
||||||
|
|
||||||
.text-article h2, h3, h4, h5 {
|
.text-article h2, h3, h4, h5 {
|
||||||
padding-left: 1vw;
|
padding-left: 1vw;
|
||||||
padding-right:1vw;
|
padding-right:1vw;
|
||||||
|
|||||||
@@ -123,6 +123,16 @@ a {
|
|||||||
padding-right:2vw;
|
padding-right:2vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-article pre {
|
||||||
|
padding-left: 2vw;
|
||||||
|
padding-right:2vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-article blockquote {
|
||||||
|
padding-left: 2vw;
|
||||||
|
padding-right:2vw;
|
||||||
|
}
|
||||||
|
|
||||||
.text-article h2, h3, h4, h5 {
|
.text-article h2, h3, h4, h5 {
|
||||||
padding-left: 1vw;
|
padding-left: 1vw;
|
||||||
padding-right:1vw;
|
padding-right:1vw;
|
||||||
|
|||||||
149
static/blog.css
149
static/blog.css
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
:root
|
:root
|
||||||
{
|
{
|
||||||
|
|
||||||
--color-background: #202020;
|
--color-background: #202020;
|
||||||
--color-title: #fdfdfd;
|
--color-title: #fdfdfd;
|
||||||
--color-text: #dddddd;
|
--color-text: #dddddd;
|
||||||
@@ -59,64 +58,64 @@ a {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slug {
|
.slug {
|
||||||
//margin-left: 1rem;
|
//margin-left: 1rem;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.readmore {
|
.readmore {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
white-space: pre-wrap; /* css-3 */
|
white-space: pre-wrap; /* css-3 */
|
||||||
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
|
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
|
||||||
white-space: -pre-wrap; /* Opera 4-6 */
|
white-space: -pre-wrap; /* Opera 4-6 */
|
||||||
white-space: -o-pre-wrap; /* Opera 7 */
|
white-space: -o-pre-wrap; /* Opera 7 */
|
||||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.articles {
|
.articles {
|
||||||
max-width: 80%;
|
max-width: 80%;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-top: 5rem;
|
margin-top: 5rem;
|
||||||
margin-bottom: 3rem;
|
margin-bottom: 3rem;
|
||||||
padding:0.5em;
|
padding:0.5em;
|
||||||
border: 7px double;
|
border: 7px double;
|
||||||
border-color: var(--text-color);
|
border-color: var(--text-color);
|
||||||
border-radius: 10px 10px 10px 10px;
|
border-radius: 10px 10px 10px 10px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
letter-spacing: 0.1vw;
|
letter-spacing: 0.1vw;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
}
|
}
|
||||||
|
|
||||||
.articles ul {
|
.articles ul {
|
||||||
list-style-type: disc;
|
list-style-type: disc;
|
||||||
margin: 5vw;
|
margin: 5vw;
|
||||||
padding-top: 1vw;
|
padding-top: 1vw;
|
||||||
padding-bottom: 1vw;
|
padding-bottom: 1vw;
|
||||||
padding-left: 1.5vw;
|
padding-left: 1.5vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.head-article {
|
.head-article {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.text-article p {
|
.text-article p {
|
||||||
@@ -124,13 +123,23 @@ a {
|
|||||||
padding-right:2vw;
|
padding-right:2vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-article pre {
|
||||||
|
padding-left: 2vw;
|
||||||
|
padding-right:2vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-article blockquote {
|
||||||
|
padding-left: 2vw;
|
||||||
|
padding-right:2vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.text-article h2, h3, h4, h5 {
|
.text-article h2, h3, h4, h5 {
|
||||||
padding-left: 1vw;
|
padding-left: 1vw;
|
||||||
padding-right:1vw;
|
padding-right:1vw;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.index {
|
.index {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
@@ -141,51 +150,49 @@ a {
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
margin-bottom: 2vw;
|
margin-bottom: 2vw;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.articles .description {
|
.articles .description {
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-size: 1.5vw;
|
font-size: 1.5vw;
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
color: ;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.pagination a {
|
.pagination a {
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
border-color: $color_title;
|
border-color: $color_title;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact{
|
||||||
|
text-align:center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contact{
|
footer {
|
||||||
text-align:center;
|
position: relative;
|
||||||
}
|
bottom:0px;
|
||||||
|
width: 100%;
|
||||||
footer {
|
text-align:center;
|
||||||
position: relative;
|
padding-bottom:1vw;
|
||||||
bottom:0px;
|
}
|
||||||
width: 100%;
|
|
||||||
text-align:center;
|
|
||||||
padding-bottom:1vw;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@media only screen and (max-width: 980px)
|
@media only screen and (max-width: 980px)
|
||||||
{
|
{
|
||||||
|
|
||||||
.articles .description {
|
.articles .description {
|
||||||
font-size: 4vw;
|
font-size: 4vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.articles {
|
.articles {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
|||||||
79
static/code.css
Normal file
79
static/code.css
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
pre { line-height: 125%; }
|
||||||
|
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
|
.codehilite .hll { background-color: #ffffcc }
|
||||||
|
.codehilite { background-color: rgba(200,200,200,0.1);
|
||||||
|
margin: 2vw;
|
||||||
|
padding-bottom: 1vw;
|
||||||
|
padding-top: 1vw;
|
||||||
|
}
|
||||||
|
.codehilite .c { color: #3D7B7B; font-style: italic } /* Comment */
|
||||||
|
.codehilite .err { border: 1px solid #F00 } /* Error */
|
||||||
|
.codehilite .k { color: #008000; font-weight: bold } /* Keyword */
|
||||||
|
.codehilite .o { color: #666 } /* Operator */
|
||||||
|
.codehilite .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
|
||||||
|
.codehilite .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
|
||||||
|
.codehilite .cp { color: #9C6500 } /* Comment.Preproc */
|
||||||
|
.codehilite .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
|
||||||
|
.codehilite .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
|
||||||
|
.codehilite .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
|
||||||
|
.codehilite .gd { color: #A00000 } /* Generic.Deleted */
|
||||||
|
.codehilite .ge { font-style: italic } /* Generic.Emph */
|
||||||
|
.codehilite .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
|
||||||
|
.codehilite .gr { color: #E40000 } /* Generic.Error */
|
||||||
|
.codehilite .gh { color: #077080; font-weight: bold } /* Generic.Heading */
|
||||||
|
.codehilite .gi { color: #008400 } /* Generic.Inserted */
|
||||||
|
.codehilite .go { color: #717171 } /* Generic.Output */
|
||||||
|
.codehilite .gp { color: #077080; font-weight: bold } /* Generic.Prompt */
|
||||||
|
.codehilite .gs { font-weight: bold } /* Generic.Strong */
|
||||||
|
.codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
||||||
|
.codehilite .gt { color: #04D } /* Generic.Traceback */
|
||||||
|
.codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
|
||||||
|
.codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
|
||||||
|
.codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
|
||||||
|
.codehilite .kp { color: #008000 } /* Keyword.Pseudo */
|
||||||
|
.codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
|
||||||
|
.codehilite .kt { color: #B00040 } /* Keyword.Type */
|
||||||
|
.codehilite .m { color: #666 } /* Literal.Number */
|
||||||
|
.codehilite .s { color: #BA2121 } /* Literal.String */
|
||||||
|
.codehilite .na { color: #687822 } /* Name.Attribute */
|
||||||
|
.codehilite .nb { color: #008000 } /* Name.Builtin */
|
||||||
|
.codehilite .nc { color: #00F; font-weight: bold } /* Name.Class */
|
||||||
|
.codehilite .no { color: #800 } /* Name.Constant */
|
||||||
|
.codehilite .nd { color: #A2F } /* Name.Decorator */
|
||||||
|
.codehilite .ni { color: #717171; font-weight: bold } /* Name.Entity */
|
||||||
|
.codehilite .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
|
||||||
|
.codehilite .nf { color: #00F } /* Name.Function */
|
||||||
|
.codehilite .nl { color: #767600 } /* Name.Label */
|
||||||
|
.codehilite .nn { color: #00F; font-weight: bold } /* Name.Namespace */
|
||||||
|
.codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */
|
||||||
|
.codehilite .nv { color: #79499C } /* Name.Variable */
|
||||||
|
.codehilite .ow { color: #A2F; font-weight: bold } /* Operator.Word */
|
||||||
|
.codehilite .w { color: #BBB } /* Text.Whitespace */
|
||||||
|
.codehilite .mb { color: #666 } /* Literal.Number.Bin */
|
||||||
|
.codehilite .mf { color: #666 } /* Literal.Number.Float */
|
||||||
|
.codehilite .mh { color: #666 } /* Literal.Number.Hex */
|
||||||
|
.codehilite .mi { color: #666 } /* Literal.Number.Integer */
|
||||||
|
.codehilite .mo { color: #666 } /* Literal.Number.Oct */
|
||||||
|
.codehilite .sa { color: #BA2121 } /* Literal.String.Affix */
|
||||||
|
.codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */
|
||||||
|
.codehilite .sc { color: #BA2121 } /* Literal.String.Char */
|
||||||
|
.codehilite .dl { color: #BA2121 } /* Literal.String.Delimiter */
|
||||||
|
.codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
|
||||||
|
.codehilite .s2 { color: #BA2121 } /* Literal.String.Double */
|
||||||
|
.codehilite .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
|
||||||
|
.codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */
|
||||||
|
.codehilite .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
|
||||||
|
.codehilite .sx { color: #008000 } /* Literal.String.Other */
|
||||||
|
.codehilite .sr { color: #A45A77 } /* Literal.String.Regex */
|
||||||
|
.codehilite .s1 { color: #BA2121 } /* Literal.String.Single */
|
||||||
|
.codehilite .ss { color: #19177C } /* Literal.String.Symbol */
|
||||||
|
.codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */
|
||||||
|
.codehilite .fm { color: #00F } /* Name.Function.Magic */
|
||||||
|
.codehilite .vc { color: #19177C } /* Name.Variable.Class */
|
||||||
|
.codehilite .vg { color: #19177C } /* Name.Variable.Global */
|
||||||
|
.codehilite .vi { color: #19177C } /* Name.Variable.Instance */
|
||||||
|
.codehilite .vm { color: #19177C } /* Name.Variable.Magic */
|
||||||
|
.codehilite .il { color: #666 } /* Literal.Number.Integer.Long */
|
||||||
@@ -65,9 +65,10 @@ main > nav
|
|||||||
|
|
||||||
|
|
||||||
article {
|
article {
|
||||||
text-align: center;
|
width: 44vw;
|
||||||
width: 30vw;
|
max-height: 35vw;
|
||||||
height: 35vw;
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
article > header {
|
article > header {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title> Article de {{ post_info.author }} </title>
|
<title> Article de {{ post_info.author }} </title>
|
||||||
|
<link rel="stylesheet" href="/static/code.css" type="text/css">
|
||||||
<link rel="stylesheet" href="/{{ post_info.author }}/blog.css" type="text/css">
|
<link rel="stylesheet" href="/{{ post_info.author }}/blog.css" type="text/css">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,11 @@
|
|||||||
{% block main %}
|
{% block main %}
|
||||||
|
|
||||||
|
|
||||||
<form action="" method="POST" id="postform" >
|
<form action="" method="POST" id="postform" hx-post="/myblog/update/{{ oldpost['title'] }}" hx-target="#confirm">
|
||||||
<input type="text" name="title" id="title" placeholder="titre" class="form-control" value="{{ oldpost['title'] }}"><br />
|
<input type="text" name="title" id="title" placeholder="titre" class="form-control" value="{{ oldpost['title'] }}"><br />
|
||||||
<input type="text" name="subtitle" id="subtitle" placeholder="sous-titre" class="form-control" value="{{ oldpost['subtitle'] }}"><br />
|
<input type="text" name="subtitle" id="subtitle" placeholder="sous-titre" class="form-control" value="{{ oldpost['subtitle'] }}"><br />
|
||||||
<input type="text" name="category" id="category" placeholder="Catégorie" class="form-control" value="{{ oldpost['category'] }}"><br />
|
<input type="text" name="category" id="category" placeholder="Catégorie" class="form-control" value="{{ oldpost['category'] }}"><br />
|
||||||
<textarea id="editeurMarkdown" class="form-control" form="postform" name="content" id="content" placeholder="Contenu" style="height:20vw;">{{ oldpost['content'] }}</textarea>
|
<textarea id="editeurMarkdown" class="form-control" form="postform" name="content" placeholder="Contenu" style="height:20vw;">{{ oldpost['content'] }}</textarea>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
@@ -51,7 +51,8 @@
|
|||||||
Publier cet article dans le blog général
|
Publier cet article dans le blog général
|
||||||
</label>
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<div class="flashed {{ categorie }}" id="confirm">
|
||||||
|
</div>
|
||||||
<button type="submit"> Mettre à jour </button>
|
<button type="submit"> Mettre à jour </button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@@ -59,5 +60,6 @@
|
|||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
{% include '_js_editor.html' %}
|
{% include '_js_editor.html' %}
|
||||||
|
{% include '_js_htmx.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from flask import Blueprint, render_template, session, redirect, url_for, request, flash, abort, Flask
|
from flask import Blueprint, render_template, session, redirect, url_for, request, flash, abort, Flask, make_response
|
||||||
import time
|
import time
|
||||||
from markupsafe import escape
|
from markupsafe import escape
|
||||||
import sqlite3
|
import sqlite3
|
||||||
@@ -24,6 +24,9 @@ DOSSIER_PERSO = app.config.get('DOSSIER_APP')+'/'
|
|||||||
DOSSIER_PUBLIC = app.config.get('DOSSIER_PUBLIC')+'/'
|
DOSSIER_PUBLIC = app.config.get('DOSSIER_PUBLIC')+'/'
|
||||||
TITLE_SERVER = app.config.get('TITLE_SERVER')
|
TITLE_SERVER = app.config.get('TITLE_SERVER')
|
||||||
DESC_SERVER = app.config.get('DESC_SERVER')
|
DESC_SERVER = app.config.get('DESC_SERVER')
|
||||||
|
MARKDOWN_EXT=["extra", "toc", "codehilite",
|
||||||
|
"nl2br", "extra", "admonition",
|
||||||
|
"sane_lists", "smarty"]
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
@blog.route('/myblog/new-article/', methods=['GET', 'POST'])
|
@blog.route('/myblog/new-article/', methods=['GET', 'POST'])
|
||||||
@@ -82,6 +85,28 @@ def edit(title):
|
|||||||
oldpost=post)
|
oldpost=post)
|
||||||
|
|
||||||
|
|
||||||
|
@blog.route('/myblog/update/<title>', methods=['POST'])
|
||||||
|
@login_required
|
||||||
|
def update(title):
|
||||||
|
user='%s'% escape(session['username'])
|
||||||
|
folder_blog = DOSSIER_PERSO + user + "/blog/articles/"
|
||||||
|
newtitle = str(request.form['title'])
|
||||||
|
subtitle = str(request.form['subtitle'])
|
||||||
|
category = str(request.form['category'])
|
||||||
|
newcontent = str(request.form['content'])
|
||||||
|
newstatus = str(request.form['status'])
|
||||||
|
updated = time.strftime("%d/%m/%Y à %H:%M:%S")
|
||||||
|
conn = sqlite3.connect(DATABASE)
|
||||||
|
cursor = conn.cursor()
|
||||||
|
if 'blog-unified' in request.form.keys():
|
||||||
|
newstatus = newstatus+'_unified'
|
||||||
|
|
||||||
|
cursor.execute("""UPDATE Blog_posts SET title=?, subtitle=?, category=?, last_updated=?, status=?, content=? WHERE title=? AND author=?""", (newtitle, subtitle, category, updated, newstatus, newcontent, title, user))
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
response = """ <p class="center success" >Article mis à jour le """+ updated +""" .</p>"""
|
||||||
|
return response
|
||||||
|
|
||||||
@blog.route('/myblog/list-articles/', methods=['GET'])
|
@blog.route('/myblog/list-articles/', methods=['GET'])
|
||||||
@login_required
|
@login_required
|
||||||
def list_articles_blog():
|
def list_articles_blog():
|
||||||
@@ -239,7 +264,7 @@ def viewauthorrss(author):
|
|||||||
if list_posts != None:
|
if list_posts != None:
|
||||||
last_build=last_article_date[0]
|
last_build=last_article_date[0]
|
||||||
for post in list_posts:
|
for post in list_posts:
|
||||||
posts=[dict(title=post[0], subtitle=post[1], content=markdown(post[2]), creation_date=post[3], author=post[4], status=post[5])] + posts
|
posts=[dict(title=post[0], subtitle=post[1], content=markdown(post[2], extensions=MARKDOWN_EXT), creation_date=post[3], author=post[4], status=post[5])] + posts
|
||||||
|
|
||||||
return render_template('blog_rss.xml',
|
return render_template('blog_rss.xml',
|
||||||
base_url=BASE_URL,
|
base_url=BASE_URL,
|
||||||
@@ -261,7 +286,7 @@ def viewPrivateArticle(username, title):
|
|||||||
conn.close()
|
conn.close()
|
||||||
if post != None:
|
if post != None:
|
||||||
post_info = (dict(title=post[0], subtitle=post[1], creation_date=post[3], last_updated=post[4],author=post[5]))
|
post_info = (dict(title=post[0], subtitle=post[1], creation_date=post[3], last_updated=post[4],author=post[5]))
|
||||||
content = markdown(post[2])
|
content = markdown(post[2], extensions=MARKDOWN_EXT)
|
||||||
return render_template('blog.html', post_info=post_info, content=content)
|
return render_template('blog.html', post_info=post_info, content=content)
|
||||||
else:
|
else:
|
||||||
return redirect(url_for('blog'), code=404)
|
return redirect(url_for('blog'), code=404)
|
||||||
@@ -278,7 +303,7 @@ def viewArticle(username, title):
|
|||||||
conn.close()
|
conn.close()
|
||||||
if post != None:
|
if post != None:
|
||||||
post_info = (dict(title=post[0], subtitle=post[1], creation_date=post[3], last_updated=post[4],author=post[5]))
|
post_info = (dict(title=post[0], subtitle=post[1], creation_date=post[3], last_updated=post[4],author=post[5]))
|
||||||
content= markdown(post[2])
|
content= markdown(post[2], extensions=MARKDOWN_EXT)
|
||||||
|
|
||||||
return render_template('blog.html', post_info=post_info, content=content)
|
return render_template('blog.html', post_info=post_info, content=content)
|
||||||
else:
|
else:
|
||||||
@@ -299,7 +324,7 @@ def viewrss():
|
|||||||
if list_posts != None:
|
if list_posts != None:
|
||||||
last_build=last_article_date[0]
|
last_build=last_article_date[0]
|
||||||
for post in list_posts:
|
for post in list_posts:
|
||||||
posts=[dict(title=post[0], subtitle=post[1], content=markdown(post[2]), creation_date=post[3], author=post[4], status=post[5])] + posts
|
posts=[dict(title=post[0], subtitle=post[1], content=markdown(post[2], extensions=MARKDOWN_EXT), creation_date=post[3], author=post[4], status=post[5])] + posts
|
||||||
|
|
||||||
return render_template('blog_rss.xml',
|
return render_template('blog_rss.xml',
|
||||||
base_url=BASE_URL,
|
base_url=BASE_URL,
|
||||||
|
|||||||
Reference in New Issue
Block a user