Skip to content

Commit

Permalink
Resolve #461: Add calendar picker for date attribute fields
Browse files Browse the repository at this point in the history
  • Loading branch information
seav committed Sep 27, 2016
1 parent a3f5dee commit dde1424
Show file tree
Hide file tree
Showing 17 changed files with 100 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions cadasta/core/static/css/jquery-ui.min.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions cadasta/core/static/css/jquery-ui.structure.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cadasta/core/static/css/jquery-ui.theme.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions cadasta/core/static/css/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cadasta/core/static/css/widgets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@
top: 0;
}
}
}

.ui-datepicker {
z-index: 2000 !important;
}
7 changes: 7 additions & 0 deletions cadasta/core/static/js/jquery-ui.min.js

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions cadasta/templates/party/party_edit.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
{% extends "party/party_detail.html" %}
{% load i18n %}
{% load staticfiles %}

{% block extra_head %}
{{ block.super }}
<link rel="stylesheet" href="{% static 'css/jquery-ui.min.css' %}">
<link rel="stylesheet" href="{% static 'css/jquery-ui.structure.min.css' %}">
<link rel="stylesheet" href="{% static 'css/jquery-ui.theme.min.css' %}">
{% endblock %}

{% block extra_script %}
{{ block.super }}
<script src="{% static 'js/jquery-ui.min.js' %}"></script>
<script src="{% static 'js/map_utils.js' %}"></script>
<script>
$(document).ready(function () {
$('.datepicker').datepicker({
yearRange: "c-200:c+200",
changeMonth: true,
changeYear: true,
});
});
</script>
{% endblock %}

{% block modals %}
<div class="modal-backdrop">
Expand Down
6 changes: 5 additions & 1 deletion cadasta/templates/party/party_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
<div class="form-group{% if field.errors %} has-error{% endif %}">
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
<label class="pull-right control-label">{{ field.errors }}</label>
{% render_field field class="form-control" %}
{% if field|field_type == "datefield" %}
{% render_field field class+="form-control datepicker" %}
{% else %}
{% render_field field class+="form-control" %}
{% endif %}
</div>
{% endif %}
{% endfor %}
Loading

0 comments on commit dde1424

Please sign in to comment.