-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
accept
attribute on image widget, added alert message when lo…
…aded an invalid image.
- Loading branch information
Skirmantas Jurgaitis
committed
Apr 8, 2013
1 parent
739dd1c
commit adbc350
Showing
3 changed files
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
{% load i18n %} | ||
<div id="{{ image_id }}" class="image-input"> | ||
<img src="{{ image_url }}" alt="thumbnail"/> | ||
{% if not image_url %} | ||
{% if image_url %} | ||
<img src="{{ image_url }}" alt="thumbnail" /> | ||
{% else %} | ||
<img alt="thumbnail" | ||
onload="jQuery(this).next().hide()" | ||
onerror="jQuery(this).next().show(); alert('{% trans 'Unrecognized image type!' %}')" /> | ||
<button class="btn btn-primary">{% trans "Upload Image" %}</button> | ||
{% endif %} | ||
<div class="input-field"> | ||
<input {{ input_attrs|safe }} /> | ||
<input {{ input_attrs|safe }} accept="image/*" /> | ||
</div> | ||
</div> |