-
Notifications
You must be signed in to change notification settings - Fork 132
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
Showing
41 changed files
with
1,546 additions
and
184 deletions.
There are no files selected for viewing
Empty file.
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 @@ | ||
from django.contrib import admin | ||
|
||
import reversion | ||
|
||
from .models import Heading | ||
|
||
|
||
class HeadingAdmin(reversion.admin.VersionAdmin): | ||
list_display = ('title',) | ||
|
||
admin.site.register(Heading, HeadingAdmin) |
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,20 @@ | ||
from cms.plugin_base import CMSPluginBase | ||
from cms.plugin_pool import plugin_pool | ||
from cms.models.pluginmodel import CMSPlugin | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
from .models import Heading | ||
|
||
@plugin_pool.register_plugin | ||
class PageHeadingPlugin(CMSPluginBase): | ||
model = Heading | ||
module = "OKF v2" | ||
render_template = "heading_plugin.html" | ||
cache = False | ||
name = _("Heading") | ||
|
||
def render(self, context, instance, placeholder): | ||
context = super().render(context, instance, placeholder) | ||
|
||
return context | ||
|
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,31 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Heading', | ||
fields=[ | ||
('cmsplugin_ptr', models.OneToOneField( | ||
parent_link=True, | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
to='cms.CMSPlugin', | ||
on_delete=models.CASCADE, | ||
)), | ||
('title', models.CharField(max_length=200)), | ||
('heading_type', models.CharField(max_length=3)), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
] |
Empty file.
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,19 @@ | ||
from django.db import models | ||
from cms.models.pluginmodel import CMSPlugin | ||
|
||
HEADINGS_CHOICES = ( | ||
('h1','h1'), | ||
('h2', 'h2'), | ||
('h3','h3'), | ||
('h4','h4'), | ||
('h5','h5'), | ||
('h6','h6'), | ||
) | ||
|
||
class Heading(CMSPlugin): | ||
title = models.CharField(max_length=200) | ||
heading_type = models.CharField(max_length=3, choices=HEADINGS_CHOICES, default='h1') | ||
|
||
def __str__(self): | ||
return self.title | ||
|
15 changes: 15 additions & 0 deletions
15
foundation/okfplugins/heading/templates/heading_plugin.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,15 @@ | ||
<!-- heading --> | ||
{% if instance.heading_type == 'h1' %} | ||
<h1 class="px-3 py-5 font-bold text-center text-h0 border border-gray-300">{{ instance.title }}</h1> | ||
{% elif instance.heading_type == 'h2' %} | ||
<h2 class="px-3 py-5 font-bold text-center text-h1 border border-gray-300">{{ instance.title }}</h2> | ||
{% elif instance.heading_type == 'h3' %} | ||
<h3 class="px-3 py-5 font-bold text-center text-h2 border border-gray-300">{{ instance.title }}</h3> | ||
{% elif instance.heading_type == 'h4' %} | ||
<h4 class="px-3 py-5 font-bold text-center text-h3 border border-gray-300">{{ instance.title }}</h4> | ||
{% elif instance.heading_type == 'h5' %} | ||
<h5 class="px-3 py-5 font-bold text-center text-h4 border border-gray-300">{{ instance.title }}</h5> | ||
{% elif instance.heading_type == 'h6' %} | ||
<h6 class="px-3 py-5 font-bold text-center text-h5 border border-gray-300">{{ instance.title }}</h6> | ||
{% endif %} | ||
<!-- /heading --> |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,3 +1,23 @@ | ||
.btn { | ||
@apply inline-block px-12 py-[1.1875rem] bg-black text-white text-2xl font-bold rounded-[1.25rem]; | ||
@apply inline-block px-12 py-[1.1875rem] bg-black text-white text-2xl font-bold rounded-[1.25rem] transition-colors duration-500 ease-in-out; | ||
|
||
&:hover { | ||
@apply text-okfn-purple; | ||
} | ||
|
||
&:active { | ||
@apply bg-okfn-purple text-white duration-150; | ||
} | ||
|
||
&.-white{ | ||
@apply bg-white text-black; | ||
|
||
&:hover { | ||
@apply text-okfn-purple; | ||
} | ||
|
||
&:active { | ||
@apply bg-okfn-purple text-white duration-150; | ||
} | ||
} | ||
} |
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,15 @@ | ||
.iframe-video { | ||
@apply mx-auto mb-5 last:mb-0; | ||
|
||
&__wrapper { | ||
@apply relative h-0;; | ||
|
||
padding-bottom: 56.25%; /* 16:9 */ | ||
/* background: url(../images/video-placeholder.webp) no-repeat center center; */ | ||
/* background-size: cover; */ | ||
} | ||
|
||
iframe { | ||
@apply absolute top-0 left-0 w-full h-full; | ||
} | ||
} |
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
Oops, something went wrong.