Skip to content

Commit

Permalink
remove ckeditor references from migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
CJGutz committed Mar 16, 2024
1 parent baaab0c commit 293e4e0
Show file tree
Hide file tree
Showing 22 changed files with 21 additions and 106 deletions.
5 changes: 2 additions & 3 deletions inventory/migrations/0006_auto_20201021_0135.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 3.1.2 on 2020-10-21 01:35

import ckeditor_uploader.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -14,6 +13,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='item',
name='description',
field=ckeditor_uploader.fields.RichTextUploadingField(verbose_name='Beskrivelse'),
field=models.TextField(verbose_name='Beskrivelse'),
),
]
3 changes: 1 addition & 2 deletions inventory/migrations/0007_auto_20201021_0154.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by Django 3.1.2 on 2020-10-21 01:54

import ckeditor_uploader.fields
from django.db import migrations, models


Expand All @@ -19,7 +18,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='item',
name='description',
field=ckeditor_uploader.fields.RichTextUploadingField(blank=True, verbose_name='Beskrivelse'),
field=models.TextField(blank=True, verbose_name='Beskrivelse'),
),
migrations.AlterField(
model_name='item',
Expand Down
2 changes: 0 additions & 2 deletions inventory/templates/inventory/edit_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

{% block head %}
{{ jquery | safe }}
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script>
<script src="{% static 'ckeditor/ckeditor-init.js' %}"></script>
<link rel="stylesheet" type="text/css" href="{% static 'inventory/css/inventory.css' %}">
{% endblock head %}

Expand Down
4 changes: 1 addition & 3 deletions inventory/templates/inventory/equipment/equipment_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
{% load static %}

{% block head %}
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script>
<script src="{% static 'ckeditor/ckeditor-init.js' %}"></script>
<link rel="stylesheet" type="text/css" href="{% static 'news/css/news_style.css' %}">
{% endblock head %}

Expand Down Expand Up @@ -62,4 +60,4 @@ <h5>Innhold</h5>
</div>
</form>
</div>
{% endblock content %}
{% endblock content %}
9 changes: 4 additions & 5 deletions news/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Generated by Django 1.9.2 on 2017-05-04 23:34
from __future__ import unicode_literals

import ckeditor_uploader.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
Expand All @@ -24,8 +23,8 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100, verbose_name='Title')),
('main_content', ckeditor_uploader.fields.RichTextUploadingField(blank=True)),
('ingress_content', ckeditor_uploader.fields.RichTextUploadingField(blank=True)),
('main_content', models.TextField(blank=True)),
('ingress_content', models.TextField(blank=True)),
('internal', models.BooleanField(default=False, verbose_name='Intern')),
('pub_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Publication date')),
('thumbnail', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='files.Image')),
Expand All @@ -39,8 +38,8 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100, verbose_name='Tittel')),
('main_content', ckeditor_uploader.fields.RichTextUploadingField(blank=True, verbose_name='Artikkel')),
('ingress_content', ckeditor_uploader.fields.RichTextUploadingField(blank=True, verbose_name='Ingress')),
('main_content', models.TextField(blank=True, verbose_name='Artikkel')),
('ingress_content', models.TextField(blank=True, verbose_name='Ingress')),
('pub_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Publiseringsdato')),
('internal', models.BooleanField(default=False, verbose_name='Intern')),
('registration', models.BooleanField(default=False, verbose_name='Påmelding')),
Expand Down
5 changes: 2 additions & 3 deletions news/migrations/0028_auto_20210210_2032.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by Django 3.1.1 on 2021-02-10 20:32

import ckeditor_uploader.fields
import django.core.validators
from django.db import migrations, models

Expand All @@ -25,7 +24,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='article',
name='main_content',
field=ckeditor_uploader.fields.RichTextUploadingField(blank=True, verbose_name='Brødtekst'),
field=models.TextField(blank=True, verbose_name='Brødtekst'),
),
migrations.AlterField(
model_name='article',
Expand All @@ -40,6 +39,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='event',
name='main_content',
field=ckeditor_uploader.fields.RichTextUploadingField(blank=True, verbose_name='Hovedtekst'),
field=models.TextField(blank=True, verbose_name='Hovedtekst'),
),
]
15 changes: 0 additions & 15 deletions news/templates/news/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,4 @@ <h5 class="hs-grey-text">{% trans 'Neste artikkel' %}</h5>
</div>

</div>
<script>
// Prevent ckeditor hard fields to allow responsive images
window.addEventListener('DOMContentLoaded', function(event) {
var container = document.getElementsByClassName('card-panel')[0];
var images = container.getElementsByTagName("img");
console.log(images);
var i;

for(i = 0; i < images.length; i++) {
images[i].className = "responsive-img";
images[i].style.height = "";
}
});

</script>
{% endblock content %}
2 changes: 0 additions & 2 deletions news/templates/news/edit_article.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
{% load static %}

{% block head %}
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script>
<script src="{% static 'ckeditor/ckeditor-init.js' %}"></script>
<link rel="stylesheet" type="text/css" href="{% static 'news/css/news_style.css' %}">
{% endblock head %}

Expand Down
2 changes: 0 additions & 2 deletions news/templates/news/edit_event.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
{% load static %}

{% block head %}
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script>
<script src="{% static 'ckeditor/ckeditor-init.js' %}"></script>
<link rel="stylesheet" type="text/css" href="{% static 'news/css/news_style.css' %}">
{% endblock head %}

Expand Down
15 changes: 0 additions & 15 deletions news/templates/news/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,4 @@ <h4>{% trans 'Informasjon om påmelding' %}</h4>
</div>
</form>
</div>

<script>
// Prevent ckeditor hard fields to allow responsive images
window.addEventListener('DOMContentLoaded', function(event) {
var container = document.getElementsByClassName('card-panel')[0];
var images = container.getElementsByTagName("img");
console.log(images);
var i;

for(i = 0; i < images.length; i++) {
images[i].className = "responsive-img";
images[i].style.height = "";
}
});
</script>
{% endblock content %}
3 changes: 1 addition & 2 deletions projectarchive/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by Django 3.1.7 on 2022-01-19 20:29

import ckeditor_uploader.fields
from django.conf import settings
import django.core.validators
from django.db import migrations, models
Expand Down Expand Up @@ -33,7 +32,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100, verbose_name='Tittel')),
('main_content', ckeditor_uploader.fields.RichTextUploadingField(blank=True, verbose_name='Brødtekst')),
('main_content', models.TextField(blank=True, verbose_name='Brødtekst')),
('ingress_content', models.TextField(blank=True, help_text='En kort introduksjon til teksten', max_length=400, validators=[django.core.validators.MaxLengthValidator(400)], verbose_name='Ingress')),
('internal', models.BooleanField(default=False, verbose_name='Intern artikkel')),
('pub_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Publication date')),
Expand Down
15 changes: 0 additions & 15 deletions projectarchive/templates/projectarchive/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,4 @@ <h5>Administrator-meny</h5>


</div>
<script>
// Prevent ckeditor hard fields to allow responsive images
window.addEventListener('DOMContentLoaded', function(event) {
var container = document.getElementsByClassName('card-panel')[0];
var images = container.getElementsByTagName("img");
console.log(images);
var i;

for(i = 0; i < images.length; i++) {
images[i].className = "responsive-img";
images[i].style.height = "";
}
});

</script>
{% endblock content %}
2 changes: 0 additions & 2 deletions projectarchive/templates/projectarchive/edit_article.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
{% load i18n %}

{% block head %}
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script>
<script src="{% static 'ckeditor/ckeditor-init.js' %}"></script>
<link rel="stylesheet" type="text/css" href="{% static 'projectarchive/css/projectarchive_style.css' %}">
{% endblock head %}

Expand Down
3 changes: 1 addition & 2 deletions userprofile/migrations/0026_auto_20200211_1917.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by Django 3.0.2 on 2020-02-11 19:17

import ckeditor_uploader.fields
from django.db import migrations, models
import django.utils.timezone

Expand All @@ -20,6 +19,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='termsofservice',
name='text',
field=ckeditor_uploader.fields.RichTextUploadingField(blank=True),
field=models.TextField(blank=True),
),
]
5 changes: 2 additions & 3 deletions userprofile/migrations/0027_auto_20200211_1945.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 3.0.2 on 2020-02-11 19:45

import ckeditor.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -14,6 +13,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='termsofservice',
name='text',
field=ckeditor.fields.RichTextField(blank=True),
field=models.TextField(blank=True),
),
]
3 changes: 1 addition & 2 deletions userprofile/migrations/0029_auto_20200304_2007.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by Django 3.0.2 on 2020-03-04 20:07

import ckeditor.fields
from django.db import migrations, models


Expand All @@ -26,7 +25,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='termsofservice',
name='text',
field=ckeditor.fields.RichTextField(),
field=models.TextField(),
),
migrations.DeleteModel(
name='Skill',
Expand Down
2 changes: 0 additions & 2 deletions userprofile/templates/userprofile/create_tos.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

{% block head %}
{{ jquery | safe }}
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script>
<script src="{% static 'ckeditor/ckeditor-init.js' %}"></script>
{% endblock head %}

{% block content %}
Expand Down
5 changes: 2 additions & 3 deletions website/migrations/0014_auto_20210412_1918.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 3.1.1 on 2021-04-12 19:18

import ckeditor.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -14,6 +13,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='rule',
name='body',
field=ckeditor.fields.RichTextField(),
field=models.TextField(),
),
]
5 changes: 2 additions & 3 deletions website/migrations/0015_auto_20210412_1921.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 3.1.1 on 2021-04-12 19:21

import ckeditor_uploader.fields
from django.db import migrations
from django.db import migrations, models, models


class Migration(migrations.Migration):
Expand All @@ -14,6 +13,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='rule',
name='body',
field=ckeditor_uploader.fields.RichTextUploadingField(),
field=models.TextField(),
),
]
5 changes: 2 additions & 3 deletions website/migrations/0016_auto_20210412_1944.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 3.1.1 on 2021-04-12 19:44

import ckeditor.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -14,6 +13,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='rule',
name='body',
field=ckeditor.fields.RichTextField(),
field=models.TextField(),
),
]
4 changes: 0 additions & 4 deletions website/static/website/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@ strong {
align-self: center;
}

/* CKEditor override */
.django-ckeditor-widget {
width: 100%;
}
/* GENERELL STYLING OG MATERIAL OVERRIDES BEGYNNER HER */
.card-action a {
color: #5BBA47 !important;
Expand Down
13 changes: 0 additions & 13 deletions website/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from ckeditor_uploader import views as ck_upload_views
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.decorators import permission_required
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import include, path, re_path
from django.views.generic import TemplateView
Expand Down Expand Up @@ -56,17 +54,6 @@
path("tos/<int:pk>/", TermsOfServiceView.as_view(), name="tos-details"),
path("news/", include("news.urls")),
path("events/", include("news.event_urls")),
path("ckeditor/", include("ckeditor_uploader.urls")),
path(
"ckeditor/upload",
permission_required("news.add_article")(ck_upload_views.upload),
name="ckeditor_upload",
),
path(
"ckeditor/browse",
permission_required("news.add_article")(ck_upload_views.browse),
name="ckeditor_browse",
),
path("authentication/", include("authentication.urls", namespace="auth")),
path("door/", include("door.urls")),
path("opptak/", include("applications.urls"), name="opptak"),
Expand Down

0 comments on commit 293e4e0

Please sign in to comment.