mirror of
https://github.com/evennia/evennia.git
synced 2026-03-31 04:57:16 +02:00
Added compatibility with Django 1.5. New minimum version is 1.4.
This commit is contained in:
parent
0f2762d5f2
commit
9d0b8b5fe7
8 changed files with 22 additions and 24 deletions
|
|
@ -134,5 +134,5 @@ if __name__ == "__main__":
|
|||
nothing about MUDs). Instead, just start Evennia with the
|
||||
webserver component active (this is the default).
|
||||
"""
|
||||
from django.core.management import execute_manager
|
||||
execute_manager(settings)
|
||||
from django.core.management import execute_from_command_line
|
||||
execute_from_command_line(sys.argv)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ like news-categories/topics and searchable archives.
|
|||
|
||||
"""
|
||||
|
||||
import django.views.generic.list_detail as gv_list_detail
|
||||
from django.views.generic import ListView
|
||||
from django.shortcuts import render_to_response, get_object_or_404
|
||||
from django.template import RequestContext
|
||||
from django.conf import settings
|
||||
|
|
@ -66,8 +66,9 @@ def news_archive(request):
|
|||
"browse_url": "/news/archive",
|
||||
"sidebar": sidebar
|
||||
}
|
||||
|
||||
return gv_list_detail.object_list(request, news_entries, template_name='news/archive.html', extra_context=pagevars, paginate_by=entries_per_page)
|
||||
view = ListView.as_view(queryset=news_entries)
|
||||
return view(request, template_name='news/archive.html', \
|
||||
extra_context=pagevars, paginate_by=entries_per_page)
|
||||
|
||||
def search_form(request):
|
||||
"""
|
||||
|
|
@ -124,5 +125,5 @@ def search_results(request):
|
|||
"browse_url": "/news/search/results",
|
||||
"sidebar": sidebar
|
||||
}
|
||||
|
||||
return gv_list_detail.object_list(request, news_entries, template_name='news/archive.html', extra_context=pagevars, paginate_by=entries_per_page)
|
||||
view = ListView.as_view(queryset=news_entries)
|
||||
return view(request, news_entries, template_name='news/archive.html', extra_context=pagevars, paginate_by=entries_per_page)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n %}
|
||||
{% load i18n admin_static %}
|
||||
|
||||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css" />{% endblock %}
|
||||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %}
|
||||
|
||||
{% block coltype %}colMS{% endblock %}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n admin_modify adminmedia %}
|
||||
{% load url from future %}
|
||||
{% load i18n admin_modify admin_static %}
|
||||
|
||||
{% block extrahead %}{{ block.super }}
|
||||
{% url 'admin:jsi18n' as jsi18nurl %}
|
||||
|
|
@ -8,7 +7,7 @@
|
|||
{{ media }}
|
||||
{% endblock %}
|
||||
|
||||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
|
||||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %}
|
||||
|
||||
{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
{% extends "admin/base_site.html" %}
|
||||
{% load adminmedia admin_list i18n %}
|
||||
{% load url from future %}
|
||||
{% load admin_static admin_list i18n %}
|
||||
{% block extrastyle %}
|
||||
{{ block.super }}
|
||||
<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/changelists.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
|
||||
{% if cl.formset %}
|
||||
<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
|
||||
{% endif %}
|
||||
{% if cl.formset or action_form %}
|
||||
{% url 'admin:jsi18n' as jsi18nurl %}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{% load i18n adminmedia %}
|
||||
{% load i18n admin_static %}
|
||||
<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
|
||||
<!--h2>{{ inline_admin_formset.opts.verbose_name_plural|title }}</h2-->
|
||||
{{ inline_admin_formset.formset.management_form }}
|
||||
|
|
@ -40,11 +40,11 @@
|
|||
if (typeof SelectFilter != "undefined"){
|
||||
$(".selectfilter").each(function(index, value){
|
||||
var namearr = value.name.split('-');
|
||||
SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% admin_media_prefix %}");
|
||||
SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% static "admin/" %}");
|
||||
});
|
||||
$(".selectfilterstacked").each(function(index, value){
|
||||
var namearr = value.name.split('-');
|
||||
SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% admin_media_prefix %}");
|
||||
SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% static "admin/" %}");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
from django.conf.urls.defaults import *
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.views.generic import RedirectView
|
||||
|
||||
# fix to resolve lazy-loading bug
|
||||
# https://code.djangoproject.com/ticket/10405#comment:11
|
||||
|
|
@ -31,7 +32,7 @@ urlpatterns = patterns('',
|
|||
# Front page
|
||||
url(r'^', include('src.web.website.urls')),
|
||||
# News stuff
|
||||
url(r'^news/', include('src.web.news.urls')),
|
||||
# url(r'^news/', include('src.web.news.urls')),
|
||||
|
||||
# Page place-holder for things that aren't implemented yet.
|
||||
url(r'^tbi/', 'src.web.website.views.to_be_implemented'),
|
||||
|
|
@ -41,7 +42,7 @@ urlpatterns = patterns('',
|
|||
url(r'^admin/', include(admin.site.urls)),
|
||||
|
||||
# favicon
|
||||
url(r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url':'/media/images/favicon.ico'}),
|
||||
url(r'^favicon\.ico$', RedirectView.as_view(url='/media/images/favicon.ico')),
|
||||
|
||||
# ajax stuff
|
||||
url(r'^webclient/',include('src.web.webclient.urls')),
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
This structures the (simple) structure of the
|
||||
webpage 'application'.
|
||||
"""
|
||||
from django.views.generic.simple import direct_to_template
|
||||
from django.conf.urls.defaults import *
|
||||
from django.conf.urls import *
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^$', 'src.web.webclient.views.webclient'),)
|
||||
#url(r'^$', direct_to_template, {'template': 'webclient.html'}),)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue