mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 12:49:01 +02:00
Upgrade to Django 1.6+
I'd like to be upgrading to 1.8 but that causes problems with South, and we're not quite ready to dispense with our existing migrations yet. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
fee87f4353
commit
82266556cd
18
README
18
README
|
@ -11,22 +11,22 @@ Setup
|
|||
|
||||
In order to make use of this application you will need:
|
||||
|
||||
* Django 1.4.x - tested with 1.4.1-1.4.10; newer versions may work, but
|
||||
the application has not been tested with 1.5 or newer.
|
||||
* Django 1.6.x - tested with 1.6.10; newer versions may work, but
|
||||
the application has not been tested with 1.7 or newer.
|
||||
* For production usage, a web server set up to host Django applications
|
||||
(not needed for local-only testing)
|
||||
* A database supported by Django (SQLite, MySQL, etc.). Django takes
|
||||
care of creating the database itself, you just need to ensure that the
|
||||
database server (if not using SQLite) is configured and running.
|
||||
* The following third-party Django modules (tested versions listed):
|
||||
* django-south (0.8.4)
|
||||
* django-south (1.0.2)
|
||||
* django-registration (1.0)
|
||||
* django-reversion (1.7.1)
|
||||
* django-reversion-compare (0.3.5)
|
||||
* django-simple-captcha (0.4.1)
|
||||
* django-nvd3 (0.6.0)
|
||||
* djangorestframework (2.3.14)
|
||||
* django-cors-headers (0.12)
|
||||
* django-reversion (1.8.7)
|
||||
* django-reversion-compare (0.4.0)
|
||||
* django-simple-captcha (0.4.6)
|
||||
* django-nvd3 (0.9.7)
|
||||
* djangorestframework (3.2.5)
|
||||
* django-cors-headers (1.1.0)
|
||||
* On the machine that will run the backend update script (which does not
|
||||
have to be the same machine as the web server, however it does still
|
||||
have to have Django installed, have the same or similar configuration
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
from layerindex.models import LayerItem, LayerBranch, LayerMaintainer, LayerNote, RecipeChangeset, RecipeChange, ClassicRecipe
|
||||
from django import forms
|
||||
from django.core.validators import URLValidator, RegexValidator, email_re
|
||||
from django.core.validators import URLValidator, RegexValidator, EmailValidator
|
||||
from django.forms.models import inlineformset_factory, modelformset_factory
|
||||
from captcha.fields import CaptchaField
|
||||
from django.contrib.auth.models import User
|
||||
|
@ -29,9 +29,8 @@ class LayerMaintainerForm(forms.ModelForm):
|
|||
if email:
|
||||
if len(email) < 7:
|
||||
raise forms.ValidationError('%s is not a valid email address' % email)
|
||||
reg = re.compile(email_re)
|
||||
if not reg.match(email):
|
||||
raise forms.ValidationError('%s is not a valid email address' % email)
|
||||
val = EmailValidator()
|
||||
val(email)
|
||||
|
||||
return email
|
||||
|
||||
|
@ -115,21 +114,21 @@ class EditLayerForm(forms.ModelForm):
|
|||
def clean_vcs_web_tree_base_url(self):
|
||||
url = self.cleaned_data['vcs_web_tree_base_url'].strip()
|
||||
if url:
|
||||
val = URLValidator(verify_exists=False)
|
||||
val = URLValidator()
|
||||
val(url)
|
||||
return url
|
||||
|
||||
def clean_vcs_web_file_base_url(self):
|
||||
url = self.cleaned_data['vcs_web_file_base_url'].strip()
|
||||
if url:
|
||||
val = URLValidator(verify_exists=False)
|
||||
val = URLValidator()
|
||||
val(url)
|
||||
return url
|
||||
|
||||
def clean_usage_url(self):
|
||||
usage = self.cleaned_data['usage_url'].strip()
|
||||
if usage.startswith('http'):
|
||||
val = URLValidator(verify_exists=False)
|
||||
val = URLValidator()
|
||||
val(usage)
|
||||
return usage
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from models import Branch, LayerItem, LayerNote, LayerBranch, LayerDependency, Recipe, Machine
|
||||
from layerindex.models import Branch, LayerItem, LayerNote, LayerBranch, LayerDependency, Recipe, Machine
|
||||
from rest_framework import viewsets, serializers
|
||||
from querysethelper import params_to_queryset, get_search_tuple
|
||||
from layerindex.querysethelper import params_to_queryset, get_search_tuple
|
||||
|
||||
class ParametricSearchableModelViewSet(viewsets.ModelViewSet):
|
||||
def get_queryset(self):
|
||||
|
|
|
@ -4,9 +4,8 @@
|
|||
#
|
||||
# Licensed under the MIT license, see COPYING.MIT for details
|
||||
|
||||
from django.conf.urls.defaults import *
|
||||
from django.views.generic import TemplateView, DetailView, ListView
|
||||
from django.views.generic.simple import redirect_to
|
||||
from django.conf.urls import *
|
||||
from django.views.generic import TemplateView, DetailView, ListView, RedirectView
|
||||
from django.views.defaults import page_not_found
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from layerindex.views import LayerListView, LayerReviewListView, LayerReviewDetailView, RecipeSearchView, MachineSearchView, PlainTextListView, LayerDetailView, edit_layer_view, delete_layer_view, edit_layernote_view, delete_layernote_view, HistoryListView, EditProfileFormView, AdvancedRecipeSearchView, BulkChangeView, BulkChangeSearchView, bulk_change_edit_view, bulk_change_patch_view, BulkChangeDeleteView, RecipeDetailView, RedirectParamsView, ClassicRecipeSearchView, ClassicRecipeDetailView, ClassicRecipeStatsView
|
||||
|
@ -24,19 +23,20 @@ router.register(r'recipes', restviews.RecipeViewSet)
|
|||
router.register(r'machines', restviews.MachineViewSet)
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^$', redirect_to, {'url' : reverse_lazy('layer_list', args=('master',))},
|
||||
url(r'^$',
|
||||
RedirectView.as_view(url=reverse_lazy('layer_list', args=('master',))),
|
||||
name='frontpage'),
|
||||
|
||||
url(r'^api/', include(router.urls)),
|
||||
|
||||
url(r'^layers/$',
|
||||
redirect_to, {'url' : reverse_lazy('layer_list', args=('master',))}),
|
||||
RedirectView.as_view(url=reverse_lazy('layer_list', args=('master',)))),
|
||||
url(r'^layer/(?P<slug>[-\w]+)/$',
|
||||
RedirectParamsView.as_view(), {'redirect_name': 'layer_item', 'branch':'master'}),
|
||||
url(r'^recipes/$',
|
||||
redirect_to, {'url' : reverse_lazy('recipe_search', args=('master',))}),
|
||||
RedirectView.as_view(url=reverse_lazy('recipe_search', args=('master',)))),
|
||||
url(r'^machines/$',
|
||||
redirect_to, {'url' : reverse_lazy('machine_search', args=('master',))}),
|
||||
RedirectView.as_view(url=reverse_lazy('machine_search', args=('master',)))),
|
||||
|
||||
url(r'^submit/$', edit_layer_view, {'template_name': 'layerindex/submitlayer.html'}, name="submit_layer"),
|
||||
url(r'^submit/thanks$',
|
||||
|
@ -107,7 +107,7 @@ urlpatterns = patterns('',
|
|||
template_name='layerindex/about.html'),
|
||||
name="about"),
|
||||
url(r'^oe-classic/$',
|
||||
redirect_to, {'url' : reverse_lazy('classic_recipe_search')},
|
||||
RedirectView.as_view(url=reverse_lazy('classic_recipe_search')),
|
||||
name='classic'),
|
||||
url(r'^oe-classic/recipes/$',
|
||||
ClassicRecipeSearchView.as_view(
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
#
|
||||
# Licensed under the MIT license, see COPYING.MIT for details
|
||||
|
||||
from django.conf.urls.defaults import *
|
||||
from django.views.generic.simple import redirect_to
|
||||
from django.conf.urls import *
|
||||
from django.views.defaults import page_not_found
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from layerindex.views import LayerListView, RecipeSearchView, MachineSearchView, PlainTextListView, LayerDetailView, edit_layer_view, delete_layer_view, edit_layernote_view, delete_layernote_view, RedirectParamsView, DuplicatesView
|
||||
|
|
|
@ -57,12 +57,6 @@ def setup_django():
|
|||
sys.path.append(newpath)
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
|
||||
|
||||
from django.core.management import setup_environ
|
||||
from django.conf import settings
|
||||
import settings
|
||||
|
||||
setup_environ(settings)
|
||||
|
||||
def logger_create(name):
|
||||
logger = logging.getLogger(name)
|
||||
loggerhandler = logging.StreamHandler()
|
||||
|
|
20
manage.py
20
manage.py
|
@ -6,20 +6,14 @@
|
|||
#
|
||||
# Copyright (c) Django Software Foundation and individual contributors.
|
||||
# All rights reserved.
|
||||
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
|
||||
from django.core.management import execute_manager
|
||||
import imp
|
||||
try:
|
||||
imp.find_module('settings') # Assumed to be in the same directory.
|
||||
except ImportError:
|
||||
import sys
|
||||
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
|
||||
sys.exit(1)
|
||||
|
||||
import settings
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
|
||||
execute_manager(settings)
|
||||
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
Django<1.5
|
||||
GitPython>=0.3.7
|
||||
Jinja2==2.7.3
|
||||
Django==1.6.11
|
||||
django-cors-headers==1.1.0
|
||||
django-nvd3==0.9.7
|
||||
django-registration==1.0
|
||||
django-reversion==1.8.7
|
||||
django-reversion-compare==0.4.0
|
||||
django-simple-captcha==0.4.6
|
||||
djangorestframework==3.2.5
|
||||
gitdb==0.6.4
|
||||
GitPython==2.0.5
|
||||
Jinja2==2.8
|
||||
MarkupSafe==0.23
|
||||
Pillow>=2.4.0
|
||||
South==0.8.4
|
||||
Unidecode==0.04.16
|
||||
argparse==1.2.1
|
||||
awesome-slugify==1.5
|
||||
django-cors-headers==0.12
|
||||
django-nvd3==0.7.4
|
||||
django-registration==0.8
|
||||
django-reversion==1.6.6
|
||||
django-reversion-compare==0.3.5
|
||||
django-simple-captcha==0.4.2
|
||||
djangorestframework==2.3.14
|
||||
python-nvd3==0.12.2
|
||||
regex==2014.06.28
|
||||
six==1.7.3
|
||||
wsgiref==0.1.2
|
||||
mysqlclient==1.3.7
|
||||
Pillow==3.2.0
|
||||
python-nvd3==0.14.2
|
||||
python-slugify==1.1.4
|
||||
six==1.10.0
|
||||
smmap==0.9.0
|
||||
South==1.0.2
|
||||
Unidecode==0.4.19
|
||||
|
|
|
@ -141,7 +141,7 @@ TEMPLATE_DIRS = (
|
|||
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
||||
# Always use forward slashes, even on Windows.
|
||||
# Don't forget to use absolute paths, not relative paths.
|
||||
BASE_DIR + "/templates"
|
||||
BASE_DIR + "/templates",
|
||||
)
|
||||
|
||||
INSTALLED_APPS = (
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<p>The page you requested was not found.</p>
|
||||
|
||||
<p><a href="{% url frontpage %}">Return to the front page</a></p>
|
||||
<p><a href="{% url 'frontpage' %}">Return to the front page</a></p>
|
||||
|
||||
{% endautoescape %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container-fluid">
|
||||
<a class="brand" href="{% url frontpage %}">{{ site_name }}</a>
|
||||
<a class="brand" href="{% url 'frontpage' %}">{{ site_name }}</a>
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<div class="btn-group pull-right">
|
||||
{% if perms.layerindex.publish_layer %}
|
||||
{% if unpublished_count > 0 %}
|
||||
<a class="btn" href="{% url layer_list_review %}?branch=master">
|
||||
<a class="btn" href="{% url 'layer_list_review' %}?branch=master">
|
||||
<span class="badge badge-warning review-notification">{{ unpublished_count }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
@ -49,15 +49,15 @@
|
|||
<b class="caret"></b>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{% url auth_logout %}">{% trans "Log out" %}</a></li>
|
||||
<li><a href="{% url auth_password_change %}">{% trans "Change password" %}</a></li>
|
||||
<li><a href="{% url profile %}">{% trans "Edit profile" %}</a></li>
|
||||
<li><a href="{% url 'auth_logout' %}">{% trans "Log out" %}</a></li>
|
||||
<li><a href="{% url 'auth_password_change' %}">{% trans "Change password" %}</a></li>
|
||||
<li><a href="{% url 'profile' %}">{% trans "Edit profile" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% else %}
|
||||
{% if application == 'layerindex' %}
|
||||
<div class="pull-right">
|
||||
<a class="btn" href="{% url auth_login %}">{% trans "Log in" %}</a>
|
||||
<a class="btn" href="{% url 'auth_login' %}">{% trans "Log in" %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
@ -68,7 +68,7 @@
|
|||
{% endif %}
|
||||
{% block topfunctions %}
|
||||
<div class="pull-right nav-spacer">
|
||||
<a class="btn btn-info" href="{% url submit_layer %}">Submit layer</a>
|
||||
<a class="btn btn-info" href="{% url 'submit_layer' %}">Submit layer</a>
|
||||
</div>
|
||||
<ul class="nav pull-right">
|
||||
{% if user.is_authenticated %}
|
||||
|
@ -78,8 +78,8 @@
|
|||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{% url bulk_change %}">Bulk Change</a></li>
|
||||
<li><a href="{% url duplicates 'master' %}">Duplicates</a></li>
|
||||
<li><a href="{% url 'bulk_change' %}">Bulk Change</a></li>
|
||||
<li><a href="{% url 'duplicates' 'master' %}">Duplicates</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
@ -109,8 +109,8 @@
|
|||
<hr />
|
||||
<div class="footer">
|
||||
{% if application == 'layerindex' %}
|
||||
<a href="{% url history_list %}">change history</a>
|
||||
• <a href="{% url about %}">about this site</a>
|
||||
<a href="{% url 'history_list' %}">change history</a>
|
||||
• <a href="{% url 'about' %}">about this site</a>
|
||||
• <a href="http://www.openembedded.org/Layers_FAQ">FAQ</a>
|
||||
{% else %}
|
||||
<a href="{% url about %}">About the Recipe Reporting System</a>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% load url from future %}
|
||||
{% comment %}
|
||||
|
||||
layerindex-web - top level page template
|
||||
|
@ -56,4 +55,4 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<p>This website indexes layers for the <a href="http://www.openembedded.org">OpenEmbedded</a> build system provided by members of the OpenEmbedded / Yocto Project community, suitable for use on top of OpenEmbedded-Core and compatible systems, providing additional recipes, machine support and/or distro policy configuration.</p>
|
||||
|
||||
<p>If you have a layer for use with OpenEmbedded that you wish to share with others, please <a href="{% url submit_layer %}">submit it</a>!</p>
|
||||
<p>If you have a layer for use with OpenEmbedded that you wish to share with others, please <a href="{% url 'submit_layer' %}">submit it</a>!</p>
|
||||
|
||||
<h3>Technologies</h3>
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ generate a patch for these changes which can be submitted for merging.</p>
|
|||
<h3>Select an existing changeset</h3>
|
||||
<ul>
|
||||
{% for changeset in changesets %}
|
||||
<li><a href="{% url bulk_change_search changeset.id %}">{{ changeset.name }}</a></li>
|
||||
<li><a href="{% url 'bulk_change_search' changeset.id %}">{{ changeset.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
|
|
@ -37,10 +37,10 @@
|
|||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<a href="{% url bulk_change_search changeset.id %}" class="btn">Add recipes</a>
|
||||
<a href="{% url bulk_change_edit changeset.id %}" class="btn">Edit</a>
|
||||
<a href="{% url bulk_change_patches changeset.id %}" class="btn">Get patches</a>
|
||||
<a href="{% url bulk_change_delete changeset.id %}?cancel=bulk_change_review" class="btn">Delete</a>
|
||||
<a href="{% url 'bulk_change_search' changeset.id %}" class="btn">Add recipes</a>
|
||||
<a href="{% url 'bulk_change_edit' changeset.id %}" class="btn">Edit</a>
|
||||
<a href="{% url 'bulk_change_patches' changeset.id %}" class="btn">Get patches</a>
|
||||
<a href="{% url 'bulk_change_delete' changeset.id %}?cancel=bulk_change_review" class="btn">Delete</a>
|
||||
|
||||
{% endautoescape %}
|
||||
|
||||
|
|
|
@ -78,10 +78,10 @@
|
|||
{% for recipe in recipe_list %}
|
||||
<tr>
|
||||
<td><input type="checkbox" name="selecteditems" value="{{ recipe.id }}"></input></td>
|
||||
<td><a href="{% url recipe recipe.id %}">{{ recipe.name }}</a></td>
|
||||
<td><a href="{% url 'recipe' recipe.id %}">{{ recipe.name }}</a></td>
|
||||
<td>{{ recipe.pv }}</td>
|
||||
<td>{{ recipe.short_desc }}</td>
|
||||
<td><a href="{% url layer_item current_branch recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a></td>
|
||||
<td><a href="{% url 'layer_item' current_branch recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
@ -120,9 +120,9 @@
|
|||
</ul>
|
||||
</small>
|
||||
<input type="submit" class="btn" name="remove_all" value="Remove all"></input>
|
||||
<a href="{% url bulk_change_edit changeset.id %}" class="btn">Edit</a>
|
||||
<a href="{% url 'bulk_change_edit' changeset.id %}" class="btn">Edit</a>
|
||||
{% endif %}
|
||||
<a href="{% url bulk_change_delete changeset.id %}?cancel=bulk_change_search" class="btn">Delete</a>
|
||||
<a href="{% url 'bulk_change_delete' changeset.id %}?cancel=bulk_change_search" class="btn">Delete</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
{% for branch in all_branches %}
|
||||
<li><a href="{% url layer_list branch.name %}">
|
||||
<li><a href="{% url 'layer_list' branch.name %}">
|
||||
{{ branch.name }}
|
||||
{% if branch.short_description %}
|
||||
({{ branch.short_description }})
|
||||
|
@ -32,7 +32,7 @@
|
|||
</a></li>
|
||||
{% endfor %}
|
||||
<li class="divider"></li>
|
||||
<li><a href="{% url classic %}"><b>OE-Classic</b></a></li>
|
||||
<li><a href="{% url 'classic' %}"><b>OE-Classic</b></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% endautoescape %}
|
||||
|
@ -48,9 +48,9 @@
|
|||
|
||||
<p>OpenEmbedded-Classic (OE-Classic) is the name for the old monolithic version of OpenEmbedded. It contained a number of recipes some of which have not yet been migrated on top of OE-Core. To help people to find and migrate these recipes we provide an index here as well as some statistics to get an idea of the migration.</p>
|
||||
|
||||
<a class="btn btn-large btn-primary" href="{% url classic_recipe_search %}">Recipes</a>
|
||||
<a class="btn btn-large" href="{% url classic_recipe_search %}?q=&cover_status=!">Unmigrated Recipes</a>
|
||||
<a class="btn btn-large btn-primary" href="{% url classic_recipe_stats %}">Stats</a>
|
||||
<a class="btn btn-large btn-primary" href="{% url 'classic_recipe_search' %}">Recipes</a>
|
||||
<a class="btn btn-large" href="{% url 'classic_recipe_search' %}?q=&cover_status=!">Unmigrated Recipes</a>
|
||||
<a class="btn btn-large btn-primary" href="{% url 'classic_recipe_stats' %}">Stats</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
{% autoescape on %}
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{% url classic_recipe_search %}">OE-Classic</a> <span class="divider">→</span></li>
|
||||
<li><a href="{% url 'classic_recipe_search' %}">OE-Classic</a> <span class="divider">→</span></li>
|
||||
<li class="active">{{ recipe.name }}</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
{% block navs %}
|
||||
{% autoescape on %}
|
||||
<li class="active"><a href="{% url classic_recipe_search %}">Recipes</a></li>
|
||||
<li><a href="{% url classic_recipe_stats %}">Stats</a></li>
|
||||
<li class="active"><a href="{% url 'classic_recipe_search' %}">Recipes</a></li>
|
||||
<li><a href="{% url 'classic_recipe_stats' %}">Stats</a></li>
|
||||
{% endautoescape %}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
|||
<h2>OE-Classic recipes</h2>
|
||||
|
||||
<div class="alert alert-warning">
|
||||
<b>NOTE:</b> This is the recipe search for OE-Classic, the older monolithic version of OpenEmbedded which is no longer actively developed. <a href="{% url recipe_search 'master' %}">Click here</a> to search current recipes.
|
||||
<b>NOTE:</b> This is the recipe search for OE-Classic, the older monolithic version of OpenEmbedded which is no longer actively developed. <a href="{% url 'recipe_search' 'master' %}">Click here</a> to search current recipes.
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
|
@ -72,13 +72,13 @@
|
|||
<tbody>
|
||||
{% for recipe in recipe_list %}
|
||||
<tr {% if recipe.preferred_count > 0 %}class="muted"{% endif %}>
|
||||
<td><a href="{% url classic_recipe recipe.id %}">{{ recipe.name }}</a></td>
|
||||
<td><a href="{% url 'classic_recipe' recipe.id %}">{{ recipe.name }}</a></td>
|
||||
<td>{{ recipe.pv }}</td>
|
||||
<td>{{ recipe.short_desc }}</td>
|
||||
<td>{{ recipe.get_cover_desc }}</td>
|
||||
<td>{{ recipe.classic_category }}</td>
|
||||
{% if multi_classic_layers %}
|
||||
<td><a href="{% url layer_item recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a></td>
|
||||
<td><a href="{% url 'layer_item' recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a></td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
{% block navs %}
|
||||
{% autoescape on %}
|
||||
<li><a href="{% url classic_recipe_search %}">Recipes</a></li>
|
||||
<li class="active"><a href="{% url classic_recipe_stats %}">Stats</a></li>
|
||||
<li><a href="{% url 'classic_recipe_search' %}">Recipes</a></li>
|
||||
<li class="active"><a href="{% url 'classic_recipe_stats' %}">Stats</a></li>
|
||||
{% endautoescape %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
{% autoescape on %}
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{% url layer_list url_branch %}">{{ layerbranch.branch.name }}</a> <span class="divider">→</span></li>
|
||||
<li><a href="{% url 'layer_list' url_branch %}">{{ layerbranch.branch.name }}</a> <span class="divider">→</span></li>
|
||||
<li class="active">{{ layeritem.name }}</li>
|
||||
</ul>
|
||||
|
||||
|
@ -36,9 +36,9 @@
|
|||
{% if user.is_authenticated %}
|
||||
<span class="pull-right">
|
||||
{% if perms.layerindex.publish_layer or useredit %}
|
||||
<a href="{% url edit_layer url_branch layeritem.name %}" class="btn">Edit layer</a>
|
||||
<a href="{% url 'edit_layer' url_branch layeritem.name %}" class="btn">Edit layer</a>
|
||||
{% if layeritem.layernote_set.count = 0 %}
|
||||
<a href="{% url add_layernote layeritem.name %}" class="btn">Add note</a>
|
||||
<a href="{% url 'add_layernote' layeritem.name %}" class="btn">Add note</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</span>
|
||||
|
@ -63,8 +63,8 @@
|
|||
{% if perms.layerindex.publish_layer or useredit %}
|
||||
<br><br>
|
||||
<p>
|
||||
<a href="{% url edit_layernote layeritem.name note.pk %}" class="btn">Edit note</a>
|
||||
<a href="{% url delete_layernote layeritem.name note.pk %}" class='btn'>Delete note</a>
|
||||
<a href="{% url 'edit_layernote' layeritem.name note.pk %}" class="btn">Edit note</a>
|
||||
<a href="{% url 'delete_layernote' layeritem.name note.pk %}" class='btn'>Delete note</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -144,7 +144,7 @@
|
|||
<p>The {{ layeritem.name }} layer depends upon:</p>
|
||||
<ul>
|
||||
{% for dep in layerbranch.dependencies_set.all %}
|
||||
<li><a href="{% url layer_item url_branch dep.dependency.name %}">{{ dep.dependency.name }}</a></li>
|
||||
<li><a href="{% url 'layer_item' url_branch dep.dependency.name %}">{{ dep.dependency.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div> <!-- end of well -->
|
||||
|
@ -198,7 +198,7 @@
|
|||
<tbody>
|
||||
{% for recipe in layerbranch.sorted_recipes %}
|
||||
<tr>
|
||||
<td><a href="{% url recipe recipe.id %}">{{ recipe.name }}</a>{% if 'image' in recipe.inherits.split %}<i class="icon-hdd"></i>{% endif %}{% if recipe.blacklisted %}<span class="label label-inverse" title="{{ recipe.blacklisted }}">blacklisted</span>{% endif %}</td>
|
||||
<td><a href="{% url 'recipe' recipe.id %}">{{ recipe.name }}</a>{% if 'image' in recipe.inherits.split %}<i class="icon-hdd"></i>{% endif %}{% if recipe.blacklisted %}<span class="label label-inverse" title="{{ recipe.blacklisted }}">blacklisted</span>{% endif %}</td>
|
||||
<td>{{ recipe.pv }}</td>
|
||||
<td class="span8">{{ recipe.short_desc }}</td>
|
||||
</tr>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "base_toplevel.html" %}
|
||||
{% load i18n %}
|
||||
{% load url from future %}
|
||||
|
||||
{% comment %}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Save" class='btn' />
|
||||
<a href="{% url layer_item 'master' form.instance.layer.name %}" class='btn'>Cancel</a>
|
||||
<a href="{% url 'layer_item' 'master' form.instance.layer.name %}" class='btn'>Cancel</a>
|
||||
</form>
|
||||
|
||||
{% endautoescape %}
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
{% block navs %}
|
||||
{% autoescape on %}
|
||||
<li class="active"><a href="{% url layer_list url_branch %}">Layers</a></li>
|
||||
<li><a href="{% url recipe_search url_branch %}">Recipes</a></li>
|
||||
<li><a href="{% url machine_search url_branch %}">Machines</a></li>
|
||||
<li class="active"><a href="{% url 'layer_list' url_branch %}">Layers</a></li>
|
||||
<li><a href="{% url 'recipe_search' url_branch %}">Recipes</a></li>
|
||||
<li><a href="{% url 'machine_search' url_branch %}">Machines</a></li>
|
||||
{% endautoescape %}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -71,7 +71,7 @@
|
|||
<tbody>
|
||||
{% for layerbranch in layerbranch_list %}
|
||||
<tr class="layertype_{{ layerbranch.layer.layer_type }}">
|
||||
<td><a href="{% url layer_item url_branch layerbranch.layer.name %}">{{ layerbranch.layer.name }}</a></td>
|
||||
<td><a href="{% url 'layer_item' url_branch layerbranch.layer.name %}">{{ layerbranch.layer.name }}</a></td>
|
||||
<td>{{ layerbranch.layer.summary }}</td>
|
||||
<td>{{ layerbranch.layer.get_layer_type_display }}</td>
|
||||
<td class="showRollie">
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
{% block navs %}
|
||||
{% autoescape on %}
|
||||
<li><a href="{% url layer_list url_branch %}">Layers</a></li>
|
||||
<li><a href="{% url recipe_search url_branch %}">Recipes</a></li>
|
||||
<li class="active"><a href="{% url machine_search url_branch %}">Machines</a></li>
|
||||
<li><a href="{% url 'layer_list' url_branch %}">Layers</a></li>
|
||||
<li><a href="{% url 'recipe_search' url_branch %}">Recipes</a></li>
|
||||
<li class="active"><a href="{% url 'machine_search' url_branch %}">Machines</a></li>
|
||||
{% endautoescape %}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
|||
|
||||
<div class="row-fluid">
|
||||
<div class="input-append">
|
||||
<form id="filter-form" action="{% url machine_search url_branch %}" method="get">
|
||||
<form id="filter-form" action="{% url 'machine_search' url_branch %}" method="get">
|
||||
<input type="text" class="input-xxlarge" id="appendedInputButtons" placeholder="Search machines" name="q" value="{{ search_keyword }}" />
|
||||
<button class="btn" type="submit">search</button>
|
||||
</form>
|
||||
|
@ -52,7 +52,7 @@
|
|||
<tr>
|
||||
<td><a href="{{ machine.vcs_web_url }}">{{ machine.name }}</a></td>
|
||||
<td>{{ machine.description }}</td>
|
||||
<td><a href="{% url layer_item url_branch machine.layerbranch.layer.name %}">{{ machine.layerbranch.layer.name }}</a></td>
|
||||
<td><a href="{% url 'layer_item' url_branch machine.layerbranch.layer.name %}">{{ machine.layerbranch.layer.name }}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
{% endfor %}
|
||||
|
||||
<input type="submit" class="btn" value="{% trans 'Save' %}" />
|
||||
<a class="btn" href="{% url frontpage %}">{% trans 'Cancel' %}</a>
|
||||
<a class="btn" href="{% url 'frontpage' %}">{% trans 'Cancel' %}</a>
|
||||
{% csrf_token %}
|
||||
</form>
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
{% autoescape on %}
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{% url layer_list recipe.layerbranch.branch.name %}">{{ recipe.layerbranch.branch.name }}</a> <span class="divider">→</span></li>
|
||||
<li><a href="{% url layer_item recipe.layerbranch.branch.name recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a> <span class="divider">→</span></li>
|
||||
<li><a href="{% url 'layer_list' recipe.layerbranch.branch.name %}">{{ recipe.layerbranch.branch.name }}</a> <span class="divider">→</span></li>
|
||||
<li><a href="{% url 'layer_item' recipe.layerbranch.branch.name recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a> <span class="divider">→</span></li>
|
||||
<li class="active">{{ recipe.name }}</li>
|
||||
</ul>
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
|||
{% if recipe.blacklisted %}
|
||||
<div class="alert">
|
||||
<div class="row-fluid">
|
||||
<p>This recipe is <strong>blacklisted</strong> by the <a href="{% url layer_item recipe.layerbranch.branch.name recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a> layer. The reason provided is:</p>
|
||||
<p>This recipe is <strong>blacklisted</strong> by the <a href="{% url 'layer_item' recipe.layerbranch.branch.name recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a> layer. The reason provided is:</p>
|
||||
<blockquote class="span7 warn">
|
||||
<p>{{ recipe.blacklisted }}</p>
|
||||
</blockquote>
|
||||
|
@ -92,7 +92,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th>Layer</th>
|
||||
<td><a href="{% url layer_item recipe.layerbranch.branch.name recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a> ({{ recipe.layerbranch.branch.name}} branch)</td>
|
||||
<td><a href="{% url 'layer_item' recipe.layerbranch.branch.name recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a> ({{ recipe.layerbranch.branch.name}} branch)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Inherits</th>
|
||||
|
@ -116,7 +116,7 @@
|
|||
{% for append in verappends %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{% url layer_item append.layerbranch.branch.name append.layerbranch.layer.name %}">{{ append.layerbranch.layer.name }}</a>
|
||||
<a href="{% url 'layer_item' append.layerbranch.branch.name append.layerbranch.layer.name %}">{{ append.layerbranch.layer.name }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ append.vcs_web_url }}">{{ append.filename }}</a>
|
||||
|
@ -127,7 +127,7 @@
|
|||
{% if not append in verappends %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{% url layer_item append.layerbranch.branch.name append.layerbranch.layer.name %}" class="muted">{{ append.layerbranch.layer.name }}</a>
|
||||
<a href="{% url 'layer_item' append.layerbranch.branch.name append.layerbranch.layer.name %}" class="muted">{{ append.layerbranch.layer.name }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ append.vcs_web_url }}" class="muted">{{ append.filename }}</a>
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
{% block navs %}
|
||||
{% autoescape on %}
|
||||
<li><a href="{% url layer_list url_branch %}">Layers</a></li>
|
||||
<li class="active"><a href="{% url recipe_search url_branch %}">Recipes</a></li>
|
||||
<li><a href="{% url machine_search url_branch %}">Machines</a></li>
|
||||
<li><a href="{% url 'layer_list' url_branch %}">Layers</a></li>
|
||||
<li class="active"><a href="{% url 'recipe_search' url_branch %}">Recipes</a></li>
|
||||
<li><a href="{% url 'machine_search' url_branch %}">Machines</a></li>
|
||||
{% endautoescape %}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
|||
|
||||
<div class="row-fluid">
|
||||
<div class="input-append">
|
||||
<form id="filter-form" action="{% url recipe_search url_branch %}" method="get">
|
||||
<form id="filter-form" action="{% url 'recipe_search' url_branch %}" method="get">
|
||||
<input type="text" class="input-xxlarge" id="appendedInputButtons" placeholder="Search recipes" name="q" value="{{ search_keyword }}" />
|
||||
<button class="btn" type="submit">search</button>
|
||||
</form>
|
||||
|
@ -52,10 +52,10 @@
|
|||
<tbody>
|
||||
{% for recipe in recipe_list %}
|
||||
<tr {% if recipe.preferred_count > 0 %}class="muted"{% endif %}>
|
||||
<td><a href="{% url recipe recipe.id %}">{{ recipe.name }}</a>{% if 'image' in recipe.inherits.split %}<i class="icon-hdd"></i>{% endif %}{% if recipe.blacklisted %}<span class="label label-inverse" title="{{ recipe.blacklisted }}">blacklisted</span>{% endif %}</td>
|
||||
<td><a href="{% url 'recipe' recipe.id %}">{{ recipe.name }}</a>{% if 'image' in recipe.inherits.split %}<i class="icon-hdd"></i>{% endif %}{% if recipe.blacklisted %}<span class="label label-inverse" title="{{ recipe.blacklisted }}">blacklisted</span>{% endif %}</td>
|
||||
<td>{{ recipe.pv }}</td>
|
||||
<td>{{ recipe.short_desc }}</td>
|
||||
<td><a href="{% url layer_item url_branch recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a></td>
|
||||
<td><a href="{% url 'layer_item' url_branch recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
@ -35,14 +35,14 @@
|
|||
{% if user.is_authenticated %}
|
||||
<span class="pull-right">
|
||||
{% if perms.layerindex.publish_layer or useredit %}
|
||||
<a href="{% url edit_layer 'master' layeritem.name %}?returnto=layer_review" class="btn">Edit layer</a>
|
||||
<a href="{% url 'edit_layer' 'master' layeritem.name %}?returnto=layer_review" class="btn">Edit layer</a>
|
||||
{% if layeritem.layernote_set.count = 0 %}
|
||||
<a href="{% url add_layernote layeritem.name %}" class="btn">Add note</a>
|
||||
<a href="{% url 'add_layernote' layeritem.name %}" class="btn">Add note</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if layeritem.status = "N" and perms.layerindex.publish_layer %}
|
||||
<a href="{% url delete_layer layeritem.name %}" class="btn btn-warning">Delete layer</a>
|
||||
<a href="{% url publish layeritem.name %}" class="btn btn-primary">Publish layer</a>
|
||||
<a href="{% url 'delete_layer' layeritem.name %}" class="btn btn-warning">Delete layer</a>
|
||||
<a href="{% url 'publish' layeritem.name %}" class="btn btn-primary">Publish layer</a>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
@ -58,8 +58,8 @@
|
|||
<p>{{ note.text }}</p>
|
||||
{% if perms.layerindex.publish_layer or useredit %}
|
||||
<p>
|
||||
<a href="{% url edit_layernote layeritem.name note.pk %}" class="btn">Edit note</a>
|
||||
<a href="{% url delete_layernote layeritem.name note.pk %}" class='btn'>Delete note</a>
|
||||
<a href="{% url 'edit_layernote' layeritem.name note.pk %}" class="btn">Edit note</a>
|
||||
<a href="{% url 'delete_layernote' layeritem.name note.pk %}" class='btn'>Delete note</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -163,7 +163,7 @@
|
|||
<td>
|
||||
<ul class="unstyled">
|
||||
{% for dep in layerbranch.dependencies_set.all %}
|
||||
<li><a href="{% url layer_item 'master' dep.dependency.name %}">{{ dep.dependency.name }}</a></li>
|
||||
<li><a href="{% url 'layer_item' 'master' dep.dependency.name %}">{{ dep.dependency.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</td>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<tbody>
|
||||
{% for layerbranch in layerbranch_list %}
|
||||
<tr class="layertype_{{ layerbranch.layer.layer_type }}">
|
||||
<td><a href="{% url layer_review layerbranch.layer.name %}">{{ layerbranch.layer.name }}</a></td>
|
||||
<td><a href="{% url 'layer_review' layerbranch.layer.name %}">{{ layerbranch.layer.name }}</a></td>
|
||||
<td>{{ layerbranch.layer.summary }}</td>
|
||||
<td>{{ layerbranch.layer.get_layer_type_display }}</td>
|
||||
<td class="showRollie">
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<p>{% trans "Account successfully activated" %}</p>
|
||||
|
||||
<p><a href="{% url auth_login %}">{% trans "Log in" %}</a></p>
|
||||
<p><a href="{% url "auth_login" %}">{% trans "Log in" %}</a></p>
|
||||
|
||||
{% else %}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ link is valid for {{ expiration_days }} days.
|
|||
|
||||
{% endblocktrans %}
|
||||
|
||||
http://{{ site.domain }}{% url registration_activate activation_key %}
|
||||
http://{{ site.domain }}{% url "registration_activate" activation_key %}
|
||||
|
||||
{% blocktrans %}
|
||||
If you did not make this request, please ignore this message.
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
{% csrf_token %}
|
||||
</form>
|
||||
|
||||
<p>{% trans "Forgot password" %}? <a href="{% url auth_password_reset %}">{% trans "Reset it" %}</a>!</p>
|
||||
<p>{% trans "Don't have an account" %}? <a href="{% url registration_register %}">{% trans "Create one now" %}</a>!</p>
|
||||
<p>{% trans "Forgot password" %}? <a href="{% url "auth_password_reset" %}">{% trans "Reset it" %}</a>!</p>
|
||||
<p>{% trans "Don't have an account" %}? <a href="{% url "registration_register" %}">{% trans "Create one now" %}</a>!</p>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
|
||||
<p>{% trans "Password reset successfully" %}</p>
|
||||
|
||||
<p><a href="{% url auth_login %}">{% trans "Log in" %}</a></p>
|
||||
<p><a href="{% url "auth_login" %}">{% trans "Log in" %}</a></p>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% load i18n %}
|
||||
{% blocktrans %}Reset password at {{ site_name }}{% endblocktrans %}:
|
||||
{% block reset_link %}
|
||||
{{ protocol }}://{{ domain }}{% url auth_password_reset_confirm uidb36=uid, token=token %}
|
||||
{{ protocol }}://{{ domain }}{% url "auth_password_reset_confirm" uidb36=uid, token=token %}
|
||||
{% endblock %}
|
||||
|
|
9
urls.py
9
urls.py
|
@ -5,10 +5,15 @@
|
|||
# Copyright (c) Django Software Foundation and individual contributors.
|
||||
# All rights reserved.
|
||||
|
||||
<<<<<<< HEAD
|
||||
import settings
|
||||
|
||||
from django.conf.urls.defaults import patterns, include, url
|
||||
from django.views.generic.simple import redirect_to
|
||||
=======
|
||||
from django.conf.urls import patterns, include, url
|
||||
from django.views.generic import RedirectView
|
||||
>>>>>>> 5c17970... Upgrade to Django 1.6+
|
||||
|
||||
from django.contrib import admin
|
||||
admin.autodiscover()
|
||||
|
@ -22,10 +27,10 @@ urlpatterns = patterns('',
|
|||
if settings.APPLICATION == 'layerindex':
|
||||
urlpatterns += patterns('',
|
||||
url(r'^layerindex/', include('layerindex.urls')),
|
||||
url(r'.*', redirect_to, {'url' : '/layerindex/'}),
|
||||
url(r'.*', RedirectView.as_view(url='/layerindex/')),
|
||||
)
|
||||
elif settings.APPLICATION == 'rrs':
|
||||
urlpatterns += patterns('',
|
||||
url(r'^rrs/', include('rrs.urls')),
|
||||
url(r'.*', redirect_to, {'url' : '/rrs/'}),
|
||||
url(r'.*', RedirectView.as_view(url='/rrs/')),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user