disable/enable check in sign

remotes/origin/yandex
Bachurin Sergey 12 years ago
parent e00d41634a
commit 0ee9b5fb6d
  1. 3
      project/docs/views/base_views.py
  2. 10
      project/static/js/docs/list.email.js
  3. 6
      project/templates/docs/_base/preview.html

@ -421,6 +421,7 @@ class BaseViews(object):
imgs = glob.glob(os.path.join(tmp_dir, '*.png'))
imgs = [os.path.split(i)[1] for i in imgs]
imgs = ['%stmp/%s/%s' % (MEDIA_URL, tmp_dirname, i) for i in imgs]
email_form = self.EMAIL_FORM_CLASS()
dictionary = {
'obj': obj,
@ -429,6 +430,8 @@ class BaseViews(object):
'padeji_mnoj': self.PADEJI_MNOJ,
'url_prefix': self.URL_PREFIX,
'template_create_docs': self.TEMPLATE_CREATE_DOCS,
'email_form': email_form,
'maybe_sign': self.MAYBE_SIGNED,
}
return render(self.request, self.TEMPLATE_IMG, dictionary)
except:

@ -6,6 +6,14 @@ $(document).ready(function() {
autoOpen: false,
minWidth: 380
});
$('[name="doc_format"]').on('change', function(){
if ($(this).val() == 'xls') {
$('#id_insert_sign').attr('checked', false);
$('#id_insert_sign').prop('disabled', true);
} else {
$('#id_insert_sign').prop('disabled', false);
}
})
$('button[name=close-form]', email_form).click(function() {
email_form.dialog('close');
@ -18,6 +26,8 @@ $(document).ready(function() {
function setup_doc_email_links(form) {
$('.doc-panel a.doc.email-link').each(function() {
$(this).click(function() {
$('#id_insert_sign').prop('disabled', false);
var link = $(this);
var form_action = link.attr('href') + 'ajax/'; // url to post form

@ -35,8 +35,14 @@
{% endblock %}
{% block dialogs %}
{% include "docs/email/base_email_form.html" with form=email_form is_ajax="True" %}
{% endblock %}
{% block js %}
<script type="text/javascript">
var CLIENT = new Object;
CLIENT.get_url_pattern = "{% url 'customer_clients_get_ajax' 0 %}";
</script>
<script src="{{ STATIC_URL }}js/docs/del_doc.js"></script>
<script src="{{ STATIC_URL }}js/docs/list.email.js"></script>
{% endblock %}

Loading…
Cancel
Save