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
35b5c815
Unverified
Commit
35b5c815
authored
Feb 15, 2021
by
seb-b
Committed by
GitHub
Feb 15, 2021
Browse files
Merge pull request #60 from jkevingutierrez/master
Fix copies
parents
cf01a878
c2f40628
Changes
7
Hide whitespace changes
Inline
Side-by-side
wagtailvideos/forms.py
View file @
35b5c815
...
@@ -24,7 +24,7 @@ class BaseVideoForm(BaseCollectionMemberForm):
...
@@ -24,7 +24,7 @@ class BaseVideoForm(BaseCollectionMemberForm):
self
.
fields
[
'file'
].
required
=
'file'
not
in
self
.
initial
or
not
self
.
initial
[
'file'
]
self
.
fields
[
'file'
].
required
=
'file'
not
in
self
.
initial
or
not
self
.
initial
[
'file'
]
# Callback to allow us to override the default form field for the
image
file field
# Callback to allow us to override the default form field for the
video
file field
def
formfield_for_dbfield
(
db_field
,
**
kwargs
):
def
formfield_for_dbfield
(
db_field
,
**
kwargs
):
# Check if this is the file field
# Check if this is the file field
if
db_field
.
name
==
'file'
:
if
db_field
.
name
==
'file'
:
...
@@ -75,7 +75,7 @@ class VideoTranscodeAdminForm(forms.Form):
...
@@ -75,7 +75,7 @@ class VideoTranscodeAdminForm(forms.Form):
GroupVideoPermissionFormSet
=
collection_member_permission_formset_factory
(
GroupVideoPermissionFormSet
=
collection_member_permission_formset_factory
(
Video
,
Video
,
[
[
(
'add_video'
,
_
(
"Add"
),
_
(
"Add/edit
image
s you own"
)),
(
'add_video'
,
_
(
"Add"
),
_
(
"Add/edit
video
s you own"
)),
(
'change_video'
,
_
(
"Edit"
),
_
(
"Edit any video"
)),
(
'change_video'
,
_
(
"Edit"
),
_
(
"Edit any video"
)),
],
],
'wagtailvideos/permissions/includes/video_permissions_formset.html'
'wagtailvideos/permissions/includes/video_permissions_formset.html'
...
...
wagtailvideos/templates/wagtailvideos/multiple/edit_form.html
View file @
35b5c815
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</li>
</li>
</ul>
</ul>
</form>
</form>
<div
data-video-thumb=
"{{ video.id }}"
class=
'thumb icon icon-
image
hasthumb'
>
<div
data-video-thumb=
"{{ video.id }}"
class=
'thumb icon icon-
media
hasthumb'
>
{% if video.thumbnail %}
{% if video.thumbnail %}
<img
src=
"{{ video.thumbnail.url }}"
/>
<img
src=
"{{ video.thumbnail.url }}"
/>
{% endif %}
{% endif %}
...
...
wagtailvideos/templates/wagtailvideos/videos/add.html
View file @
35b5c815
{% extends "wagtailadmin/base.html" %}
{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% load i18n %}
{% block titletag %}{% trans "Add a
n image
" %}{% endblock %}
{% block titletag %}{% trans "Add a
video
" %}{% endblock %}
{% block extra_js %}
{% block extra_js %}
{{ block.super }}
{{ block.super }}
...
...
wagtailvideos/templates/wagtailvideos/videos/confirm_delete.html
View file @
35b5c815
{% extends "wagtailadmin/base.html" %}
{% extends "wagtailadmin/base.html" %}
{% load wagtailvideos_tags %}
{% load wagtailvideos_tags %}
{% load i18n %}
{% load i18n %}
{% block titletag %}{% trans "Delete
image
" %}{% endblock %}
{% block titletag %}{% trans "Delete
video
" %}{% endblock %}
{% block content %}
{% block content %}
{% trans "Delete
image
" as del_str %}
{% trans "Delete
video
" as del_str %}
{% include "wagtailadmin/shared/header.html" with title=del_str icon="
image
" %}
{% include "wagtailadmin/shared/header.html" with title=del_str icon="
media
" %}
<div
class=
"row row-flush nice-padding"
>
<div
class=
"row row-flush nice-padding"
>
<div
class=
"col6"
>
<div
class=
"col6"
>
...
...
wagtailvideos/views/chooser.py
View file @
35b5c815
...
@@ -26,8 +26,8 @@ permission_checker = PermissionPolicyChecker(permission_policy)
...
@@ -26,8 +26,8 @@ permission_checker = PermissionPolicyChecker(permission_policy)
def
get_video_json
(
video
):
def
get_video_json
(
video
):
"""
"""
helper function: given a
n image
, return the json to pass back to the
helper function: given a
video
, return the json to pass back to the
image
chooser panel
video
chooser panel
"""
"""
return
{
return
{
...
...
wagtailvideos/views/multiple.py
View file @
35b5c815
...
@@ -114,7 +114,7 @@ def edit(request, video_id, callback=None):
...
@@ -114,7 +114,7 @@ def edit(request, video_id, callback=None):
if
form
.
is_valid
():
if
form
.
is_valid
():
form
.
save
()
form
.
save
()
# Reindex the
image
to make sure all tags are indexed
# Reindex the
video
to make sure all tags are indexed
for
backend
in
get_search_backends
():
for
backend
in
get_search_backends
():
backend
.
add
(
video
)
backend
.
add
(
video
)
...
...
wagtailvideos/views/videos.py
View file @
35b5c815
...
@@ -100,7 +100,7 @@ def edit(request, video_id):
...
@@ -100,7 +100,7 @@ def edit(request, video_id):
video
=
form
.
save
()
video
=
form
.
save
()
video
.
save
()
video
.
save
()
# Reindex the
image
to make sure all tags are indexed
# Reindex the
video
to make sure all tags are indexed
for
backend
in
get_search_backends
():
for
backend
in
get_search_backends
():
backend
.
add
(
video
)
backend
.
add
(
video
)
...
@@ -111,7 +111,7 @@ def edit(request, video_id):
...
@@ -111,7 +111,7 @@ def edit(request, video_id):
form
=
VideoForm
(
instance
=
video
)
form
=
VideoForm
(
instance
=
video
)
if
not
video
.
_meta
.
get_field
(
'file'
).
storage
.
exists
(
video
.
file
.
name
):
if
not
video
.
_meta
.
get_field
(
'file'
).
storage
.
exists
(
video
.
file
.
name
):
# Give error if
image
file doesn't exist
# Give error if
video
file doesn't exist
messages
.
error
(
request
,
_
(
messages
.
error
(
request
,
_
(
"The source video file could not be found. Please change the source or delete the video."
"The source video file could not be found. Please change the source or delete the video."
).
format
(
video
.
title
),
buttons
=
[
).
format
(
video
.
title
),
buttons
=
[
...
...
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