Browse Source

Fix #190 plus QA fixes

pull/202/head
Edward Ribeiro 9 years ago
parent
commit
32740242bb
  1. 1
      protocoloadm/views.py
  2. 31
      static/js/app.js
  3. 8
      templates/base.html

1
protocoloadm/views.py

@ -151,6 +151,7 @@ class ProtocoloForm(forms.Form):
('', 'Ambos')],
widget=forms.RadioSelect(
renderer=HorizontalRadioRenderer)
)
tipo_documento = forms.ModelChoiceField(

31
static/js/app.js

@ -1,33 +1,22 @@
tinymce.init({selector:'textarea'});
$(document).foundation();
$(document).ready(function(){
$('.dateinput').fdatepicker({
// TODO localize
format: 'dd/mm/yyyy',
language: 'pt',
endDate: '31/12/2100',
todayBtn: true
});
function refreshDatePicker() {
$.datepicker.setDefaults($.datepicker.regional['pt-BR']);
$('.dateinput').datepicker();
}
function refreshMask() {
$('.telefone').mask("(99) 9999-9999", {placeholder:"(__) ____ -____"});
$('.cpf').mask("000.000.000-00", {placeholder:"___.___.___-__"});
$('.cep').mask("00000-000", {placeholder:"_____-___"});
$('.rg').mask("0.000.000", {placeholder:"_.___.___"});
$('.titulo_eleitor').mask("0000.0000.0000.0000", {placeholder:"____.____.____.____"});
$('.hora').mask("00:00", {placeholder:"hh:mm"});
$('.hora_hms').mask("00:00:00", {placeholder:"hh:mm:ss"});
var href = location.href.split('?')
$('.masthead .sub-nav a').each(function() {
if (href.length >= 1) {
if (href[0].endsWith($(this).attr('href')))
$(this).parent().addClass('active')
}
});
$('.hora_hms').mask("00:00:00", {placeholder:"hh:mm:ss"});
}
$(document).ready(function(){
refreshDatePicker();
refreshMask();
});

8
templates/base.html

@ -18,11 +18,10 @@
<link rel="stylesheet" href="{% static 'drunken-parrot-flat-ui/css/drunken-parrot.css' %}">
<link rel="stylesheet" href="{% sass_src 'styles/app.scss' %}" type="text/css">
<link rel="stylesheet" href="{% static 'jquery-ui/themes/cupertino/jquery-ui.min.css' %}">
{# Scripts #}
{# modernizr must be in head (see http://modernizr.com/docs/#installing) #}
<script type="text/javascript" src="{% static 'jQuery-runner/build/jquery.runner.js' %}"></script>
<script type="text/javascript" src="{% static 'jquery-mask-plugin/dist/jquery.mask.js' %}"></script>
{% endblock %}
</head>
@ -220,6 +219,11 @@
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript" src="{% static 'bootstrap-sass/assets/javascripts/bootstrap.min.js' %}"></script>
<script type="text/javascript" src="{% static 'jQuery-runner/build/jquery.runner.js' %}"></script>
<script type="text/javascript" src="{% static 'jquery-mask-plugin/dist/jquery.mask.js' %}"></script>
<script src="{% static 'jquery-ui/jquery-ui.min.js' %}"></script>
<script type="text/javascript" src="{% static 'jquery-ui/ui/i18n/datepicker-pt-BR.js' %}"></script>
<script src="{% static 'tinymce/tinymce.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/app.js' %}"></script>

Loading…
Cancel
Save