Improved blocks and items listing layout a lot. Added details URL only viewable by admins
This commit is contained in:
parent
c2f2588331
commit
b9ab39991c
|
@ -3,6 +3,35 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Blocks</h1>
|
<h1>Blocks</h1>
|
||||||
<hr />
|
<hr />
|
||||||
|
<div class="row-fluid">
|
||||||
|
{% for item in page.object_list %}
|
||||||
|
<div class="span3">
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
<a href="{{ url('blocks_detail', item.data_value) }}">
|
||||||
|
{% else %}
|
||||||
|
<a href="#">
|
||||||
|
{% endif %}
|
||||||
|
<div class="well">
|
||||||
|
<div class="pull-right text-right">
|
||||||
|
<span class="badge">{{ item.data_value }}</span>
|
||||||
|
<h5 class="text-black">{{ item.name() }}</h5>
|
||||||
|
</div>
|
||||||
|
<div class="codexicon x4 margin-auto pull-left">
|
||||||
|
{% if item.main_texture %}
|
||||||
|
<img src="/static/textures/{{ item.main_texture.get_image(4) }}" />
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% if loop.index % 4 == 0 %}
|
||||||
|
</div>
|
||||||
|
<div class="row-fluid">
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{#
|
||||||
<table class="table table-condensed table-hover">
|
<table class="table table-condensed table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -31,6 +60,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
#}
|
||||||
<div class="pagination pagination-centered">
|
<div class="pagination pagination-centered">
|
||||||
<ul>
|
<ul>
|
||||||
{% for p in range(1, paginator.num_pages+1) %}
|
{% for p in range(1, paginator.num_pages+1) %}
|
||||||
|
|
|
@ -3,6 +3,35 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Items</h1>
|
<h1>Items</h1>
|
||||||
<hr />
|
<hr />
|
||||||
|
<div class="row-fluid">
|
||||||
|
{% for item in page.object_list %}
|
||||||
|
<div class="span3">
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
<a href="{{ url('items_detail', item.data_value + 256) }}">
|
||||||
|
{% else %}
|
||||||
|
<a href="#">
|
||||||
|
{% endif %}
|
||||||
|
<div class="well">
|
||||||
|
<div class="pull-right text-right">
|
||||||
|
<span class="badge">{{ item.data_value + 256 }}</span>
|
||||||
|
<h5 class="text-black">{{ item.name() }}</h5>
|
||||||
|
</div>
|
||||||
|
<div class="codexicon x4 margin-auto pull-left">
|
||||||
|
{% if item.main_texture %}
|
||||||
|
<img src="/static/textures/{{ item.main_texture.get_image(4) }}" />
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% if loop.index % 4 == 0 %}
|
||||||
|
</div>
|
||||||
|
<div class="row-fluid">
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{#
|
||||||
<table class="table table-condensed table-hover">
|
<table class="table table-condensed table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -31,6 +60,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
#}
|
||||||
<div class="pagination pagination-centered">
|
<div class="pagination pagination-centered">
|
||||||
<ul>
|
<ul>
|
||||||
{% for p in range(1, paginator.num_pages+1) %}
|
{% for p in range(1, paginator.num_pages+1) %}
|
||||||
|
|
|
@ -51,7 +51,7 @@ def items(request):
|
||||||
section = 'items'
|
section = 'items'
|
||||||
|
|
||||||
items = Item.objects.all().order_by('data_value')
|
items = Item.objects.all().order_by('data_value')
|
||||||
paginator = Paginator(items, 50)
|
paginator = Paginator(items, 48)
|
||||||
page_number = 1
|
page_number = 1
|
||||||
|
|
||||||
if 'page' in request.GET:
|
if 'page' in request.GET:
|
||||||
|
@ -69,11 +69,15 @@ def items(request):
|
||||||
return render_to_response('items.html', context_instance=context)
|
return render_to_response('items.html', context_instance=context)
|
||||||
|
|
||||||
|
|
||||||
|
def items_detail(request, data_value):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def blocks(request):
|
def blocks(request):
|
||||||
section = 'blocks'
|
section = 'blocks'
|
||||||
|
|
||||||
items = Block.objects.all().order_by('data_value')
|
items = Block.objects.all().order_by('data_value')
|
||||||
paginator = Paginator(items, 50)
|
paginator = Paginator(items, 48)
|
||||||
page_number = 1
|
page_number = 1
|
||||||
|
|
||||||
if 'page' in request.GET:
|
if 'page' in request.GET:
|
||||||
|
@ -91,6 +95,10 @@ def blocks(request):
|
||||||
return render_to_response('blocks.html', context_instance=context)
|
return render_to_response('blocks.html', context_instance=context)
|
||||||
|
|
||||||
|
|
||||||
|
def blocks_detail(request, data_value):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def about(request):
|
def about(request):
|
||||||
context = RequestContext(request, {'section': 'about'})
|
context = RequestContext(request, {'section': 'about'})
|
||||||
return render_to_response('about.html', context_instance=context)
|
return render_to_response('about.html', context_instance=context)
|
||||||
|
|
|
@ -38,9 +38,11 @@ urlpatterns = patterns('',
|
||||||
|
|
||||||
# Items
|
# Items
|
||||||
url(r'^items/', 'database.views.items', name='items_list'),
|
url(r'^items/', 'database.views.items', name='items_list'),
|
||||||
|
url(r'^items/(?P<data_value>\d+)/', 'database.views.items_detail', name='items_detail'),
|
||||||
|
|
||||||
# Items
|
# Items
|
||||||
url(r'^blocks/', 'database.views.blocks', name='blocks_list'),
|
url(r'^blocks/', 'database.views.blocks', name='blocks_list'),
|
||||||
|
url(r'^blocks/(?P<data_value>\d+)/', 'database.views.blocks_detail', name='blocks_detail'),
|
||||||
|
|
||||||
# Blog
|
# Blog
|
||||||
url(r'^blog/$', 'blog.views.blog', name='blog_list'),
|
url(r'^blog/$', 'blog.views.blog', name='blog_list'),
|
||||||
|
|
Loading…
Reference in New Issue