-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from Ageu-Meireles/master
Add support for dynamically loaded editors
- Loading branch information
Showing
7 changed files
with
180 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
example/blog/articles/templates/articles/article_create.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% extends 'base.html' %} | ||
{% block header %} | ||
{{ form.media }} | ||
{% endblock %} | ||
{% block content %} | ||
<form method="POST"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<input type="submit" value="Submit article"> | ||
</form> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
example/blog/articles/templates/articles/dynamic_editor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div style="position: absolute;backdrop-filter: blur(10px);top: 0;bottom: 0;left: 0;right: 0;padding-inline: 100px;padding-block: 50px;"> | ||
<h1>Create Article</h1> | ||
<form action="{% url 'article-create' %}" method="post" id="createArticleForm" | ||
enctype="multipart/form-data" | ||
> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<button onclick="dispose()" id="cancelBtn" style="padding: 10px;"> | ||
Cancel | ||
</button> | ||
<input type="submit" value="submit" style="float: right;padding: 10px;"> | ||
</form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
from django.urls import path | ||
|
||
from .views import ArticleDetailView, ArticleListView | ||
from .views import ( | ||
ArticleDetailView, ArticleListView, ArticleCreateView, GetEditorView | ||
) | ||
|
||
urlpatterns = [ | ||
path("", ArticleListView.as_view(), name="article-list"), | ||
path("<int:pk>/", ArticleDetailView.as_view(), name="article-detail"), | ||
path("get_editor", GetEditorView.as_view(), name="get-editor"), | ||
path("create_article/", ArticleCreateView.as_view(), name="article-create"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters