|
@@ -0,0 +1,161 @@
|
|
|
|
|
+{% extends '../layout/admin.html' %}
|
|
|
|
|
+
|
|
|
|
|
+{% block html_title %}カスタマイズ · {% endblock %}
|
|
|
|
|
+
|
|
|
|
|
+{% block html_additional_headers %}
|
|
|
|
|
+ <!-- CodeMirror -->
|
|
|
|
|
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/g/codemirror@4.5.0(codemirror.css+addon/hint/show-hint.css)">
|
|
|
|
|
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/jquery.ui/1.11.4/jquery-ui.min.css">
|
|
|
|
|
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/codemirror/4.5.0/theme/eclipse.css">
|
|
|
|
|
+ <style>
|
|
|
|
|
+ .CodeMirror {
|
|
|
|
|
+ border: 1px solid #eee;
|
|
|
|
|
+ }
|
|
|
|
|
+ </style>
|
|
|
|
|
+{% endblock %}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+{% block content_head %}
|
|
|
|
|
+<div class="header-wrap">
|
|
|
|
|
+ <header id="page-header">
|
|
|
|
|
+ <h1 class="title" id="">カスタマイズ</h1>
|
|
|
|
|
+ </header>
|
|
|
|
|
+</div>
|
|
|
|
|
+{% endblock %}
|
|
|
|
|
+
|
|
|
|
|
+{% block content_main %}
|
|
|
|
|
+<div class="content-main">
|
|
|
|
|
+ {% set smessage = req.flash('successMessage') %}
|
|
|
|
|
+ {% if smessage.length %}
|
|
|
|
|
+ <div class="alert alert-success">
|
|
|
|
|
+ {{ smessage }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+
|
|
|
|
|
+ {% set emessage = req.flash('errorMessage') %}
|
|
|
|
|
+ {% if emessage.length %}
|
|
|
|
|
+ <div class="alert alert-danger">
|
|
|
|
|
+ {{ emessage }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-md-3">
|
|
|
|
|
+ {% include './widget/menu.html' with {current: 'customize'} %}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-md-9">
|
|
|
|
|
+
|
|
|
|
|
+ <form action="/_api/admin/customize/css" method="post" class="form-horizontal" id="cutomcssSettingForm" role="form">
|
|
|
|
|
+ <fieldset>
|
|
|
|
|
+ <legend>カスタムCSS</legend>
|
|
|
|
|
+
|
|
|
|
|
+ <p class="help-block">
|
|
|
|
|
+ システム全体に適用されるCSSを記述できます。<br>
|
|
|
|
|
+ 変更の反映はページの更新が必要です。
|
|
|
|
|
+ </p>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <div class="col-xs-12">
|
|
|
|
|
+ <textarea id="taCustomCss" class="form-control" type="textarea" name="settingForm[customize:css]" rows="20">{{ settingForm['customize:css'] }}</textarea>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-xs-12">
|
|
|
|
|
+ <p class="help-block text-right">
|
|
|
|
|
+ <i class="fa fa-fw fa-keyboard-o" aria-hidden="true"></i>
|
|
|
|
|
+ Ctrl+Space でコード補完
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <div class="col-xs-offset-5 col-xs-6">
|
|
|
|
|
+ <input type="hidden" name="_csrf" value="{{ csrf() }}">
|
|
|
|
|
+ <button type="submit" class="btn btn-primary">更新</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ </fieldset>
|
|
|
|
|
+ </form>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <script>
|
|
|
|
|
+ $('#cutomcssSettingForm').each(function() {
|
|
|
|
|
+ $(this).submit(function()
|
|
|
|
|
+ {
|
|
|
|
|
+ function showMessage(formId, msg, status) {
|
|
|
|
|
+ $('#' + formId + ' .alert').remove();
|
|
|
|
|
+
|
|
|
|
|
+ if (!status) {
|
|
|
|
|
+ status = 'success';
|
|
|
|
|
+ }
|
|
|
|
|
+ var $message = $('<p class="alert"></p>');
|
|
|
|
|
+ $message.addClass('alert-' + status);
|
|
|
|
|
+ $message.html(msg.replace('\n', '<br>'));
|
|
|
|
|
+ $message.insertAfter('#' + formId + ' legend');
|
|
|
|
|
+
|
|
|
|
|
+ if (status == 'success') {
|
|
|
|
|
+ setTimeout(function()
|
|
|
|
|
+ {
|
|
|
|
|
+ $message.fadeOut({
|
|
|
|
|
+ complete: function() {
|
|
|
|
|
+ $message.remove();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 5000);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var $form = $(this);
|
|
|
|
|
+ var $id = $form.attr('id');
|
|
|
|
|
+ var $button = $('button', this);
|
|
|
|
|
+ $button.attr('disabled', 'disabled');
|
|
|
|
|
+ var jqxhr = $.post($form.attr('action'), $form.serialize(), function(data)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (data.status) {
|
|
|
|
|
+ showMessage($id, '更新しました');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ showMessage($id, data.message, 'danger');
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .fail(function() {
|
|
|
|
|
+ showMessage($id, 'エラーが発生しました', 'danger');
|
|
|
|
|
+ })
|
|
|
|
|
+ .always(function() {
|
|
|
|
|
+ $button.prop('disabled', false);
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ </script>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- CodeMirror -->
|
|
|
|
|
+ <script src="https://cdn.jsdelivr.net/g/codemirror@4.5.0(codemirror.min.js+addon/lint/css-lint.js+mode/css/css.js+addon/hint/css-hint.js+addon/hint/show-hint.js+addon/edit/matchbrackets.js+addon/edit/closebrackets.js),jquery.ui@1.11.4"></script>
|
|
|
|
|
+ <script>
|
|
|
|
|
+ var editor = CodeMirror.fromTextArea(document.getElementById('taCustomCss'), {
|
|
|
|
|
+ mode: "css",
|
|
|
|
|
+ lineNumbers: true,
|
|
|
|
|
+ tabSize: 2,
|
|
|
|
|
+ indentUnit: 2,
|
|
|
|
|
+ theme: 'eclipse',
|
|
|
|
|
+ matchBrackets: true,
|
|
|
|
|
+ autoCloseBrackets: true,
|
|
|
|
|
+ extraKeys: {"Ctrl-Space": "autocomplete"},
|
|
|
|
|
+ });
|
|
|
|
|
+ editor.on('change', function(cm, change) {
|
|
|
|
|
+ cm.save();
|
|
|
|
|
+ });
|
|
|
|
|
+ // resizable with jquery.ui
|
|
|
|
|
+ $(editor.getWrapperElement()).resizable({
|
|
|
|
|
+ resize: function() {
|
|
|
|
|
+ editor.setSize($(this).width(), $(this).height());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ </script>
|
|
|
|
|
+
|
|
|
|
|
+</div>
|
|
|
|
|
+{% endblock content_main %}
|
|
|
|
|
+
|
|
|
|
|
+{% block content_footer %}
|
|
|
|
|
+{% endblock content_footer %}
|