0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-24 10:58:52 +01:00

Merge pull request #384 from kaedroho/deprecation-warning-cleanup

Fixed useages of deprecated templatetags
This commit is contained in:
Karl Hobley 2014-06-28 19:15:28 +01:00
commit f9d7e9c2dd
21 changed files with 29 additions and 26 deletions

View File

@ -1,4 +1,5 @@
{% load pageurl %}
{% load wagtailcore_tags %}
<!DOCTYPE HTML>
<html>
<head>

View File

@ -1,4 +1,5 @@
{% load pageurl %}
{% load wagtailcore_tags %}
<!DOCTYPE HTML>
<html>
<head>

View File

@ -1,4 +1,5 @@
{% load pageurl %}
{% load wagtailcore_tags %}
<!DOCTYPE HTML>
<html>
<head>

View File

@ -1,4 +1,4 @@
{% load pageurl %}
{% load wagtailcore_tags %}
<ul>
{% for event in events %}

View File

@ -1,4 +1,5 @@
{% load pageurl %}
{% load wagtailcore_tags %}
<!DOCTYPE HTML>
<html>
<head>

View File

@ -1,6 +1,6 @@
{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% load image_tags %}
{% load wagtailimages_tags %}
{% block titletag %}{% trans "Add a document" %}{% endblock %}
{% block bodyclass %}menu-documents{% endblock %}
{% block extra_css %}

View File

@ -1,6 +1,6 @@
{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% load image_tags %}
{% load wagtailimages_tags %}
{% block titletag %}{% blocktrans with title=document.title %}Editing {{ title }}{% endblocktrans %}{% endblock %}
{% block bodyclass %}menu-documents{% endblock %}
{% block extra_css %}

View File

@ -1,4 +1,4 @@
{% load image_tags %}
{% load wagtailimages_tags %}
{% load i18n %}
{% trans "Insert embed" as ins_emb_str %}
{% include "wagtailadmin/shared/header.html" with title=ins_emb_str merged=1 %}

View File

@ -19,8 +19,7 @@ from wagtail.wagtailembeds.embeds import (
AccessDeniedEmbedlyException,
)
from wagtail.wagtailembeds.embeds import embedly as wagtail_embedly, oembed as wagtail_oembed
from wagtail.wagtailembeds.templatetags.embed_filters import embed as embed_filter
from wagtail.wagtailembeds.templatetags.embed_filters import embedly as embedly_filter
from wagtail.wagtailembeds.templatetags.wagtailembeds_tags import embed as embed_filter, embedly as embedly_filter
class TestEmbeds(TestCase):
@ -284,7 +283,7 @@ class TestEmbedFilter(TestCase):
urlopen.return_value = self.dummy_response
loads.return_value = {'type': 'photo',
'url': 'http://www.example.com'}
temp = template.Template('{% load embed_filters %}{{ "http://www.youtube.com/watch/"|embed }}')
temp = template.Template('{% load wagtailembeds_tags %}{{ "http://www.youtube.com/watch/"|embed }}')
context = template.Context()
result = temp.render(context)
self.assertEqual(result, '<img src="http://www.example.com" />')
@ -295,7 +294,7 @@ class TestEmbedFilter(TestCase):
urlopen.return_value = self.dummy_response
loads.return_value = {'type': 'foo',
'url': 'http://www.example.com'}
temp = template.Template('{% load embed_filters %}{{ "http://www.youtube.com/watch/"|embed }}')
temp = template.Template('{% load wagtailembeds_tags %}{{ "http://www.youtube.com/watch/"|embed }}')
context = template.Context()
result = temp.render(context)
self.assertEqual(result, '')

View File

@ -1,4 +1,4 @@
{% load image_tags %}
{% load wagtailimages_tags %}
{% load i18n %}
{% trans "Choose an image" as choose_str %}
{% include "wagtailadmin/shared/header.html" with title=choose_str merged=1 tabbed=1 icon="image" %}

View File

@ -1,4 +1,4 @@
{% load image_tags wagtailadmin_tags %}
{% load wagtailimages_tags wagtailadmin_tags %}
{% load i18n %}
{% if images %}
{% if is_searching %}

View File

@ -1,4 +1,4 @@
{% load image_tags %}
{% load wagtailimages_tags %}
{% load i18n %}
{% trans "Choose a format" as choose_str %}
{% include "wagtailadmin/shared/header.html" with title=choose_str %}

View File

@ -1,5 +1,5 @@
{% extends "wagtailadmin/edit_handlers/chooser_panel.html" %}
{% load image_tags %}
{% load wagtailimages_tags %}
{% load i18n %}
{% block chooser_class %}image-chooser{% endblock %}

View File

@ -1,5 +1,5 @@
{% extends "wagtailadmin/base.html" %}
{% load image_tags %}
{% load wagtailimages_tags %}
{% load i18n %}
{% block titletag %}{% trans "Add an image" %}{% endblock %}
{% block bodyclass %}menu-images{% endblock %}

View File

@ -1,5 +1,5 @@
{% extends "wagtailadmin/base.html" %}
{% load image_tags %}
{% load wagtailimages_tags %}
{% load i18n %}
{% block titletag %}{% trans "Delete image" %}{% endblock %}
{% block bodyclass %}menu-images{% endblock %}

View File

@ -1,5 +1,5 @@
{% extends "wagtailadmin/base.html" %}
{% load image_tags %}
{% load wagtailimages_tags %}
{% load i18n %}
{% block titletag %}{% blocktrans with title=image.title %}Editing image {{ title }}{% endblocktrans %}{% endblock %}
{% block bodyclass %}menu-images{% endblock %}

View File

@ -1,5 +1,5 @@
{% extends "wagtailadmin/base.html" %}
{% load image_tags %}
{% load wagtailimages_tags %}
{% load i18n %}
{% block titletag %}{% trans "Images" %}{% endblock %}

View File

@ -1,4 +1,4 @@
{% load image_tags wagtailadmin_tags %}
{% load wagtailimages_tags wagtailadmin_tags %}
{% load i18n %}
{% if images %}
{% if is_searching %}

View File

@ -191,7 +191,7 @@ class TestImageTag(TestCase):
)
def render_image_tag(self, image, filter_spec):
temp = template.Template('{% load image_tags %}{% image image_obj ' + filter_spec + '%}')
temp = template.Template('{% load wagtailimages_tags %}{% image image_obj ' + filter_spec + '%}')
context = template.Context({'image_obj': image})
return temp.render(context)
@ -204,7 +204,7 @@ class TestImageTag(TestCase):
self.assertTrue('alt="Test image"' in result)
def render_image_tag_as(self, image, filter_spec):
temp = template.Template('{% load image_tags %}{% image image_obj ' + filter_spec + ' as test_img %}<img {{ test_img.attrs }} />')
temp = template.Template('{% load wagtailimages_tags %}{% image image_obj ' + filter_spec + ' as test_img %}<img {{ test_img.attrs }} />')
context = template.Context({'image_obj': image})
return temp.render(context)
@ -217,7 +217,7 @@ class TestImageTag(TestCase):
self.assertTrue('alt="Test image"' in result)
def render_image_tag_with_extra_attributes(self, image, title):
temp = template.Template('{% load image_tags %}{% image image_obj width-400 class="photo" title=title|lower %}')
temp = template.Template('{% load wagtailimages_tags %}{% image image_obj width-400 class="photo" title=title|lower %}')
context = template.Context({'image_obj': image, 'title': title})
return temp.render(context)

View File

@ -1,5 +1,5 @@
{% extends "wagtailadmin/base.html" %}
{% load image_tags %}
{% load wagtailimages_tags %}
{% load i18n %}
{% block titletag %}{% trans "Add user" %}{% endblock %}
{% block bodyclass %}menu-users{% endblock %}

View File

@ -1,5 +1,5 @@
{% extends "wagtailadmin/base.html" %}
{% load image_tags %}
{% load wagtailimages_tags %}
{% load i18n %}
{% block titletag %}{% trans "Editing" %} {{ user.username}}{% endblock %}
{% block bodyclass %}menu-users{% endblock %}