Add user theme in list articles
This commit is contained in:
parent
89400555ed
commit
3266b02be7
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title> Le Blog du serveur </title>
|
||||
<link rel="stylesheet" href="/static/{{author}}/blog.css" type="text/css">
|
||||
<link rel="stylesheet" href="/{{author}}/blog.css" type="text/css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
</head>
|
||||
@ -17,7 +17,7 @@
|
||||
<div class="articles">
|
||||
{% for post in posts %}
|
||||
|
||||
<h2 class="index"><a href="/blog/{author}}/{{post.title}}"> {{ post.title }}</a></h2>
|
||||
<h2 class="index"><a href="/blog/{{ post.status }}/{{author}}/{{post.title}}"> {{ post.title }}</a></h2>
|
||||
<small>
|
||||
<time datetime="{{ post.time }}">
|
||||
Publié le {{ post.creation_date }}
|
||||
|
||||
@ -2,7 +2,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<title> Le Blog du serveur </title>
|
||||
{% if author %}
|
||||
<link rel="stylesheet" href="/{{author}}/blog.css" type="text/css">
|
||||
{% else %}
|
||||
<link rel="stylesheet" href="/static/blog.css" type="text/css">
|
||||
{% endif %}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
</head>
|
||||
@ -19,7 +23,7 @@
|
||||
<a href="/blog/rss.xml"> S'abonner au flux RSS </a>
|
||||
{% for post in posts %}
|
||||
|
||||
<h2 class="index"><a href="/blog/{{post.author}}/{{post.title}}"> {{ post.title }}</a></h2>
|
||||
<h2 class="index"><a href="/blog/{{ post.status }}/{{post.author}}/{{post.title}}"> {{ post.title }}</a></h2>
|
||||
<small>
|
||||
<time datetime="{{ post.time }}">
|
||||
Publié le {{ post.creation_date }} par <a href="{{ url_for('blog.view') }}/{{ post.author }}"> {{ post.author }}</a>
|
||||
|
||||
@ -139,7 +139,7 @@ def personnalize_blog():
|
||||
|
||||
if blog_theme != "Default":
|
||||
copy( "static/blog-"+blog_theme+".css",
|
||||
DOSSIER_PERSO+ user +'blog.css' )
|
||||
DOSSIER_PERSO+ user +'/blog.css' )
|
||||
|
||||
if f: # On vérifie qu'un fichier a bien été envoyé
|
||||
nom = secure_filename(f.filename)
|
||||
@ -167,7 +167,7 @@ def viewmyblog():
|
||||
for post in list_posts:
|
||||
posts=[dict(title=post[0], subtitle=post[1], creation_date=post[2], author=post[3], status=post[4])] + posts
|
||||
|
||||
return render_template('index_blog.html', section='Blog', posts=posts)
|
||||
return render_template('index_blog.html', section='Blog', posts=posts, author=user)
|
||||
|
||||
|
||||
@blog.route('/private-blog/', methods=['GET'])
|
||||
@ -223,7 +223,7 @@ def viewuser(author):
|
||||
posts=[dict(title=post[0], subtitle=post[1], creation_date=post[2], last_updated=post[3], author=post[4], status=post[5])] + posts
|
||||
|
||||
|
||||
return render_template('index_author_blog.html', section='Blog', posts=posts)
|
||||
return render_template('index_author_blog.html', section='Blog', posts=posts, author=author)
|
||||
|
||||
@blog.route('/blog/<author>/rss.xml', methods=['GET'])
|
||||
def viewauthorrss(author):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user