Permalink
Browse files

Fixed pagination again and added adequate bradcrumb to key details page.

  • Loading branch information...
ionelmc committed Dec 29, 2011
1 parent e65aadd commit 74bef1c1e22ed5bcdd8ca6415ae67f2153607157
Showing with 12 additions and 7 deletions.
  1. +1 −1 README.rst
  2. +1 −1 setup.py
  3. +8 −3 src/redisboard/templates/redisboard/inspect.html
  4. +2 −2 src/redisboard/views.py
View
@@ -69,7 +69,7 @@ To show all the details just use::
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
===========
View
@@ -5,7 +5,7 @@
setup(
name = "django-redisboard",
- version = "0.2.4",
+ version = "0.2.5",
url = 'https://github.com/ionelmc/django-redisboard',
download_url = '',
license = 'BSD',
@@ -28,7 +28,12 @@
<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: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>
{% endblock %}
{% endif %}
@@ -132,11 +137,11 @@ <h2>{% trans "Key details" %}: {{ key_details.name }}</h2>
<fieldset class="module aligned key-data">
<h2>{% trans "Key data" %}: {{ key_details.name }}</h2>
<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>
{% endfor %}
</table>
- {% if key_details.data.paginator %}
+ {% if key_details.data.paginator and key_details.data.paginator.num_pages > 1 %}
<p class="paginator">
{% for nr in key_details.data.paginator.page_range %}
{% if key_details.data.number == nr %}
View
@@ -11,7 +11,7 @@
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):
try:
@@ -75,7 +75,7 @@ def _get_key_details(conn, db, key, page):
curry(VALUE_GETTERS[details['type']], conn, key)
),
REDISBOARD_ITEMS_PER_PAGE
- ).page(page).object_list
+ ).page(page)
else:
details['data'] = VALUE_GETTERS[details['type']](conn, key)

0 comments on commit 74bef1c

Please sign in to comment.