added recon method
This commit is contained in:
@@ -15,12 +15,12 @@ Requires-Dist: pyramid
|
|||||||
Requires-Dist: pyramid_jinja2
|
Requires-Dist: pyramid_jinja2
|
||||||
Requires-Dist: pyramid_debugtoolbar
|
Requires-Dist: pyramid_debugtoolbar
|
||||||
Requires-Dist: waitress
|
Requires-Dist: waitress
|
||||||
Requires-Dist: alembic
|
Requires-Dist: alembic==1.4.2
|
||||||
Requires-Dist: pyramid_retry
|
Requires-Dist: pyramid_retry
|
||||||
Requires-Dist: pyramid_layout
|
Requires-Dist: pyramid_layout
|
||||||
Requires-Dist: pyramid_tm
|
Requires-Dist: pyramid_tm
|
||||||
Requires-Dist: python-magic
|
Requires-Dist: python-magic
|
||||||
Requires-Dist: SQLAlchemy
|
Requires-Dist: SQLAlchemy==1.4.49
|
||||||
Requires-Dist: transaction
|
Requires-Dist: transaction
|
||||||
Requires-Dist: zope.sqlalchemy
|
Requires-Dist: zope.sqlalchemy
|
||||||
Requires-Dist: wtforms
|
Requires-Dist: wtforms
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ pyramid
|
|||||||
pyramid_jinja2
|
pyramid_jinja2
|
||||||
pyramid_debugtoolbar
|
pyramid_debugtoolbar
|
||||||
waitress
|
waitress
|
||||||
alembic
|
alembic==1.4.2
|
||||||
pyramid_retry
|
pyramid_retry
|
||||||
pyramid_layout
|
pyramid_layout
|
||||||
pyramid_tm
|
pyramid_tm
|
||||||
python-magic
|
python-magic
|
||||||
SQLAlchemy
|
SQLAlchemy==1.4.49
|
||||||
transaction
|
transaction
|
||||||
zope.sqlalchemy
|
zope.sqlalchemy
|
||||||
wtforms
|
wtforms
|
||||||
|
|||||||
BIN
cao_osint.sqlite
BIN
cao_osint.sqlite
Binary file not shown.
@@ -25,13 +25,13 @@ class BlogRecordService(object):
|
|||||||
return query.get(_id)
|
return query.get(_id)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_last_created(cls, request):
|
def get_last_edited(cls, request):
|
||||||
# gest the 10 last created posts
|
# gest the 10 last edited posts
|
||||||
query = request.dbsession.query(BlogRecord)
|
query = request.dbsession.query(BlogRecord)
|
||||||
if request.authenticated_userid == None:
|
if request.authenticated_userid == None:
|
||||||
# if user is anonym, display only published posts
|
# if user is anonym, display only published posts
|
||||||
query = query.filter(BlogRecord.status == 'publié')
|
query = query.filter(BlogRecord.status == 'publié')
|
||||||
query = query.order_by(sa.desc(BlogRecord.created)).limit(10).all()
|
query = query.order_by(sa.desc(BlogRecord.edited)).limit(10).all()
|
||||||
return query
|
return query
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ h3, h4 {
|
|||||||
.navbar {
|
.navbar {
|
||||||
font-family: Montserrat, sans-serif;
|
font-family: Montserrat, sans-serif;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
background-color: #bc2131;
|
background-color: #2F4F4F;
|
||||||
border: 0;
|
border: 0;
|
||||||
font-size: 14px !important;
|
font-size: 14px !important;
|
||||||
letter-spacing: 4px;
|
letter-spacing: 4px;
|
||||||
@@ -103,7 +103,7 @@ h3, h4 {
|
|||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
}
|
}
|
||||||
footer {
|
footer {
|
||||||
background-color: #bc2131;
|
background-color: #2F4F4F;
|
||||||
color: #f5f5f5;
|
color: #f5f5f5;
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<table id="posts_list" class="table table-condensed">
|
<table id="posts_list" class="table table-condensed">
|
||||||
{% for entry in last_ten %}
|
{% for entry in last_ten %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ entry.created.strftime("%d.%m.%Y") }}</td>
|
<td>{{ entry.edited.strftime("%d.%m.%Y") }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.slug) }}">{{ entry.title }}</a>
|
<a href="{{ request.route_url('blog', id=entry.id, slug=entry.slug) }}">{{ entry.title }}</a>
|
||||||
</td>
|
</td>
|
||||||
@@ -27,28 +27,6 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!-- formulaire de recherche -->
|
|
||||||
<hr>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<div class="well">
|
|
||||||
|
|
||||||
<form id="search-form" role="form" action="/blog_search" method="post">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="criteria">{{ form.criteria.label }}</label>
|
|
||||||
<div class="input-group">
|
|
||||||
{{ form.criteria(class_='form-control') }}
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<button class="btn btn-primary" type="submit" name="form.submitted">
|
|
||||||
Rechercher
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{% for error in form.criteria.errors %}
|
|
||||||
<div class="text-danger">{{ error }}</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -16,16 +16,12 @@ import magic
|
|||||||
@view_config(route_name='home', renderer='../templates/home.jinja2', permission='view')
|
@view_config(route_name='home', renderer='../templates/home.jinja2', permission='view')
|
||||||
def home(request):
|
def home(request):
|
||||||
# get the last created posts
|
# get the last created posts
|
||||||
last_ten = BlogRecordService.get_last_created(request)
|
last_ten = BlogRecordService.get_last_edited(request)
|
||||||
|
|
||||||
criteria = ''
|
|
||||||
form = BlogSearchForm(request.POST)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'page_title': "",
|
'page_title': "",
|
||||||
'last_ten': last_ten,
|
'last_ten': last_ten,
|
||||||
'form': form,
|
|
||||||
'criteria': criteria,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -14,12 +14,12 @@ requires = [
|
|||||||
'pyramid_jinja2',
|
'pyramid_jinja2',
|
||||||
'pyramid_debugtoolbar',
|
'pyramid_debugtoolbar',
|
||||||
'waitress',
|
'waitress',
|
||||||
'alembic',
|
'alembic==1.4.2',
|
||||||
'pyramid_retry',
|
'pyramid_retry',
|
||||||
'pyramid_layout',
|
'pyramid_layout',
|
||||||
'pyramid_tm',
|
'pyramid_tm',
|
||||||
'python-magic',
|
'python-magic',
|
||||||
'SQLAlchemy',
|
'SQLAlchemy==1.4.49',
|
||||||
'transaction',
|
'transaction',
|
||||||
'zope.sqlalchemy',
|
'zope.sqlalchemy',
|
||||||
'wtforms', # form library 2.2.1
|
'wtforms', # form library 2.2.1
|
||||||
|
|||||||
Reference in New Issue
Block a user