-
Notifications
You must be signed in to change notification settings - Fork 16
/
_form_js.html
38 lines (34 loc) · 1.69 KB
/
_form_js.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<script type="text/javascript" src="/static/vendor/parsley-2.9.2/parsley.js?v={{config.get('DOAJ_VERSION')}}"></script>
<script type="text/javascript" src="/static/vendor/edges/src/edges.js?v={{config.get('DOAJ_VERSION')}}"></script>
<!-- get select2 -->
{# <script type="text/javascript" src="/static/vendor/select2-3.5.4/select2.min.js?v={{config.get('DOAJ_VERSION')}}"></script> #}
<script type="text/javascript" src="/static/js/formulaic.js?v={{config.get('DOAJ_VERSION')}}"></script>
<script type="text/javascript" src="/static/js/application_form.js?v={{config.get('DOAJ_VERSION')}}"></script>
{% if lcc_tree %}
<script type="text/javascript">
doaj.af.lccTree = {{ lcc_tree|tojson }}
</script>
{% endif %}
<script type="text/javascript">
jQuery(document).ready(function($) {
formulaic.active = formulaic.newFormulaic({
formSelector: "#{{ form_id }}",
functions : {{ formulaic_context.javascript_functions|tojson }},
doValidation : {% if js_validation %}true{% else %}false{% endif %},
autoSave: {{ auto_save }},
fieldsets : {{ formulaic_context.ui_settings|tojson }}
});
{% if factory == "journal" %}
doaj.af.active = doaj.af.journalFormFactory({});
{% else %}
doaj.af.active = doaj.af.applicationFormFactory({
{% if form_diff %}
formDiff: {{ form_diff|tojson }},
{% endif %}
{% if obj and obj["es_type"] == "application" and obj.application_type == "update_request" and (not current_journal or not current_journal.is_in_doaj()) %}
withdrawn: true
{% endif %}
});
{% endif %}
});
</script>