1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- {% extends 'SonataAdminBundle:CRUD:base_edit.html.twig' %}
- {% block parentForm %}
- <div class="alert alert-info">
- {{ 'workflow_edit_create_alert'|trans({}, 'WorkflowBundle') }} <br />
- - {{ 'Workflow Documentation'|trans({}, 'WorkflowBundle') }} <a target="_blank" href="http://symfony.com/blog/new-in-symfony-3-2-workflow-component">http://symfony.com/blog/new-in-symfony-3-2-workflow-component</a><br />
- - {{ 'YAML Documentation'|trans({}, 'WorkflowBundle') }} <a target="_blank" href="http://docs.ansible.com/ansible/YAMLSyntax.html">http://docs.ansible.com/ansible/YAMLSyntax.html</a>
- </div>
- {{ parent() }}
- {#https://github.com/ryanburnette/textarea-as-ace-editor#}
- {#https://ace.c9.io/#}
- {#https://ace.c9.io/build/kitchen-sink.html#}
- <script src="{{ asset('bundles/baseadmin') }}/ace_editor/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
- <script src="{{ asset('bundles/baseadmin') }}/ace_editor/textarea-as-ace-editor.js" type="text/javascript" charset="utf-8"></script>
- <style type="text/css" media="screen">
- .ace_editor {
- height: 250px!important;
- }
-
- .form-actions.stuck {
- z-index: 99999!important;
- }
- </style>
-
- <script type="text/javascript">
- $( document ).ready(function() {
- $("textarea").asAceEditor();
- editor = $('textarea').data('ace-editor');
- editor.setTheme("ace/theme/github");
- editor.getSession().setMode("ace/mode/yaml");
- //editor.setReadOnly(true);
- editor.setFontSize(14);
- editor.setShowInvisibles(true);
- editor.getSession().setTabSize(2);
- editor.getSession().setUseSoftTabs(true);
- editor.getSession().setUseWrapMode(true);
-
-
- {% if admin.parameters.workflow_name is defined %}
- editor = $( ".ace_editor" );
- image = "{{ app.request.schemeAndHttpHost ~ app.request.baseUrl }}/../workflows_png/{{admin.parameters.workflow_name}}.png?nocache={{ date().timestamp }}";
- editor.parent("div").append("<div> <br /> <img src='"+ image +"'</div>");
- {% endif %}
-
- });
- </script>
-
- {% endblock %}
|