<NME> editfile.twig
<BEF> {# Page: NavSecondary > Configuration > Main configuration | ContentTypes | Taxonomy | ... #}

{% extends '@bolt/_base/_page-nav.twig' %}

{% block page_nav 'Settings/Configuration' %}

{% block page_title context.write_allowed ? __('page.edit-file.title.edit') : __('page.edit-file.title.view') %}

{% form_theme context.form 'form_bolt_layout.twig' _self %}

{%- block file_edit_save_button_icon %}
    <i class="fa fa-flag"> </i>
{% endblock -%}
{%- block file_edit_revert_button_icon %}
    <i class="fa fa-undo"> </i>
{% endblock -%}

{% block page_main %}

    {% import '@bolt/_macro/_macro.twig' as macro %}
    {% from '@bolt/_buic/_moment.twig' import buic_moment %}
    {% from '@bolt/_macro/_files_path.twig' import files_path %}

    {{ data('editcontent.msg', {
        'change_quit': __('general.phrase.warning-unfinished-changes-loss'),
        'saving':      __('general.phrase.saving-ellipsis')
    }) }}

    {% set attr_text = {
        _bind:     ['editfile', {readonly: context.write_allowed ? false : true}],
        class:     'CodeMirror-scroll',
        id:        'form_contents',
        name:      'form[contents]',
        required:  false,
        style:     'width: 98%; min-height: 350px; white-space: pre; word-wrap: normal; overflow-x: scroll;',
    } %}

    <div class="row">
        <div class="col-xs-12">

            {{ files_path(context.file) }}

                    <button type="submit" id="saveeditfile" class="btn btn-primary" {% if not context.write_allowed %}disabled{% endif %}>
                        <i class="fa fa-flag"></i> {{ __('page.edit-file.button.save') }}
                    </button>
                    <a class="btn confirm" style="margin-left: 24px;"
                       data-confirm="{{ __("page.edit-file.confirm-revert") }}"
                       href="{{ path('fileedit', { 'file': context.file }) }}"
                    >
                        {
                            'class': 'CodeMirror-scroll',
                            'attr': {
                                'data-bind': {'bind': 'editfile', readonly: context.write_allowed ? false : true}|json_encode,
                                'style': 'width: 98%; min-height: 350px; white-space: pre; word-wrap: normal; overflow-x: scroll;'
                            }
                        })
                    }}
                </div>

                <div>
                    {{ form_widget(context.form.save) }}
                    {{ form_widget(context.form.revert, {'attr': {
                        'class': 'btn-default confirm',
                        'data-confirm': __('page.edit-file.confirm-revert'),
                        'style': 'margin-left: 24px;'
                    }}) }}

                  <div class="relatedfiles">
                    {% if context.related|length > 0 %}
                      {{ __("page.edit-file.note-related") }}
                      {% for file in context.related %}
                          <a class="btn btn-tertiary btn-small" href="{{ path('fileedit', {'namespace': file.mountPoint, 'file': file.path}) }}">{{ file.filename }}</a>
                      {% endfor %}
                    {% endif %}
                  </div>
                </div>

            <p class="lastsaved" style="padding-top: 12px;">
                {{ __('general.phrase.saved-on-colon') }}
                <strong>{{ context.datechanged|localedatetime("%c") }}</strong>
                ({{ buic_moment(context.datechanged) }})
            </p>

            {{ form_end(context.form) }}

            {{ widgets('editfile_bottom', 'backend') }}

        </div>
    </div>

    {# use the files includes in ckeditor/codemirror plugin, instead of duplicating files. #}
    <link rel="stylesheet" property="stylesheet" href="{{ asset('js/ckeditor/plugins/codemirror/css/codemirror.min.css', 'bolt') }}">
    <script src="{{ asset('js/ckeditor/ckeditor.js', 'bolt') }}"></script>
    <script src="{{ asset('js/ckeditor/plugins/codemirror/js/codemirror.js', 'bolt') }}"></script>
    <script src="{{ asset('js/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js', 'bolt') }}"></script>
    {% for file in context.codeMirrorPlugins %}
        <script src="{{ asset('js/ckeditor/plugins/codemirror/plugins/' ~ file ~ '.min.js', 'bolt') }}"></script>
    {% endfor %}

{% endblock page_main %}

<MSG> Fix #1983 margins

<DFF> @@ -43,7 +43,7 @@
                     <button type="submit" id="saveeditfile" class="btn btn-primary" {% if not context.write_allowed %}disabled{% endif %}>
                         <i class="fa fa-flag"></i> {{ __('page.edit-file.button.save') }}
                     </button>
-                    <a class="btn confirm" style="margin-left: 24px;"
+                    <a class="btn btn-default confirm" style="margin-left: 24px;"
                        data-confirm="{{ __("page.edit-file.confirm-revert") }}"
                        href="{{ path('fileedit', { 'file': context.file }) }}"
                     >

{'commit': 'diff --git a/app/view/sass/modules/_codemirrorcustom.scss b/app/view/sass/modules/_codemirrorcustom.scss\nindex 55dad4eb3..fbb361fc8 100644\n--- a/app/view/sass/modules/_codemirrorcustom.scss\n+++ b/app/view/sass/modules/_codemirrorcustom.scss\n@@ -5,6 +5,7 @@\n     font-size: 14px;\n     line-height: 1em;\n     font-family: Menlo, Consolas, Monaco, "Courier New", monospace;\n+    margin-bottom: 16px;\n }\n \n .CodeMirror-scroll {\ndiff --git a/app/view/sass/modules/_extend.scss b/app/view/sass/modules/_extend.scss\nindex 8e8a11b07..cf66220ef 100644\n--- a/app/view/sass/modules/_extend.scss\n+++ b/app/view/sass/modules/_extend.scss\n@@ -42,6 +42,7 @@\n         max-height: 300px;\n         height: 300px;\n         overflow-y: scroll;\n+        margin-bottom: 16px;\n \n         .timestamp {\n             color: #BBF;\ndiff --git a/app/view/twig/editfile/editfile.twig b/app/view/twig/editfile/editfile.twig\nindex 5e3eacef7..291b97100 100644\n--- a/app/view/twig/editfile/editfile.twig\n+++ b/app/view/twig/editfile/editfile.twig\n@@ -43,7 +43,7 @@\n                     <button type="submit" id="saveeditfile" class="btn btn-primary" {% if not context.write_allowed %}disabled{% endif %}>\n                         <i class="fa fa-flag"></i> {{ __(\'page.edit-file.button.save\') }}\n                     </button>\n-                    <a class="btn confirm" style="margin-left: 24px;"\n+                    <a class="btn btn-default confirm" style="margin-left: 24px;"\n                        data-confirm="{{ __("page.edit-file.confirm-revert") }}"\n                        href="{{ path(\'fileedit\', { \'file\': context.file }) }}"\n                     >\n', 'commit_subject': 'Fix #1983 margins', 'repo_name': 'bolt/bolt', 'committer': {'name': 'GDmac', 'email': 'bf4859249cbc671264fc47e6c31a50e1b29465b5@gmail.com', 'time_sec': '1414349356', 'tz_offset': '60', 'date': {'seconds': '1414349356'}}, 'commit_tree': '3d33ebea7db060b3d04c2d4f85cae3e4ba5c7edb', 'commit_message': 'Fix #1983 margins\n', 'language_name': 'PHP', 'license': 'mit', 'hunks': '@@ -43,7 +43,7 @@\n                     <button type="submit" id="saveeditfile" class="btn btn-primary" {% if not context.write_allowed %}disabled{% endif %}>\n                         <i class="fa fa-flag"></i> {{ __(\'page.edit-file.button.save\') }}\n                     </button>\n-                    <a class="btn confirm" style="margin-left: 24px;"\n+                    <a class="btn btn-default confirm" style="margin-left: 24px;"\n                        data-confirm="{{ __("page.edit-file.confirm-revert") }}"\n                        href="{{ path(\'fileedit\', { \'file\': context.file }) }}"\n                     >\n', 'addition_count': 1, 'deletion_count': 1, 'src_file': 'a/app/view/twig/editfile/editfile.twig', 'tgt_file': 'b/app/view/twig/editfile/editfile.twig', 'file_extension': '.twig', 'before_file': '{# Page: NavSecondary > Configuration > Main configuration | ContentTypes | Taxonomy | ... #}\n\n{% extends \'@bolt/_base/_page-nav.twig\' %}\n\n{% block page_nav \'Settings/Configuration\' %}\n\n{% block page_title context.write_allowed ? __(\'page.edit-file.title.edit\') : __(\'page.edit-file.title.view\') %}\n\n{% form_theme context.form \'form_bolt_layout.twig\' _self %}\n\n{%- block file_edit_save_button_icon %}\n    <i class="fa fa-flag"> </i>\n{% endblock -%}\n{%- block file_edit_revert_button_icon %}\n    <i class="fa fa-undo"> </i>\n{% endblock -%}\n\n{% block page_main %}\n\n    {% import \'@bolt/_macro/_macro.twig\' as macro %}\n    {% from \'@bolt/_buic/_moment.twig\' import buic_moment %}\n    {% from \'@bolt/_macro/_files_path.twig\' import files_path %}\n\n    {{ data(\'editcontent.msg\', {\n        \'change_quit\': __(\'general.phrase.warning-unfinished-changes-loss\'),\n        \'saving\':      __(\'general.phrase.saving-ellipsis\')\n    }) }}\n\n    {% set attr_text = {\n        _bind:     [\'editfile\', {readonly: context.write_allowed ? false : true}],\n        class:     \'CodeMirror-scroll\',\n        id:        \'form_contents\',\n        name:      \'form[contents]\',\n        required:  false,\n        style:     \'width: 98%; min-height: 350px; white-space: pre; word-wrap: normal; overflow-x: scroll;\',\n    } %}\n\n    <div class="row">\n        <div class="col-xs-12">\n\n            {{ files_path(context.file) }}\n\n                    <button type="submit" id="saveeditfile" class="btn btn-primary" {% if not context.write_allowed %}disabled{% endif %}>\n                        <i class="fa fa-flag"></i> {{ __(\'page.edit-file.button.save\') }}\n                    </button>\n                    <a class="btn confirm" style="margin-left: 24px;"\n                       data-confirm="{{ __("page.edit-file.confirm-revert") }}"\n                       href="{{ path(\'fileedit\', { \'file\': context.file }) }}"\n                    >\n                        {\n                            \'class\': \'CodeMirror-scroll\',\n                            \'attr\': {\n                                \'data-bind\': {\'bind\': \'editfile\', readonly: context.write_allowed ? false : true}|json_encode,\n                                \'style\': \'width: 98%; min-height: 350px; white-space: pre; word-wrap: normal; overflow-x: scroll;\'\n                            }\n                        })\n                    }}\n                </div>\n\n                <div>\n                    {{ form_widget(context.form.save) }}\n                    {{ form_widget(context.form.revert, {\'attr\': {\n                        \'class\': \'btn-default confirm\',\n                        \'data-confirm\': __(\'page.edit-file.confirm-revert\'),\n                        \'style\': \'margin-left: 24px;\'\n                    }}) }}\n\n                  <div class="relatedfiles">\n                    {% if context.related|length > 0 %}\n                      {{ __("page.edit-file.note-related") }}\n                      {% for file in context.related %}\n                          <a class="btn btn-tertiary btn-small" href="{{ path(\'fileedit\', {\'namespace\': file.mountPoint, \'file\': file.path}) }}">{{ file.filename }}</a>\n                      {% endfor %}\n                    {% endif %}\n                  </div>\n                </div>\n\n            <p class="lastsaved" style="padding-top: 12px;">\n                {{ __(\'general.phrase.saved-on-colon\') }}\n                <strong>{{ context.datechanged|localedatetime("%c") }}</strong>\n                ({{ buic_moment(context.datechanged) }})\n            </p>\n\n            {{ form_end(context.form) }}\n\n            {{ widgets(\'editfile_bottom\', \'backend\') }}\n\n        </div>\n    </div>\n\n    {# use the files includes in ckeditor/codemirror plugin, instead of duplicating files. #}\n    <link rel="stylesheet" property="stylesheet" href="{{ asset(\'js/ckeditor/plugins/codemirror/css/codemirror.min.css\', \'bolt\') }}">\n    <script src="{{ asset(\'js/ckeditor/ckeditor.js\', \'bolt\') }}"></script>\n    <script src="{{ asset(\'js/ckeditor/plugins/codemirror/js/codemirror.js\', \'bolt\') }}"></script>\n    <script src="{{ asset(\'js/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js\', \'bolt\') }}"></script>\n    {% for file in context.codeMirrorPlugins %}\n        <script src="{{ asset(\'js/ckeditor/plugins/codemirror/plugins/\' ~ file ~ \'.min.js\', \'bolt\') }}"></script>\n    {% endfor %}\n\n{% endblock page_main %}\n', 'message': 'Fix #1983 margins\n', 'author_name': 'GDmac', 'lang': 'twig'}