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
c6b9c2f9
Commit
c6b9c2f9
authored
Aug 03, 2016
by
Seb
Browse files
Fixed areas that would fail if no thumbnail is found for the video
parent
e998fd3b
Changes
6
Hide whitespace changes
Inline
Side-by-side
wagtailvideos/templates/wagtailvideos/chooser/results.html
View file @
c6b9c2f9
...
@@ -17,7 +17,13 @@
...
@@ -17,7 +17,13 @@
{% for video in videos %}
{% for video in videos %}
<li>
<li>
<a
class=
"image-choice"
href=
"{% if will_select_format %}{% url 'wagtailvideos:chooser_select_format' video.id %}{% else %}{% url 'wagtailvideos:video_chosen' video.id %}{% endif %}"
>
<a
class=
"image-choice"
href=
"{% if will_select_format %}{% url 'wagtailvideos:chooser_select_format' video.id %}{% else %}{% url 'wagtailvideos:video_chosen' video.id %}{% endif %}"
>
<div
class=
"image"
><img
src=
'{{video.thumbnail.url}}'
width=
"165"
height=
"165"
class=
"show-transparency"
></div>
<div
class=
"image"
>
{% if video.thumbnail %}
<img
src=
'{{video.thumbnail.url}}'
width=
"165"
height=
"165"
class=
"show-transparency"
>
{% else %}
<img
width=
"165"
height=
"165"
class=
"show-transparency"
>
{% endif %}
</div>
<h3>
{{ video.title|ellipsistrim:60 }}
</h3>
<h3>
{{ video.title|ellipsistrim:60 }}
</h3>
</a>
</a>
</li>
</li>
...
...
wagtailvideos/templates/wagtailvideos/multiple/edit_form.html
View file @
c6b9c2f9
...
@@ -16,7 +16,9 @@
...
@@ -16,7 +16,9 @@
</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-image hasthumb'
>
{% if video.thumbnail %}
<img
src=
"{{ video.thumbnail.url }}"
/>
<img
src=
"{{ video.thumbnail.url }}"
/>
{% endif %}
</div>
</div>
<script>
<script>
...
...
wagtailvideos/templates/wagtailvideos/videos/results.html
View file @
c6b9c2f9
...
@@ -20,8 +20,10 @@
...
@@ -20,8 +20,10 @@
<li>
<li>
<a
class=
"image-choice"
href=
"{% url 'wagtailvideos:edit' video.id %}"
>
<a
class=
"image-choice"
href=
"{% url 'wagtailvideos:edit' video.id %}"
>
<div
class=
"image"
>
<div
class=
"image"
>
{% if video.thumbnail %}
<img
src=
'{{video.thumbnail.url}}'
height=
165
width=
165
class=
"show-transparency"
/></img>
<img
src=
'{{video.thumbnail.url}}'
height=
165
width=
165
class=
"show-transparency"
/></img>
</div>
{% endif %}
</div>
<h3>
{{ video.title|ellipsistrim:60 }}
</h3>
<h3>
{{ video.title|ellipsistrim:60 }}
</h3>
</a>
</a>
</li>
</li>
...
...
wagtailvideos/templates/wagtailvideos/widgets/video_chooser.html
View file @
c6b9c2f9
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
{% block chosen_state_view %}
{% block chosen_state_view %}
<div
class=
"video-thumb"
>
<div
class=
"video-thumb"
>
{% if video %}
{% if video
and video.thumbnail
%}
<img
src=
'{{video.thumbnail.url}}'
width=
"165"
height=
"165"
class=
"show-transparency"
>
<img
src=
'{{video.thumbnail.url}}'
width=
"165"
height=
"165"
class=
"show-transparency"
>
{% else %}
{% else %}
<img
width=
"165"
height=
"165"
class=
"show-transparency"
>
<img
width=
"165"
height=
"165"
class=
"show-transparency"
>
...
...
wagtailvideos/templatetags/wagtailvideos_tags.py
View file @
c6b9c2f9
...
@@ -41,7 +41,8 @@ class VideoNode(template.Node):
...
@@ -41,7 +41,8 @@ class VideoNode(template.Node):
if
not
video
:
if
not
video
:
raise
template
.
TemplateSyntaxError
(
"video tag requires a Video object as the first parameter"
)
raise
template
.
TemplateSyntaxError
(
"video tag requires a Video object as the first parameter"
)
self
.
attrs
[
'poster'
]
=
video
.
thumbnail
.
url
if
video
.
thumbnail
:
self
.
attrs
[
'poster'
]
=
video
.
thumbnail
.
url
mime
=
mimetypes
.
MimeTypes
()
mime
=
mimetypes
.
MimeTypes
()
sources
=
[
"<source src='{0}' type='{1}'>"
sources
=
[
"<source src='{0}' type='{1}'>"
...
...
wagtailvideos/views/chooser.py
View file @
c6b9c2f9
...
@@ -30,7 +30,7 @@ def get_video_json(video):
...
@@ -30,7 +30,7 @@ def get_video_json(video):
'edit_link'
:
reverse
(
'wagtailvideos:edit'
,
args
=
(
video
.
id
,)),
'edit_link'
:
reverse
(
'wagtailvideos:edit'
,
args
=
(
video
.
id
,)),
'title'
:
video
.
title
,
'title'
:
video
.
title
,
'preview'
:
{
'preview'
:
{
'url'
:
video
.
thumbnail
.
url
,
'url'
:
video
.
thumbnail
.
url
if
video
.
thumbnail
else
''
,
}
}
})
})
...
...
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