fix markdown editor
This commit is contained in:
parent
f155466be8
commit
469dea540d
4 changed files with 44 additions and 46 deletions
|
@ -1,13 +1,6 @@
|
||||||
# from django.contrib.auth.decorators import login_required
|
|
||||||
from django.views import View
|
from django.views import View
|
||||||
from django.utils.timezone import now
|
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.db.models import BooleanField, Value
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django.middleware.csrf import get_token
|
|
||||||
from .preview import BlogMarkdownPreviewView
|
|
||||||
|
|
||||||
|
|
||||||
# __all__ = ["MarkdownEditor"]
|
|
||||||
|
|
||||||
|
|
||||||
class MarkdownEditor(View):
|
class MarkdownEditor(View):
|
||||||
|
@ -16,6 +9,6 @@ class MarkdownEditor(View):
|
||||||
request,
|
request,
|
||||||
"markdown_editor/markdown_editor.html",
|
"markdown_editor/markdown_editor.html",
|
||||||
{
|
{
|
||||||
"title": ("Markdown Editor"),
|
"title": _("Markdown Editor"),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -130,6 +130,10 @@ msgstr "Thể thức"
|
||||||
msgid "Rating"
|
msgid "Rating"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/markdown_editor/markdown_editor.html:103
|
||||||
|
msgid "Insert Image"
|
||||||
|
msgstr "Chèn hình ảnh"
|
||||||
|
|
||||||
#: judge/admin/contest.py:201
|
#: judge/admin/contest.py:201
|
||||||
msgid "Access"
|
msgid "Access"
|
||||||
msgstr "Truy cập"
|
msgstr "Truy cập"
|
||||||
|
|
|
@ -39,6 +39,9 @@ msgstr "Đăng ký tên"
|
||||||
msgid "Report"
|
msgid "Report"
|
||||||
msgstr "Báo cáo"
|
msgstr "Báo cáo"
|
||||||
|
|
||||||
|
msgid "Insert Image"
|
||||||
|
msgstr "Chèn hình ảnh"
|
||||||
|
|
||||||
msgid "2sat"
|
msgid "2sat"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,10 @@
|
||||||
width: 51%;
|
width: 51%;
|
||||||
}
|
}
|
||||||
.wmd-input {
|
.wmd-input {
|
||||||
height: 678px;
|
height: calc(100vh - 146px);
|
||||||
}
|
}
|
||||||
.right-markdown{
|
.right-markdown{
|
||||||
height: 725px;
|
height: calc(100vh - 100px);
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -87,44 +87,42 @@
|
||||||
<script src="{{ static('pagedown_math.js') }}"></script>
|
<script src="{{ static('pagedown_math.js') }}"></script>
|
||||||
|
|
||||||
<div id="new-comment" class="form-area" style="">
|
<div id="new-comment" class="form-area" style="">
|
||||||
<form class="comment-submit-form" action="" method="post">
|
<input type="hidden" name="csrfmiddlewaretoken" value="Ngk7TfY2iIW4e9cPitl05k1c7xNUsVk9kCTkrAFveVmmcIhjRKv4GLtItKANAvae">
|
||||||
<input type="hidden" name="csrfmiddlewaretoken" value="Ngk7TfY2iIW4e9cPitl05k1c7xNUsVk9kCTkrAFveVmmcIhjRKv4GLtItKANAvae">
|
<input type="hidden" name="parent" id="id_parent">
|
||||||
<input type="hidden" name="parent" id="id_parent">
|
<div class="comment-post-wrapper">
|
||||||
<div class="comment-post-wrapper">
|
<div id="comment-form-body"><div class="wmd-wrapper image-upload-enabled">
|
||||||
<div id="comment-form-body"><div class="wmd-wrapper image-upload-enabled">
|
<div class="wmd-panel">
|
||||||
<div class="wmd-panel">
|
<div id="wmd-button-bar-id_body"></div>
|
||||||
<div id="wmd-button-bar-id_body"></div>
|
<textarea id="wmd-input-id_body" class="wmd-input" name="body" required=""></textarea>
|
||||||
<textarea id="wmd-input-id_body" class="wmd-input" name="body" required=""></textarea>
|
</div>
|
||||||
</div>
|
<div id="id_body-preview" data-preview-url="/widgets/preview/comment" data-textarea-id="wmd-input-id_body" data-timeout="1000" class="wmd-panel wmd-preview dmmd-preview dmmd-no-button">
|
||||||
<div id="id_body-preview" data-preview-url="/widgets/preview/comment" data-textarea-id="wmd-input-id_body" data-timeout="1000" class="wmd-panel wmd-preview dmmd-preview dmmd-no-button">
|
<div class="dmmd-preview-update"><i class="fa fa-refresh"></i> Update Preview</div>
|
||||||
<div class="dmmd-preview-update"><i class="fa fa-refresh"></i> Update Preview</div>
|
<div class="dmmd-preview-content content-description"></div>
|
||||||
<div class="dmmd-preview-content content-description"></div>
|
</div>
|
||||||
</div>
|
<div class="pagedown-image-upload">
|
||||||
<div class="pagedown-image-upload">
|
<h2>{{_('Insert Image')}}</h2>
|
||||||
<h2>Insert Image</h2>
|
<div class="form-row">
|
||||||
<div class="form-row">
|
<div>
|
||||||
<div>
|
<label class="label">From the web</label>
|
||||||
<label class="label">From the web</label>
|
<input class="url-input" type="text" placeholder="http://">
|
||||||
<input class="url-input" type="text" placeholder="http://">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<div>
|
|
||||||
<label class="label">From your computer</label>
|
|
||||||
<input class="file-input" type="file" name="image" id="file" data-action="/pagedown/image-upload/" accept="image/*">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="submit-row">
|
|
||||||
<div class="submit-loading"></div>
|
|
||||||
<input class="submit-input show" type="submit" value="Save" name="_addanother">
|
|
||||||
<p class="deletelink-box"><a href="#" class="close-image-upload deletelink">Cancel</a></p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div></div>
|
<div class="form-row">
|
||||||
</div>
|
<div>
|
||||||
</form>
|
<label class="label">From your computer</label>
|
||||||
|
<input class="file-input" type="file" name="image" id="file" data-action="/pagedown/image-upload/" accept="image/*">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="submit-row">
|
||||||
|
<div class="submit-loading"></div>
|
||||||
|
<input class="submit-input show" type="submit" value="Save" name="_addanother">
|
||||||
|
<p class="deletelink-box"><a href="#" class="close-image-upload deletelink">Cancel</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="id_body-preview" data-preview-url="/widgets/preview/comment" data-textarea-id="wmd-input-id_body" data-timeout="1000" class="width-controller wmd-panel wmd-preview dmmd-preview dmmd-no-button dmmd-preview-has-content">
|
<div id="id_body-preview" data-preview-url="{{url('comment_preview')}}" data-textarea-id="wmd-input-id_body" data-timeout="1000" class="width-controller wmd-panel wmd-preview dmmd-preview dmmd-no-button dmmd-preview-has-content">
|
||||||
<div class="right-markdown dmmd-preview-content content-description" id="display"></div>
|
<div class="right-markdown dmmd-preview-content content-description" id="display"></div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue