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
e7702361
Commit
e7702361
authored
Jan 29, 2021
by
Seb
Browse files
Cleanup
parent
df2262e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
wagtailvideos/models.py
View file @
e7702361
...
@@ -77,7 +77,7 @@ def get_upload_to(instance, filename):
...
@@ -77,7 +77,7 @@ def get_upload_to(instance, filename):
return
instance
.
get_upload_to
(
filename
)
return
instance
.
get_upload_to
(
filename
)
class
AbstractVideo
(
CollectionMember
,
index
.
Indexed
,
Clusterable
Model
):
class
AbstractVideo
(
CollectionMember
,
index
.
Indexed
,
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
_
(
'title'
))
title
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
_
(
'title'
))
file
=
models
.
FileField
(
file
=
models
.
FileField
(
verbose_name
=
_
(
'file'
),
upload_to
=
get_upload_to
)
verbose_name
=
_
(
'file'
),
upload_to
=
get_upload_to
)
...
...
wagtailvideos/wagtail_hooks.py
View file @
e7702361
...
@@ -23,6 +23,8 @@ Video = get_video_model()
...
@@ -23,6 +23,8 @@ Video = get_video_model()
class
TracksAdmin
(
ModelAdmin
):
class
TracksAdmin
(
ModelAdmin
):
model
=
TrackListing
model
=
TrackListing
menu_icon
=
'openquote'
menu_label
=
'Text tracks'
list_display
=
(
'__str__'
,
'track_count'
)
list_display
=
(
'__str__'
,
'track_count'
)
...
@@ -102,7 +104,7 @@ def register_images_menu_item():
...
@@ -102,7 +104,7 @@ def register_images_menu_item():
def
hide_track_listing_main
(
request
,
menu_items
):
def
hide_track_listing_main
(
request
,
menu_items
):
# Dumb but we need to remove the auto generated menu item because we add it to the video submenu
# Dumb but we need to remove the auto generated menu item because we add it to the video submenu
if
is_modeladmin_installed
():
if
is_modeladmin_installed
():
menu_items
[:]
=
[
item
for
item
in
menu_items
if
item
.
name
!=
't
rack-listing
s'
]
menu_items
[:]
=
[
item
for
item
in
menu_items
if
item
.
name
!=
't
ext-track
s'
]
class
VideoSummaryItem
(
SummaryItem
):
class
VideoSummaryItem
(
SummaryItem
):
...
...
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