Deactivated broken filterable

This commit is contained in:
mitsuhiko 2008-09-20 12:08:58 +02:00
parent b2950694e5
commit 6a4226f183
3 changed files with 3 additions and 24 deletions

View File

@ -18,7 +18,6 @@ from lodgeit.database import session, Paste
from lodgeit.lib.highlighting import LANGUAGES, STYLES, get_style
from lodgeit.lib.pagination import generate_pagination
from lodgeit.lib.captcha import check_hashed_solution, Captcha
from lodgeit.lib.filterable import Filterable
class PasteController(object):
@ -124,22 +123,14 @@ class PasteController(object):
user_hash=local.request.user_hash
)
filterable = Filterable(Paste, query, {
'paste_id': (_(u'identifier'), 'int'),
'pub_date': (_(u'published'), 'date'),
'language': (_(u'language'), 'str'),
}, form_args, True)
all = filterable.get_objects()
pastes = all.limit(10).offset(10 * (page - 1)).all()
pastes = query.limit(10).offset(10 * (page - 1)).all()
if not pastes and page != 1:
raise NotFound()
return render_template('show_all.html',
pastes=pastes,
pagination=generate_pagination(page, 10, all.count(), link),
pagination=generate_pagination(page, 10, query.count(), link),
css=get_style(local.request)[1],
filterable=filterable,
show_personal='show_personal' in form_args
)

View File

@ -1,19 +1,7 @@
{% extends "layout.html" %}
{% import 'utils/macros.html' as macros %}
{% set page_title = _('All Pastes') %}
{% set active_page = 'all' %}
{% block body %}
<div class="paste_filter{% if filterable.filters %} open{% endif %}">
<h3><a href="javascript:LodgeIt.toggleFilterBox()">{%- trans -%}Filter pastes{%- endtrans -%}</a></h3>
<form action="" method="get">
{{ filterable.get_html() }}
<div class="actions">
<input type="checkbox" name="show_personal" id="show_personal"{% if show_personal %} checked{% endif %}>
<label for="show_personal">{{ _('Search personal pastes') }}</label>
<input type="submit" value="{{ _('Filter') }}">
</div>
</form>
</div>
{% if pastes %}
<ul class="paste_list">
{% for paste in pastes %}

View File

@ -10,7 +10,7 @@ from lodgeit.database import session
dburi = 'sqlite:////tmp/lodgeit.db'
SECRET_KEY = os.urandom(50)
SECRET_KEY = 'no secret key'
def run_app(app, path='/'):