Skip to content

Commit

Permalink
Fixed pagination again and added adequate bradcrumb to key details page.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Dec 29, 2011
1 parent e65aadd commit 74bef1c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ To show all the details just use::
REDISBOARD_ITEMS_PER_PAGE REDISBOARD_ITEMS_PER_PAGE
------------------------- -------------------------


REDISBOARD_ITEMS_PER_PAGE - default 200. Used for paginating the items from a list or a sorted set. REDISBOARD_ITEMS_PER_PAGE - default 100. Used for paginating the items from a list or a sorted set.


Screenshots Screenshots
=========== ===========
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


setup( setup(
name = "django-redisboard", name = "django-redisboard",
version = "0.2.4", version = "0.2.5",
url = 'https://github.com/ionelmc/django-redisboard', url = 'https://github.com/ionelmc/django-redisboard',
download_url = '', download_url = '',
license = 'BSD', license = 'BSD',
Expand Down
11 changes: 8 additions & 3 deletions src/redisboard/templates/redisboard/inspect.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label='redisboard' %}">{{ 'redisboard'|capfirst|escape }}</a> &rsaquo; <a href="{% url 'admin:app_list' app_label='redisboard' %}">{{ 'redisboard'|capfirst|escape }}</a>
&rsaquo; <a href="{% url 'admin:redisboard_redisserver_changelist' %}">{{ 'redisserver'|capfirst }}</a> &rsaquo; <a href="{% url 'admin:redisboard_redisserver_changelist' %}">{{ 'redisserver'|capfirst }}</a>
&rsaquo; {% trans 'Inspect' %} {{ original|truncatewords:"18" }} {% if key_details %}
&rsaquo; <a href="{% url 'admin:redisboard_redisserver_inspect' original.id %}">{% trans 'Inspect' %} {{ original|truncatewords:"18" }}</a>
&rsaquo; {% trans "Key details" %}: {{ key_details.name }}
{% else %}
&rsaquo; {% trans 'Inspect' %} {{ original|truncatewords:"18" }}
{% endif %}
</div> </div>
{% endblock %} {% endblock %}
{% endif %} {% endif %}
Expand Down Expand Up @@ -132,11 +137,11 @@ <h2>{% trans "Key details" %}: {{ key_details.name }}</h2>
<fieldset class="module aligned key-data"> <fieldset class="module aligned key-data">
<h2>{% trans "Key data" %}: {{ key_details.name }}</h2> <h2>{% trans "Key data" %}: {{ key_details.name }}</h2>
<table> <table>
{% for key, value in key_details.data %} {% for key, value in key_details.data.object_list|default:key_details.data %}
<tr><td>{{ key }}</td><td>{{ value }}</td></tr> <tr><td>{{ key }}</td><td>{{ value }}</td></tr>
{% endfor %} {% endfor %}
</table> </table>
{% if key_details.data.paginator %} {% if key_details.data.paginator and key_details.data.paginator.num_pages > 1 %}
<p class="paginator"> <p class="paginator">
{% for nr in key_details.data.paginator.page_range %} {% for nr in key_details.data.paginator.page_range %}
{% if key_details.data.number == nr %} {% if key_details.data.number == nr %}
Expand Down
4 changes: 2 additions & 2 deletions src/redisboard/views.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


from .utils import LazySlicingIterable from .utils import LazySlicingIterable


REDISBOARD_ITEMS_PER_PAGE = getattr(settings, 'REDISBOARD_ITEMS_PER_PAGE', 200) REDISBOARD_ITEMS_PER_PAGE = getattr(settings, 'REDISBOARD_ITEMS_PER_PAGE', 100)


def safeint(value): def safeint(value):
try: try:
Expand Down Expand Up @@ -75,7 +75,7 @@ def _get_key_details(conn, db, key, page):
curry(VALUE_GETTERS[details['type']], conn, key) curry(VALUE_GETTERS[details['type']], conn, key)
), ),
REDISBOARD_ITEMS_PER_PAGE REDISBOARD_ITEMS_PER_PAGE
).page(page).object_list ).page(page)
else: else:
details['data'] = VALUE_GETTERS[details['type']](conn, key) details['data'] = VALUE_GETTERS[details['type']](conn, key)


Expand Down

0 comments on commit 74bef1c

Please sign in to comment.