mirror of
https://github.com/Rushilwiz/NewViewsNews.git
synced 2025-04-11 07:30:17 -04:00
fully moved to working ckeditor instead of tinymce
This commit is contained in:
parent
5bf8bdda6b
commit
298f9441ef
|
@ -85,8 +85,8 @@ INSTALLED_APPS = [
|
|||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'tinymce',
|
||||
'social_django',
|
||||
'ckeditor'
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
|
|
@ -34,9 +34,6 @@ urlpatterns = [
|
|||
|
||||
path('oauth/', include('social_django.urls', namespace='social')),
|
||||
|
||||
|
||||
path('tinymce/', include('tinymce.urls')),
|
||||
|
||||
path('', include('news.urls')),
|
||||
]
|
||||
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
# Generated by Django 3.1 on 2020-08-15 09:24
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Article',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('content', models.TextField()),
|
||||
('date_published', models.DateTimeField(auto_now_add=True)),
|
||||
('likes', models.IntegerField(default=0)),
|
||||
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 3.1 on 2020-08-15 14:49
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('news', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='article',
|
||||
name='header',
|
||||
field=models.ImageField(default='default.jpg', upload_to='article-headers'),
|
||||
),
|
||||
]
|
|
@ -1,23 +0,0 @@
|
|||
# Generated by Django 3.1 on 2020-08-15 15:30
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('news', '0002_article_header'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='article',
|
||||
name='header_caption',
|
||||
field=models.TextField(default=''),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='article',
|
||||
name='header',
|
||||
field=models.ImageField(default='default-header.jpg', upload_to='article-headers'),
|
||||
),
|
||||
]
|
|
@ -1,19 +0,0 @@
|
|||
# Generated by Django 3.1 on 2020-08-15 15:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('news', '0003_auto_20200815_1130'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='article',
|
||||
name='headline',
|
||||
field=models.TextField(default='Headline'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
|
@ -1,23 +0,0 @@
|
|||
# Generated by Django 3.1 on 2020-08-15 17:03
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('news', '0004_article_headline'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='article',
|
||||
name='header_caption',
|
||||
field=models.CharField(default='', max_length=100),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='article',
|
||||
name='headline',
|
||||
field=models.CharField(max_length=100),
|
||||
),
|
||||
]
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 3.1 on 2020-08-15 23:07
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('news', '0005_auto_20200815_1303'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='article',
|
||||
name='tag',
|
||||
field=models.CharField(choices=[('authoritarian_left', 'Authoritarian Left'), ('authoritarian_right', 'Authoritarian Right'), ('libertarian_left', 'Libertarian Left'), ('libertarian_right', 'Libertarian Right')], default='authoritarian_left', max_length=19),
|
||||
),
|
||||
]
|
|
@ -1,19 +0,0 @@
|
|||
# Generated by Django 3.1 on 2020-08-16 01:00
|
||||
|
||||
from django.db import migrations
|
||||
import tinymce.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('news', '0006_article_tag'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='article',
|
||||
name='content',
|
||||
field=tinymce.models.HTMLField(),
|
||||
),
|
||||
]
|
|
@ -6,7 +6,7 @@ from django.urls import reverse
|
|||
|
||||
from PIL import Image
|
||||
|
||||
from tinymce.models import HTMLField
|
||||
from ckeditor.fields import RichTextField
|
||||
|
||||
# Create your models here.
|
||||
|
||||
|
@ -24,7 +24,8 @@ class Article(models.Model):
|
|||
]
|
||||
|
||||
headline = models.CharField(max_length=100)
|
||||
content = HTMLField()
|
||||
# content = TextField()
|
||||
content = RichTextField(blank=True, null=True)
|
||||
date_published = models.DateTimeField(auto_now_add=True)
|
||||
author = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
likes = models.IntegerField(default=0)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<a class="mr-2" href="#">{{ object.author.get_full_name }}</a>
|
||||
<small class="text-muted">@{{ object.author }} · {{ object.date_published }}</small>
|
||||
</div>
|
||||
<p class="article-content font-weight-light">{{ article.content }}</p>
|
||||
<p class="article-content font-weight-light">{{ article.content|safe }}</p>
|
||||
</div>
|
||||
</article>
|
||||
</fieldset>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</div>
|
||||
|
||||
<img class="img-fluid" src="{{ object.header.url }}">
|
||||
<p class="article-content font-weight-light">{{ article.content }}</p>
|
||||
<p class="article-content font-weight-light">{{ article.content|safe }}</p>
|
||||
</div>
|
||||
</article>
|
||||
{% endblock content %}
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<fieldset class="form-group">
|
||||
|
||||
{{ form.media }}
|
||||
{{ form | crispy}}
|
||||
</fieldset>
|
||||
<div class="form-group">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<a class="mr-2" href="{% url 'user-articles' article.author.username %}">{{ article.author.get_full_name }}</a>
|
||||
<small class="text-muted">@{{ article.author }} · {{ article.date_published }}</small>
|
||||
</div>
|
||||
<p class="article-content font-weight-light"><a class="nounderline" href="{% url 'article-detail' article.id %}">{{ article.content }}</a></p>
|
||||
<p class="article-content font-weight-light"><a class="nounderline" href="{% url 'article-detail' article.id %}">{{ article.content|safe }}</a></p>
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
|
|
23
users/migrations/0010_auto_20200815_2353.py
Normal file
23
users/migrations/0010_auto_20200815_2353.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 3.1 on 2020-08-16 03:53
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0009_auto_20200815_2308'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='profile',
|
||||
name='economicScore',
|
||||
field=models.IntegerField(blank=True, default=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='profile',
|
||||
name='socialScore',
|
||||
field=models.IntegerField(blank=True, default=True),
|
||||
),
|
||||
]
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
|
||||
<div class="content-section">
|
||||
<a href="{% url 'social:begin' 'google-oauth2' %}" title="google" class="border border-dark p-3 btn btn-block btn-lg mx-auto text-white" style="background-color: rgb(222,82,70)">
|
||||
<a href="{% url 'social:begin' 'google-oauth2' %}" title="google" class="border border-dark p-3 btn btn-block btn-lg mx-auto text-white" style="color: white; background-color: #DB4437">
|
||||
<img src="https://cdn2.iconfinder.com/data/icons/font-awesome/1792/google-48.png" >
|
||||
Sign in with Google
|
||||
</a>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<img src="https://cdn4.iconfinder.com/data/icons/miu-flat-social/60/facebook-48.png" >
|
||||
Sign in with Facebook
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user