Fixed all links that sentry marked as errors:
+ Some versions don't getting reverse URLs + Pages wasn't linking property + Using reverse for all URLs + Version details can show info from more than one release
This commit is contained in:
parent
c5b9517573
commit
d4f45fac07
|
@ -8,7 +8,7 @@
|
|||
It's public in this state so the people can see its progress over time,
|
||||
and send feedback/suggestions to the staff.
|
||||
</p>
|
||||
<p class="text-center">For more details about the project, go to the <a href="/about">about section</a>.</p>
|
||||
<p class="text-center">For more details about the project, go to the <a href="{{ url('aboutpage') }}">about section</a>.</p>
|
||||
<p class="text-center">Happy minning!</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<div class="container" style="width: auto;">
|
||||
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<a class="btn btn-navbar" data-toggle="collapse"
|
||||
data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
|
@ -25,15 +26,15 @@
|
|||
<div class="nav-collapse">
|
||||
<ul class="nav">
|
||||
<li class="{% if section == 'home' %}active{% endif %}">
|
||||
<a href="/">Home</a>
|
||||
<a href="{{ url('homepage') }}">Home</a>
|
||||
</li>
|
||||
<li class="{% if section == 'versions' %}active{% endif %}">
|
||||
<a href="/versions">Versions</a>
|
||||
<a href="{{ url('version_list') }}">Versions</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav pull-right">
|
||||
<li class="pull-right {% if section == 'about' %}active{% endif %}">
|
||||
<a href="/about">About the project</a>
|
||||
<a href="{{ url('aboutpage') }}">About the project</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div><!-- /.nav-collapse -->
|
||||
|
|
|
@ -1,21 +1,27 @@
|
|||
{% extends "layout.html" %}
|
||||
|
||||
{% block head_title %}
|
||||
{{ super() }} | Version | {{ item.version_number }}
|
||||
{{ super() }} | Version | {{ version_number }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Minecraft versions</h1>
|
||||
<hr />
|
||||
<a href="/versions"><i class="icon-arrow-left"></i> Go back</a>
|
||||
<h2>{% if item.status != 'release' %}{{ item.status }}{% endif %} {{ item.version_number }}</h2>
|
||||
Released on {{ item.date }}
|
||||
{% if item.jarfiles %}
|
||||
<h3>Downloads</h3>
|
||||
{% for jarfile in item.jarfiles %}
|
||||
<a href="{{ jarfile.url }}" class="btn btn-info btn-small">{{ jarfile.description|capitalize }}</a>
|
||||
{% endfor %}
|
||||
<a href="/versions/"><i class="icon-arrow-left"></i> Go back</a>
|
||||
<h2>{% if status != 'release' %}{{ status }}{% endif %} {{ version_number }}</h2>
|
||||
{% if results > 1 %}
|
||||
<div class="alert alert-info">This version contains more than one release.</div>
|
||||
{% endif %}
|
||||
<h3>Changelog</h3>
|
||||
<p>{{ item.changelog|nl2br }}</p>
|
||||
{% for version in items %}
|
||||
<hr />
|
||||
Released on {{ version.date }}
|
||||
{% if version.jarfiles %}
|
||||
<h3>Downloads</h3>
|
||||
{% for jarfile in version.jarfiles %}
|
||||
<a href="{{ jarfile.url }}" class="btn btn-info btn-small">{{ jarfile.description|capitalize }}</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<h3>Changelog</h3>
|
||||
<p>{{ version.changelog|nl2br }}</p>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<ul>
|
||||
{% for p in range(1, paginator.num_pages) %}
|
||||
<li {% if p == page_number %}class="active"{% endif %}>
|
||||
<a href="?page={{ p }}">{{ p }}</a>
|
||||
<a href="{{ url('version_list') }}?page={{ p }}">{{ p }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -11,7 +11,8 @@ def home(request):
|
|||
|
||||
def versions(request):
|
||||
section = 'versions'
|
||||
versions = Version.objects.filter(snapshot=False).order_by('-date', '-version_number')
|
||||
versions = Version.objects.filter(snapshot=False).\
|
||||
order_by('-date', '-version_number')
|
||||
paginator = Paginator(versions, 50)
|
||||
page_number = 1
|
||||
|
||||
|
@ -30,12 +31,17 @@ def versions(request):
|
|||
|
||||
return render_to_response('versions.html', context_instance=context)
|
||||
|
||||
|
||||
def version(request, version, status='release'):
|
||||
section = 'versions'
|
||||
item = Version.objects.get(status=status, version_number=version)
|
||||
items = Version.objects.filter(status=status, version_number=version).\
|
||||
order_by('-date')
|
||||
data = {
|
||||
'version_number': version,
|
||||
'status': status,
|
||||
'section': section,
|
||||
'item': item,
|
||||
'items': items,
|
||||
'results': len(items)
|
||||
}
|
||||
context = RequestContext(request, data)
|
||||
return render_to_response('version.html', context_instance=context)
|
||||
|
|
|
@ -16,15 +16,24 @@ urlpatterns = patterns('',
|
|||
# Uncomment the next line to enable the admin:
|
||||
(r'^grappelli/', include('grappelli.urls')),
|
||||
url(r'^management/', include(admin.site.urls)),
|
||||
url(r'^$', 'database.views.home'),
|
||||
# Home
|
||||
url(r'^$', 'database.views.home', name='homepage'),
|
||||
# Static
|
||||
url(r'^about/', 'database.views.about'),
|
||||
# Database
|
||||
url(r'^versions/(?P<version>[a-z0-9\.\_]+)/', 'database.views.version', name='version_release'),
|
||||
url(r'^versions/(?P<status>[a-z]+)\-(?P<version>[a-z0-9\.\_]+)/', 'database.views.version', name='version'),
|
||||
url(r'^versions/', 'database.views.versions'),
|
||||
url(r'^about/', 'database.views.about', name='aboutpage'),
|
||||
# Versions
|
||||
url(r'^versions/(?P<version>[A-Za-z0-9\.\_ ]+)/',
|
||||
'database.views.version',
|
||||
name='version_release'
|
||||
),
|
||||
url(r'^versions/(?P<status>[a-z]+)\-(?P<version>[A-Za-z0-9\.\_ ]+)/',
|
||||
'database.views.version',
|
||||
name='version'
|
||||
),
|
||||
url(r'^versions/', 'database.views.versions', name='version_list'),
|
||||
|
||||
# Robots
|
||||
(r'^robots\.txt$', lambda r: HttpResponse("", mimetype="text/plain")),
|
||||
|
||||
# Favicon
|
||||
(r'^favicon\.ico$', lambda r: HttpResponseRedirect('/static/favicon.ico')),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue