added setting.jinja2
This commit is contained in:
BIN
cao_blogr.sqlite
BIN
cao_blogr.sqlite
Binary file not shown.
@@ -1,13 +1,13 @@
|
|||||||
def includeme(config):
|
def includeme(config):
|
||||||
config.add_static_view('static', 'static', cache_max_age=3600)
|
config.add_static_view('static', 'static', cache_max_age=3600)
|
||||||
config.add_route('home', '/')
|
config.add_route('home', '/')
|
||||||
config.add_route('admin', '/admin')
|
|
||||||
config.add_route('apropos', '/apropos')
|
config.add_route('apropos', '/apropos')
|
||||||
config.add_route('blog', '/blog/{id:\d+}/{slug}')
|
config.add_route('blog', '/blog/{id:\d+}/{slug}')
|
||||||
config.add_route('blog_edit', '/blog_edit/{topic}/{id}')
|
config.add_route('blog_edit', '/blog_edit/{topic}/{id}')
|
||||||
config.add_route('blog_search', '/blog_search')
|
config.add_route('blog_search', '/blog_search')
|
||||||
config.add_route('login', '/login')
|
config.add_route('login', '/login')
|
||||||
config.add_route('logout', '/logout')
|
config.add_route('logout', '/logout')
|
||||||
|
config.add_route('settings', '/settings')
|
||||||
config.add_route('topic', '/topic/{topic}')
|
config.add_route('topic', '/topic/{topic}')
|
||||||
config.add_route('users', '/users')
|
config.add_route('users', '/users')
|
||||||
config.add_route('user_add', '/user_add/{name}')
|
config.add_route('user_add', '/user_add/{name}')
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import datetime #<- will be used to set default dates on models
|
|||||||
from sqlalchemy import or_
|
from sqlalchemy import or_
|
||||||
from paginate_sqlalchemy import SqlalchemyOrmPage #<- provides pagination
|
from paginate_sqlalchemy import SqlalchemyOrmPage #<- provides pagination
|
||||||
from ..models.blog_record import BlogRecord, Topics, Tags
|
from ..models.blog_record import BlogRecord, Topics, Tags
|
||||||
from markdown2 import Markdown
|
|
||||||
|
|
||||||
|
|
||||||
class BlogRecordService(object):
|
class BlogRecordService(object):
|
||||||
@@ -12,7 +11,9 @@ class BlogRecordService(object):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def by_topic(cls, request, topic, tag):
|
def by_topic(cls, request, topic, tag):
|
||||||
# get posts by topic
|
# get posts by topic
|
||||||
query = request.dbsession.query(BlogRecord).filter(BlogRecord.topic_id == topic, BlogRecord.tag == tag)
|
query = request.dbsession.query(BlogRecord).filter(BlogRecord.topic_id == topic)
|
||||||
|
if tag != '':
|
||||||
|
query = query.filter(BlogRecord.tag == tag)
|
||||||
query = query.order_by(BlogRecord.tag, BlogRecord.title).all()
|
query = query.order_by(BlogRecord.tag, BlogRecord.title).all()
|
||||||
return query
|
return query
|
||||||
|
|
||||||
@@ -48,21 +49,11 @@ class BlogRecordService(object):
|
|||||||
query = request.dbsession.query(Topics).filter(Topics.topic == id).first()
|
query = request.dbsession.query(Topics).filter(Topics.topic == id).first()
|
||||||
return query.topic_name.upper()
|
return query.topic_name.upper()
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def proc_after_create(cls, request, _id):
|
|
||||||
entry = request.dbsession.query(BlogRecord).get(_id)
|
|
||||||
# convertir mardown en HTML
|
|
||||||
markdowner = Markdown()
|
|
||||||
entry.body_html = markdowner.convert(entry.body)
|
|
||||||
return
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def proc_after_update(cls, request, _id):
|
def proc_after_update(cls, request, _id):
|
||||||
entry = request.dbsession.query(BlogRecord).get(_id)
|
entry = request.dbsession.query(BlogRecord).get(_id)
|
||||||
entry.edited = datetime.datetime.now()
|
entry.edited = datetime.datetime.now()
|
||||||
entry.title_url = entry.slug
|
entry.title_url = entry.slug
|
||||||
# convertir mardown en HTML
|
|
||||||
markdowner = Markdown()
|
|
||||||
entry.body_html = markdowner.convert(entry.body)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
BIN
cao_blogr/static/img/mental-du-saint.jpg
Normal file
BIN
cao_blogr/static/img/mental-du-saint.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
BIN
cao_blogr/static/img/mental-ordinaire.jpg
Normal file
BIN
cao_blogr/static/img/mental-ordinaire.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
cao_blogr/static/img/palette-couleur.png
Normal file
BIN
cao_blogr/static/img/palette-couleur.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@@ -5,13 +5,20 @@ body {
|
|||||||
font: 400 15px/1.8 Lato, sans-serif;
|
font: 400 15px/1.8 Lato, sans-serif;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
h2 {
|
.container h2{
|
||||||
|
color: #df4937 !important;
|
||||||
|
}
|
||||||
|
.container h3{
|
||||||
|
color: #df4937 !important;
|
||||||
|
}
|
||||||
|
h5 {
|
||||||
margin: 30px 0 30px 0;
|
margin: 30px 0 30px 0;
|
||||||
|
font-size: 24px;
|
||||||
letter-spacing: 10px;
|
letter-spacing: 10px;
|
||||||
color: #111;
|
color: #111;
|
||||||
}
|
}
|
||||||
.container {
|
.container {
|
||||||
padding: 60px 80px 20px 80px;
|
padding-top: 6em;
|
||||||
}
|
}
|
||||||
.person {
|
.person {
|
||||||
border: 10px solid transparent;
|
border: 10px solid transparent;
|
||||||
@@ -39,10 +46,10 @@ h2 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.bg-1 {
|
.bg-1 {
|
||||||
background: #bc2131;
|
background: #df4937;
|
||||||
color: #bdbdbd;
|
color: #bdbdbd;
|
||||||
}
|
}
|
||||||
.bg-1 h2 {color: #fff;}
|
.bg-1 h5 {color: #fff;}
|
||||||
.bg-1 p {font-style: italic;}
|
.bg-1 p {font-style: italic;}
|
||||||
.list-group-item:first-child {
|
.list-group-item:first-child {
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
@@ -151,3 +158,10 @@ textarea {
|
|||||||
color: #f4511e;
|
color: #f4511e;
|
||||||
font-size: 50px;
|
font-size: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1200px) {
|
||||||
|
.container{
|
||||||
|
max-width: 900px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="content">
|
<h1>Méditation SUNYATA Paris</h1>
|
||||||
<h1>Méditation SUNYATA Paris</h1>
|
<p class="lead"><span class="font-semi-bold">404</span> Page non trouvée</p>
|
||||||
<p class="lead"><span class="font-semi-bold">404</span> Page non trouvée</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
{% extends "cao_blogr:templates/layout.jinja2" %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row text-center">
|
|
||||||
<div class="col-sm-3">
|
|
||||||
<a href=" {{request.route_url('users')}} "><span class="glyphicon glyphicon-user icone-big"></span></a>
|
|
||||||
<h4>UTILISATEURS</h4>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-3">
|
|
||||||
<a href=" {{request.route_url('users')}} "><span class="glyphicon glyphicon-user icone-big"></span></a>
|
|
||||||
<h4>TOPICS / TAGS</h4>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-3">
|
|
||||||
<a href=" {{request.route_url('topic', topic='ADM')}} "><span class="glyphicon glyphicon-file icone-big"></span></a>
|
|
||||||
<h4>PAGES ADMIN</h4>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
<p>{{ entry.body_html | safe }}</p>
|
<p>{{ body_html | safe }}</p>
|
||||||
<hr/>
|
<hr/>
|
||||||
<p>
|
<p>
|
||||||
Publié le : <strong title="{{ entry.created }}">{{ entry.edited.strftime("%d-%m-%Y - %H:%M") }}</strong>
|
Publié le : <strong title="{{ entry.created }}">{{ entry.edited.strftime("%d-%m-%Y - %H:%M") }}</strong>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{% extends "layout.jinja2" %}
|
{% extends "layout.jinja2" %}
|
||||||
|
|
||||||
{% block carousel %}
|
{% block content %}
|
||||||
|
|
||||||
<div id="myCarousel" class="carousel slide" data-ride="carousel">
|
<div id="myCarousel" class="carousel slide" data-ride="carousel">
|
||||||
<!-- Indicators -->
|
<!-- Indicators -->
|
||||||
@@ -61,15 +61,13 @@
|
|||||||
<span class="sr-only">Next</span>
|
<span class="sr-only">Next</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<!-- Container (Méditation SUNYATA Section) -->
|
<!-- Container (Méditation SUNYATA Section) -->
|
||||||
<div id="band" class="text-center">
|
<div id="band" class="text-center">
|
||||||
<h2>LA MEDITATION SUNYATA</h2>
|
<h5>LA MEDITATION SUNYATA</h5>
|
||||||
<p>Le centre de Méditation Sunyata Paris est une branche du <a href="http://www.sunyatameditation.org/">Sunyata Méditation Center</a> dont le siège est à Perris, CA, Etats-Unis.<br />
|
<p>Le centre de Méditation SUNYATA Paris est une branche du <a href="http://www.sunyatameditation.org/">SUNYATA Méditation Center</a> dont le siège est à Perris, CA, Etats-Unis.<br />
|
||||||
Notre but est de promouvoir la pratique de la méditation et du QiGong Sunyata à Paris.
|
Notre but est de promouvoir la pratique de la méditation et du QiGong SUNYATA à Paris.
|
||||||
</p>
|
</p>
|
||||||
<br>
|
<br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -78,11 +76,11 @@
|
|||||||
<img src="{{ request.static_url('cao_blogr:static/ni-su.jpg') }}" class="img-circle person" alt="Médiation Sunyata" width="255" height="255">
|
<img src="{{ request.static_url('cao_blogr:static/ni-su.jpg') }}" class="img-circle person" alt="Médiation Sunyata" width="255" height="255">
|
||||||
</a>
|
</a>
|
||||||
<p><b>La Méditation SUNYATA</p></b>
|
<p><b>La Méditation SUNYATA</p></b>
|
||||||
<p>développée par le maître zen Thích Thông Triệt, combine les enseignements essentiels du <b>processus de réalisation et d'illumination du Bouddha</b>, les <b>pratiques des 3 traditions du bouddhisme</b> (Theravāda, Mahayana et Zen), et les <b>découvertes de la neuro-sciences</b>.</p>
|
<p>développée par le maître zen Thích Thông Triệt, combine les enseignements essentiels du <b>processus de réalisation et d'illumination du Bouddha</b>, les <b>pratiques des 3 traditions du bouddhisme</b> (Theravāda, Mahayana et Zen) et les récentes <b>découvertes de la neuro-sciences</b>.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<a href="#demo2">
|
<a href="#demo2">
|
||||||
<img src="{{ request.static_url('cao_blogr:static/thong-triet.jpg') }}" class="img-circle person" alt="Maître Thông Triêt" width="255" height="255">
|
<img src="{{ request.static_url('cao_blogr:static/img/thong-triet.jpg') }}" class="img-circle person" alt="Maître Thông Triêt" width="255" height="255">
|
||||||
</a>
|
</a>
|
||||||
<p><b>Notre Maître Fondateur</p></b>
|
<p><b>Notre Maître Fondateur</p></b>
|
||||||
<p><b>Le Vénérable Maître Thích Thông Triệt</b> a été ordonné par le Vénérable Maître Zen Thich Thanh Tu en 1974 et a eu sa réalisation spirituelle majeure en 1989 au Vietnam.
|
<p><b>Le Vénérable Maître Thích Thông Triệt</b> a été ordonné par le Vénérable Maître Zen Thich Thanh Tu en 1974 et a eu sa réalisation spirituelle majeure en 1989 au Vietnam.
|
||||||
@@ -103,7 +101,7 @@
|
|||||||
<br>
|
<br>
|
||||||
<div id="tour" class="bg-1">
|
<div id="tour" class="bg-1">
|
||||||
<br>
|
<br>
|
||||||
<h2 class="text-center">NOS ACTIVITES</h2>
|
<h5 class="text-center">NOS ACTIVITES</h5>
|
||||||
<div class="row text-center">
|
<div class="row text-center">
|
||||||
<div class="col-sm-1">
|
<div class="col-sm-1">
|
||||||
</div>
|
</div>
|
||||||
@@ -149,7 +147,7 @@
|
|||||||
<!-- Container (POSTS Section) -->
|
<!-- Container (POSTS Section) -->
|
||||||
<div id="posts">
|
<div id="posts">
|
||||||
<br>
|
<br>
|
||||||
<h2 class="text-center">DERNIERES PUBLICATIONS</h2>
|
<h5 class="text-center">DERNIERES PUBLICATIONS</h5>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{% for entry in last_five %}
|
{% for entry in last_five %}
|
||||||
@@ -168,7 +166,7 @@
|
|||||||
<!-- Container (Contact Section) -->
|
<!-- Container (Contact Section) -->
|
||||||
<div id="contact">
|
<div id="contact">
|
||||||
<br >
|
<br >
|
||||||
<h2 class="text-center">CONTACT</h2>
|
<h5 class="text-center">CONTACT</h5>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
|
|||||||
@@ -37,11 +37,12 @@
|
|||||||
<div class="collapse navbar-collapse" id="myNavbar">
|
<div class="collapse navbar-collapse" id="myNavbar">
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
<li><a href="{{ request.route_url('blog_search') }}"><span class="glyphicon glyphicon-search"></span></a></li>
|
<li><a href="{{ request.route_url('blog_search') }}"><span class="glyphicon glyphicon-search"></span></a></li>
|
||||||
<!-- si anonyme, lien pour se connecter -->
|
|
||||||
{% if request.authenticated_userid %}
|
{% if request.authenticated_userid %}
|
||||||
<li><a href="{{request.route_url('logout')}}">
|
<li><a href="{{request.route_url('settings')}}"><span class="glyphicon glyphicon-cog"></span></a></li>
|
||||||
|
<li><a href="{{request.route_url('logout')}}">
|
||||||
<span class="glyphicon glyphicon-log-out"></span> {{request.authenticated_userid}}</a></li>
|
<span class="glyphicon glyphicon-log-out"></span> {{request.authenticated_userid}}</a></li>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
<!-- si anonyme, lien pour se connecter -->
|
||||||
<li><a href="{{request.route_url('login')}}"><span class="glyphicon glyphicon-log-in"></span></a></li>
|
<li><a href="{{request.route_url('login')}}"><span class="glyphicon glyphicon-log-in"></span></a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -50,26 +51,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<!-- display carousel -->
|
|
||||||
{% if request.path == '/' %}
|
|
||||||
{% block carousel %}
|
|
||||||
{% endblock carousel %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<!-- Container (Above content Section) -->
|
<!-- Container (Above content Section) -->
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<br />
|
|
||||||
<!-- Display Page Title -->
|
<!-- Display Page Title -->
|
||||||
{% if page_title %}
|
{% if page_title %}
|
||||||
<h1>{{ page_title }}</h1>
|
<h1>{{ page_title }}</h1>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<br />
|
|
||||||
<div id="messages">
|
<div id="messages">
|
||||||
{% for queue in ['', 'info', 'success', 'warning', 'danger'] %}
|
{% for queue in ['', 'info', 'success', 'warning', 'danger'] %}
|
||||||
{% for message in request.session.pop_flash(queue) %}
|
{% for message in request.session.pop_flash(queue) %}
|
||||||
<div class="alert alert-{{queue}}">
|
<div class="alert alert-{{queue}}">
|
||||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||||
{{ message }}
|
{{ message }}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -98,10 +92,6 @@
|
|||||||
© 2022 - Méditation SUNYATA Paris
|
© 2022 - Méditation SUNYATA Paris
|
||||||
 | <a href="{{ request.route_url('blog', id=1, slug='mentions-l%25C3%25A9gales') }}">Mentions légales</a>
|
 | <a href="{{ request.route_url('blog', id=1, slug='mentions-l%25C3%25A9gales') }}">Mentions légales</a>
|
||||||
|
|
||||||
{% if request.authenticated_userid == 'admin' %}
|
|
||||||
 | <a href="{{request.route_url('admin')}}">Admin</a>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-offset-4 col-md-5 well">
|
<div class="col-md-offset-4 col-md-5 well">
|
||||||
|
|
||||||
@@ -21,10 +20,5 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
38
cao_blogr/templates/settings.jinja2
Normal file
38
cao_blogr/templates/settings.jinja2
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{% extends "cao_blogr:templates/layout.jinja2" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<div class="row text-center">
|
||||||
|
{% if request.authenticated_userid %}
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<a href=" {{request.route_url('users')}} "><span class="glyphicon glyphicon-user icone-big"></span></a>
|
||||||
|
<h4>UTILISATEURS</h4>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<a href=" {{request.route_url('users')}} "><span class="glyphicon glyphicon-user icone-big"></span></a>
|
||||||
|
<h4>TOPICS / TAGS</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<h2>Pages Paramètres</h2>
|
||||||
|
{% if request.authenticated_userid %}
|
||||||
|
<p><a href="{{ request.route_url('blog_edit', topic=topic, id='0') }}">
|
||||||
|
[Nouveau post]</a>
|
||||||
|
</p>
|
||||||
|
{% endif%}
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{% for item in items %}
|
||||||
|
<li>
|
||||||
|
{{ item.edited.strftime("%d-%m-%Y") }}
|
||||||
|
<a href="{{ request.route_url('blog', id=item.id, slug=item.slug) }}">
|
||||||
|
<span class="glyphicon glyphicon-menu-right"></span> {{ item.title }}</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
{% extends "layout.jinja2" %}
|
{% extends "layout.jinja2" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
|
||||||
<p>
|
<p>
|
||||||
<a href="{{ request.route_url('home' ) }}" class="btn btn-default" role="button">
|
<a href="{{ request.route_url('home' ) }}" class="btn btn-default" role="button">
|
||||||
<span class="glyphicon glyphicon-chevron-left"></span> Retour</a>
|
<span class="glyphicon glyphicon-chevron-left"></span> Retour</a>
|
||||||
@@ -29,5 +28,5 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
from pyramid.view import view_config
|
from pyramid.view import view_config
|
||||||
from pyramid.httpexceptions import HTTPNotFound, HTTPFound
|
from pyramid.httpexceptions import HTTPNotFound, HTTPFound
|
||||||
|
from markdown2 import Markdown
|
||||||
|
|
||||||
from ..models.blog_record import BlogRecord
|
from ..models.blog_record import BlogRecord
|
||||||
from ..services.blog_record import BlogRecordService
|
from ..services.blog_record import BlogRecordService
|
||||||
from ..forms import BlogCreateForm, BlogUpdateForm, BlogSearchForm
|
from ..forms import BlogCreateForm, BlogUpdateForm, BlogSearchForm
|
||||||
@@ -15,13 +17,16 @@ def blog(request):
|
|||||||
request.session.flash(u"Page non trouvée : %s" % blog_id, 'warning')
|
request.session.flash(u"Page non trouvée : %s" % blog_id, 'warning')
|
||||||
return HTTPFound(location=request.route_url('home'))
|
return HTTPFound(location=request.route_url('home'))
|
||||||
|
|
||||||
# just created ? convert body to html
|
# insèrer le path de static/img
|
||||||
if entry.body_html == '':
|
body = entry.body.replace('static/img/', "%s/static/img/" % request.application_url)
|
||||||
BlogRecordService.proc_after_create(request, blog_id)
|
# convertir mardown en HTML
|
||||||
|
markdowner = Markdown()
|
||||||
|
body_html = markdowner.convert(body)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'page_title': entry.title,
|
'page_title': entry.title,
|
||||||
'entry': entry
|
'entry': entry,
|
||||||
|
'body_html': body_html,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -119,7 +124,7 @@ def topic(request):
|
|||||||
if items:
|
if items:
|
||||||
liste += '<ul>'
|
liste += '<ul>'
|
||||||
for item in items:
|
for item in items:
|
||||||
liste += '<li>{0} <a href="{1}"><span class="glyphicon glyphicon-menu-right"></span>{2}</a></li>'.format(
|
liste += '<li>{0} <a href="{1}"><span class="glyphicon glyphicon-menu-right"></span> {2}</a></li>'.format(
|
||||||
item.edited.strftime("%d-%m-%Y"), request.route_url('blog', id=item.id, slug=item.slug), item.title)
|
item.edited.strftime("%d-%m-%Y"), request.route_url('blog', id=item.id, slug=item.slug), item.title)
|
||||||
liste += '</ul>'
|
liste += '</ul>'
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ def home(request):
|
|||||||
Bonjour,
|
Bonjour,
|
||||||
|
|
||||||
L' expéditeur : {0} ( {1} )
|
L' expéditeur : {0} ( {1} )
|
||||||
a envoyé le message suivant du site "meditation-sunyata.paris"
|
a envoyé le message suivant via le formulaire de Contact du site :
|
||||||
----- Début du message -----
|
----- Début du message -----
|
||||||
{2}
|
{2}
|
||||||
----- Fin du message -----
|
----- Fin du message -----
|
||||||
@@ -55,7 +55,7 @@ Le site "meditation-sunyata.paris"
|
|||||||
message.add_recipient('phuoc@caotek.fr')
|
message.add_recipient('phuoc@caotek.fr')
|
||||||
mailer = request.registry['mailer']
|
mailer = request.registry['mailer']
|
||||||
mailer.send_immediately(message)
|
mailer.send_immediately(message)
|
||||||
message = "Votre message a bien été envoyé au webmestre. Merci de votre intérêt pour notre site"
|
request.session.flash("Votre message a bien été envoyé au webmestre. Merci de votre intérêt pour notre site", "success")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'page_title': "",
|
'page_title': "",
|
||||||
@@ -67,12 +67,17 @@ Le site "meditation-sunyata.paris"
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@view_config(route_name='admin',
|
@view_config(route_name='settings', renderer='cao_blogr:templates/settings.jinja2')
|
||||||
renderer='cao_blogr:templates/admin.jinja2')
|
def settings(request):
|
||||||
def admin(request):
|
|
||||||
|
# lire toutes les docs du topic
|
||||||
|
topic = 'ADM'
|
||||||
|
items = BlogRecordService.by_topic(request, topic, '')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'page_title': "Admin",
|
'page_title': "Paramètres",
|
||||||
|
'topic': topic,
|
||||||
|
'items': items,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -94,7 +99,7 @@ def login(request):
|
|||||||
user = UserService.by_name(request, username)
|
user = UserService.by_name(request, username)
|
||||||
if user and user.verify_password(request.POST.get('password')):
|
if user and user.verify_password(request.POST.get('password')):
|
||||||
headers = remember(request, user.name)
|
headers = remember(request, user.name)
|
||||||
request.session.flash("Bienvenue %s !" % username, 'success')
|
request.session.flash("Bonjour %s, Bienvenue sur le site !" % username, 'success')
|
||||||
return HTTPFound(location=request.route_url('home'), headers=headers)
|
return HTTPFound(location=request.route_url('home'), headers=headers)
|
||||||
else:
|
else:
|
||||||
headers = forget(request)
|
headers = forget(request)
|
||||||
|
|||||||
Reference in New Issue
Block a user