Skip to content

Commit

Permalink
Resolve #461: Add calendar picker for date attribute fields (#734)
Browse files Browse the repository at this point in the history
* Resolve #461: Add calendar picker for date attribute fields

* Add JQuery UI localization

* Add picker in templates for adding entities
  • Loading branch information
seav authored and clash99 committed Sep 29, 2016
1 parent f283a39 commit 36d9500
Show file tree
Hide file tree
Showing 20 changed files with 180 additions and 7 deletions.
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.

26 changes: 26 additions & 0 deletions cadasta/templates/party/party_add.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
{% extends "organization/project_wrapper.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>
{% if get_current_language != "en-us" %}
{% get_current_language as LANGUAGE_CODE %}
<script src="https://cdn.rawgit.com/jquery/jquery-ui/1.12.1/ui/i18n/datepicker-{{ LANGUAGE_CODE }}.js"></script>
{% endif %}
<script>
$(document).ready(function () {
$('.datepicker').datepicker({
yearRange: "c-200:c+200",
changeMonth: true,
changeYear: true,
});
});
</script>
{% endblock %}

{% block content %}
<div class="col-md-11 col-md-offset-1 content-single">
Expand Down
26 changes: 26 additions & 0 deletions cadasta/templates/party/party_edit.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
{% 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>
{% if get_current_language != "en-us" %}
{% get_current_language as LANGUAGE_CODE %}
<script src="https://cdn.rawgit.com/jquery/jquery-ui/1.12.1/ui/i18n/datepicker-{{ LANGUAGE_CODE }}.js"></script>
{% endif %}
<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
Loading

0 comments on commit 36d9500

Please sign in to comment.