Compare commits

...

3 Commits

Author SHA1 Message Date
7ff1f6a2aa Correct copytoclipboard 2026-02-11 12:48:27 +01:00
4fa225900f categoory doesn't work! 2026-01-28 05:39:50 +01:00
a4fe70de60 Blog section correction RSS 2026-01-26 03:38:17 +01:00
6 changed files with 27 additions and 11 deletions

View File

@@ -41,7 +41,7 @@
<p class="center"><a href="{{ url_for('loginlogout.lost_password') }}"> Mouarf j'ai perdu mon mot de passe </a> </p> <p class="center"><a href="{{ url_for('loginlogout.lost_password') }}"> Mouarf j'ai perdu mon mot de passe </a> </p>
<button class="btn btn-default btn-primary" type="submit"> Login </button> <button class="btn btn-default btn-primary" type="submit"> Login </button>
</form> </form>
{% if list_post %} {% if list_posts %}
<h2> Les derniers articles de blog sur le serveur </h2> <h2> Les derniers articles de blog sur le serveur </h2>
<div class="list-articles" > <div class="list-articles" >
@@ -49,7 +49,7 @@
<article> <article>
<header> <header>
<h3> {{ article.title }} </h3> <h3> {{ article.title }} </h3>
<h5> par <a href="/blog/{{ article.author }}/">/{{ article.author }}</a> </h5> <h5> par <a href="/blog/{{ article.author }}/">{{ article.author }}</a> </h5>
<br/> <br/>
<small> Créé le : {{ article.creation_date }} </small> <br/> <small> Créé le : {{ article.creation_date }} </small> <br/>
{% if article.last_updated %} {% if article.last_updated %}

View File

@@ -13,8 +13,9 @@
{% else %} {% else %}
<a href="/blog/{{ author }}/rss.xml"> S'abonner au flux RSS </a>
<div class="articles"> <div class="articles">
<a href="/blog/{{ author }}/rss.xml"> S'abonner au fl RSS </a>
{% for post in posts %} {% for post in posts %}
<h2 class="index"> {{ post.title }} </h2> <h2 class="index"> {{ post.title }} </h2>

View File

@@ -20,7 +20,7 @@
<div class="articles"> <div class="articles">
<a href="/blog/rss.xml"> S'abonner au flux RSS </a> <a href="/blog/rss.xml"> Suivre ce blog par RSS </a>
{% for post in posts %} {% for post in posts %}
<h2 class="index"> {{ post.title }}</h2> <h2 class="index"> {{ post.title }}</h2>

View File

@@ -18,9 +18,9 @@
{% if token %} {% if token %}
<h3> Votre lien d'inscription en cours: </h3> <h3> Votre lien d'inscription en cours: </h3>
<a href="{{ url_invitation }}"> <a href="{{ url_invitation }}" id="copy-link">
{{ url_invitation }} {{ url_invitation }}
</a> <button class="ghost" onclick="navigator.clipboard.writeText('"{{ url_invitation }}');" > Copier le lien </button> </a> <button class="ghost" onclick="copyLinkToClipboard()" > Copier le lien </button>
<p> ou faîtes scanner ce qrcode :)</p> <p> ou faîtes scanner ce qrcode :)</p>
@@ -35,7 +35,22 @@
<a href="/gen_token/"> <a href="/gen_token/">
<button type="submit" id="tada" class="btn btn btn-success"> Créer un nouveau lien </button></a> <button type="submit" id="tada" class="btn btn btn-success"> Créer un nouveau lien </button></a>
<script>
function copyLinkToClipboard(){
elt = document.getElementById("copy-link");
try {
console.log(elt.outerText);
navigator.clipboard.writeText(elt.outerText);
} catch (error)
{
console.error (error.message)
}
}
</script>
{% endblock %} {% endblock %}

View File

@@ -76,7 +76,7 @@ def edit(title):
cursor.execute("""SELECT title, subtitle, category, content, status FROM Blog_posts WHERE title=? AND author=?""", (title, user)) cursor.execute("""SELECT title, subtitle, category, content, status FROM Blog_posts WHERE title=? AND author=?""", (title, user))
oldpost = cursor.fetchone() oldpost = cursor.fetchone()
conn.close() conn.close()
post = dict(title=oldpost[0], subtitle=oldpost[1], categoory=oldpost[2], content=oldpost[3], status=oldpost[4]) post = dict(title=oldpost[0], subtitle=oldpost[1], category=oldpost[2], content=oldpost[3], status=oldpost[4])
return render_template('edit_article.html', return render_template('edit_article.html',
section='Post-it', section='Post-it',
oldpost=post) oldpost=post)
@@ -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 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, author=author) return render_template('index_blog.html', section='Blog', posts=posts, author=author)
@blog.route('/blog/<author>/rss.xml', methods=['GET']) @blog.route('/blog/<author>/rss.xml', methods=['GET'])
def viewauthorrss(author): def viewauthorrss(author):

View File

@@ -237,7 +237,7 @@ def blog_theme(author):
if os.path.isfile(os.path.join(DOSSIER_PERSO, user,'blog.css')): if os.path.isfile(os.path.join(DOSSIER_PERSO, user,'blog.css')):
return send_file(os.path.join(DOSSIER_PERSO, user, 'blog.css'), mimetype='text/css') return send_file(os.path.join(DOSSIER_PERSO, user, 'blog.css'), mimetype='text/css')
else: else:
return send_file("/static/blog.css", mimetype='text/css') return send_file("static/blog.css", mimetype='text/css')
@filesupload.route('/theme.min.css') @filesupload.route('/theme.min.css')
def theme(): def theme():