Skip to content

Commit

Permalink
Added script for removing file upload errors (#895)
Browse files Browse the repository at this point in the history
* Added script for removing file upload errors
  • Loading branch information
Chandra Lash authored and oliverroick committed Nov 7, 2016
1 parent f217c8e commit 67be776
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions cadasta/core/static/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ $(function() {

});

$('a.file-remove').click(function() {
$('.file-well .errorlist').addClass('hidden');
$(this).parents('.form-group').removeClass('has-error');
});

});
26 changes: 13 additions & 13 deletions cadasta/templates/organization/project_add_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
{% block extra_script %}
{{ form.media }}
<script>
$(document).ready(function () {
var logos = {{ org_logos|safe }};
var select = $('#{{ wizard.form.organization.id_for_label }}');
var img = $('#org-logo');
select.change(function() {
if (logos[select[0].value]) {
img.css('display', 'inline-block');
img.attr('src', logos[select[0].value]);
} else {
img.css('display', 'none');
}
});
});
$(document).ready(function () {
var logos = {{ org_logos|safe }};
var select = $('#{{ wizard.form.organization.id_for_label }}');
var img = $('#org-logo');
select.change(function() {
if (logos[select[0].value]) {
img.css('display', 'inline-block');
img.attr('src', logos[select[0].value]);
} else {
img.css('display', 'none');
}
});
});
</script>
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion cadasta/templates/organization/project_edit_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% load widget_tweaks %}

{% block extra_script %}
{{ form.media }}
{{ form.media }}
{% endblock %}

{% block page_title %}{% trans "Edit project details" %} | {% endblock %}
Expand Down

0 comments on commit 67be776

Please sign in to comment.