Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Wagtail Videos
Commits
2c510b0d
Unverified
Commit
2c510b0d
authored
Nov 04, 2022
by
Seb Brown
Committed by
GitHub
Nov 04, 2022
Browse files
Merge pull request #98 from crgwbr/feat_support_wagtail41
Remove usage of usage_count_enabled template tag
parents
59b5cd63
fbdd10b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
settings.py
View file @
2c510b0d
...
...
@@ -15,6 +15,5 @@ INSTALLED_APPS += [
]
WAGTAILVIDEOS_VIDEO_MODEL
=
'app.CustomVideoModel'
WAGTAIL_USAGE_COUNT_ENABLED
=
True
DEFAULT_AUTO_FIELD
=
'django.db.models.AutoField'
tests/test_admin_views.py
View file @
2c510b0d
...
...
@@ -221,8 +221,7 @@ class TestVideoEditView(TestCase, WagtailTestUtils):
# Ensure the form supports file uploads
self
.
assertContains
(
response
,
'enctype="multipart/form-data"'
)
@
override_settings
(
WAGTAIL_USAGE_COUNT_ENABLED
=
True
)
def
test_with_usage_count
(
self
):
def
test_usage_count
(
self
):
response
=
self
.
get
()
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertTemplateUsed
(
response
,
'wagtailvideos/videos/edit.html'
)
...
...
wagtailvideos/templates/wagtailvideos/videos/edit.html
View file @
2c510b0d
...
...
@@ -67,13 +67,10 @@
<dt>
{% trans "Duration" %}
</dt>
<dd>
{{ video.formatted_duration }}
</dd>
{% endif %}
{% usage_count_enabled as uc_enabled %}
{% if uc_enabled %}
<dt>
{% trans "Usage" %}
</dt>
<dd>
<a
href=
"{{ video.usage_url }}"
>
{% blocktrans count usage_count=video.get_usage.count %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}
</a>
</dd>
{% endif %}
<dt>
{% trans "Usage" %}
</dt>
<dd>
<a
href=
"{{ video.usage_url }}"
>
{% blocktrans count usage_count=video.get_usage.count %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}
</a>
</dd>
</dl>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment