Compare commits
3 Commits
e4f7ef6ab4
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d607d75f8 | |||
| f5d8636f1d | |||
| 0f84afc99a |
BIN
base.db.bkp
BIN
base.db.bkp
Binary file not shown.
@@ -61,7 +61,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<a href="/blog/public_unified/{{ article.author }}/{{ article.title_id }}"> <button> Lire la suite </button> </a>
|
<a href="{{ url_for('blog.viewArticle', username=article.author, title_id=article.title_id) }}"> <button> Lire la suite </button> </a>
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
<item>
|
<item>
|
||||||
<title> {{ post.title }} </title>
|
<title> {{ post.title }} </title>
|
||||||
<pubdate> {% if post.last_updated %} {{ post.last_updated }} {% else %} {{ post.time }} {% endif %} </pubdate>
|
<pubdate> {% if post.last_updated %} {{ post.last_updated }} {% else %} {{ post.time }} {% endif %} </pubdate>
|
||||||
<link> {{base_url}}/blog/{{ post.status }}/{{post.author}}/{{post.title_id}}</link>
|
<link> {{base_url}}/{{ url_for('blog.viewArticle', username=post.author, title_id=post.title_id) }}</link>
|
||||||
<guid> {{base_url}}/blog/{{ post.status }}/{{post.author}}/{{post.title_id}}</guid>
|
<guid> {{base_url}}/{{ url_for('blog.viewArticle', username=post.author, title_id=post.title_id) }} </guid>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
{{ post.subtitle }}
|
{{ post.subtitle }}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
</small>
|
</small>
|
||||||
<div class="slug">
|
<div class="slug">
|
||||||
<p> {{ post.subtitle }} </p>
|
<p> {{ post.subtitle }} </p>
|
||||||
<p class="readmore"> <a style="margin-right:2rem;" href="/blog/{{ post.status }}/{{post.author}}/{{post.title_id}}"> Lire la suite... </a></p>
|
<p class="readmore"> <a style="margin-right:2rem;" href="{{ url_for('blog.viewArticle', username=post.author, title_id=post.title_id) }}"> Lire la suite... </a></p>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
</small>
|
</small>
|
||||||
<div class="slug">
|
<div class="slug">
|
||||||
<p> {{ post.subtitle }} </p>
|
<p> {{ post.subtitle }} </p>
|
||||||
<p class="readmore"> <a style="margin-right:2rem;" href="/blog/{{ post.status }}/{{post.author}}/{{post.title_id}}"> Lire la suite... </a></p>
|
<p class="readmore"> <a style="margin-right:2rem;" href="{{ url_for('blog.viewArticle', username=post.author, title_id=post.title_id) }}"> Lire la suite... </a></p>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ def view_internal():
|
|||||||
id=0
|
id=0
|
||||||
if list_posts != None:
|
if list_posts != None:
|
||||||
for post in list_posts:
|
for post in list_posts:
|
||||||
posts = [dict(title_id=[0], title=post[1], subtitle=post[2], content=post[3], creation_date=post[4], last_updated=post[5], author=post[6], status=post[7] )] + posts
|
posts = [dict(title_id=post[0], title=post[1], subtitle=post[2], content=post[3], creation_date=post[4], last_updated=post[5], author=post[6], status=post[7] )] + posts
|
||||||
else:
|
else:
|
||||||
return redirect(BASE_URL, code=404)
|
return redirect(BASE_URL, code=404)
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ def viewuser(author):
|
|||||||
conn = sqlite3.connect(DATABASE) # Connexion à la base de donnée
|
conn = sqlite3.connect(DATABASE) # Connexion à la base de donnée
|
||||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||||
if 'username' in session :
|
if 'username' in session :
|
||||||
cursor.execute("""SELECT title_id, title, subtitle, creation_date, last_updated, author, status FROM Blog_posts WHERE author=? AND status != 'draft' """, (author,))
|
cursor.execute("""SELECT title_id, title, subtitle, creation_date, last_updated, author, status FROM Blog_posts WHERE author=? AND status!='draft' """, (author,))
|
||||||
else:
|
else:
|
||||||
cursor.execute("""SELECT title_id, title, subtitle, creation_date, last_updated, author, status FROM Blog_posts WHERE author=? AND status='public' OR status='public_unified' """, (author,))
|
cursor.execute("""SELECT title_id, title, subtitle, creation_date, last_updated, author, status FROM Blog_posts WHERE author=? AND status='public' OR status='public_unified' """, (author,))
|
||||||
list_posts=cursor.fetchall()
|
list_posts=cursor.fetchall()
|
||||||
@@ -260,7 +260,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_id[0], title=post[1], subtitle=post[2], content=markdown(post[3], extensions=MARKDOWN_EXT), creation_date=post[4],
|
posts=[dict(title_id=post[0], title=post[1], subtitle=post[2], content=markdown(post[3], extensions=MARKDOWN_EXT), creation_date=post[4],
|
||||||
author=post[5], status=post[6])] + posts
|
author=post[5], status=post[6])] + posts
|
||||||
|
|
||||||
return render_template('blog_rss.xml',
|
return render_template('blog_rss.xml',
|
||||||
@@ -285,7 +285,7 @@ def viewPrivateArticle(username, title_id):
|
|||||||
content = markdown(post[3], extensions=MARKDOWN_EXT)
|
content = markdown(post[3], 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('login'), code=404)
|
||||||
|
|
||||||
|
|
||||||
@blog.route('/blog/public_unified/<username>/<title_id>', methods=['GET'])
|
@blog.route('/blog/public_unified/<username>/<title_id>', methods=['GET'])
|
||||||
@@ -294,7 +294,7 @@ def viewArticle(username, title_id):
|
|||||||
user = '%s' % escape(username)
|
user = '%s' % escape(username)
|
||||||
conn = sqlite3.connect(DATABASE) # Connexion à la base de donnée
|
conn = sqlite3.connect(DATABASE) # Connexion à la base de donnée
|
||||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||||
cursor.execute("""SELECT title_id, title, subtitle, content, creation_date, last_updated, author FROM Blog_posts WHERE author=? AND title=? AND status='public_unified' """, (user, title_id) )
|
cursor.execute("""SELECT title_id, title, subtitle, content, creation_date, last_updated, author FROM Blog_posts WHERE author=? AND title_id=? AND status='public_unified' """, (user, title_id) )
|
||||||
post = cursor.fetchone()
|
post = cursor.fetchone()
|
||||||
conn.close()
|
conn.close()
|
||||||
if post != None:
|
if post != None:
|
||||||
|
|||||||
Reference in New Issue
Block a user