-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nazarii
committed
Mar 21, 2024
1 parent
c97e7ce
commit 100be3f
Showing
9 changed files
with
54 additions
and
37 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
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,14 @@ | ||
from typing import TYPE_CHECKING, TypedDict | ||
|
||
if TYPE_CHECKING: | ||
from django.core.files.uploadedfile import InMemoryUploadedFile | ||
|
||
from blog.models import Category | ||
|
||
|
||
class CreateArticleT(TypedDict): | ||
category: "Category" | ||
title: str | ||
content: str | ||
image: "InMemoryUploadedFile" | ||
tags: list[str] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
{% extends "blog/base.html" %} | ||
{% load static main %} | ||
{% load static %} | ||
|
||
{% block title %}New Post{% endblock title %} | ||
|
||
{% block head %} | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/summernote-lite.min.css" rel="stylesheet"> | ||
|
||
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0-beta.1/css/select2.min.css" rel="stylesheet" /> | ||
<style> | ||
.category-select { | ||
width: 200px; | ||
} | ||
</style> | ||
{% endblock head %} | ||
|
||
{% block container %} | ||
|
||
<h1>Create a new post</h1> | ||
<form id="createArticleForm" method="post" enctype="multipart/form-data" | ||
name="fileinfo"> | ||
<form id="createArticleForm" method="post" enctype="multipart/form-data" name="fileinfo"> | ||
<div id="categoryGroup"> | ||
<label>Category: </label> | ||
<select class="form-control" name="category" style="width: 40%"> | ||
{% for category in categories %} | ||
<option value="{{ category.id }}">{{ category.name }}</option> | ||
{% endfor %} | ||
</select> | ||
<select class="category-select form-select category-select" name="category"></select> | ||
</div> | ||
|
||
<hr> | ||
<div id="titleGroup"> | ||
<label>Article Title: </label> | ||
|
@@ -50,6 +51,7 @@ <h1>Create a new post</h1> | |
|
||
{% block script %} | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/summernote-lite.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0-beta.1/js/select2.min.js"></script> | ||
<script> | ||
$('#summernote').summernote({ | ||
placeholder: 'Content', | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
{% load static main blog %} | ||
{% categories as categories %} | ||
|
||
|
||
<footer> | ||
<div class="row"> | ||
|