Just hard code social settings
This commit is contained in:
parent
b6b012ca10
commit
7356ddcd71
5 changed files with 5 additions and 49 deletions
|
@ -1,5 +1,4 @@
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from .models import SocialMediaSettings
|
|
||||||
|
|
||||||
|
|
||||||
SETTINGS_KEYS = [
|
SETTINGS_KEYS = [
|
||||||
|
@ -18,7 +17,4 @@ def settings_injector(request):
|
||||||
django_settings = {}
|
django_settings = {}
|
||||||
for setting in SETTINGS_KEYS:
|
for setting in SETTINGS_KEYS:
|
||||||
django_settings[setting] = getattr(settings, setting)
|
django_settings[setting] = getattr(settings, setting)
|
||||||
django_settings.update({
|
|
||||||
'social': SocialMediaSettings.for_site(request.site)
|
|
||||||
})
|
|
||||||
return {'settings': django_settings}
|
return {'settings': django_settings}
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.4 on 2016-12-28 21:21
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
initial = True
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('wagtailcore', '0032_add_bulk_delete_page_permission'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='SocialMediaSettings',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('flickr', models.URLField(help_text='Flickr Profile URL')),
|
|
||||||
('freenode', models.CharField(help_text='Freenode Username', max_length=15)),
|
|
||||||
('github', models.URLField(help_text='GitHub Profile URL')),
|
|
||||||
('reddit', models.URLField(help_text='Reddit Profile URL')),
|
|
||||||
('twitter', models.CharField(help_text='Twitter Username', max_length=15)),
|
|
||||||
('youtube', models.URLField(help_text='Youtube Channel URL')),
|
|
||||||
('site', models.OneToOneField(editable=False, on_delete=django.db.models.deletion.CASCADE, to='wagtailcore.Site')),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
'abstract': False,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -4,7 +4,6 @@ from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel
|
||||||
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
||||||
from wagtailmetadata.models import MetadataPageMixin
|
from wagtailmetadata.models import MetadataPageMixin
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from wagtail.contrib.settings.models import BaseSetting, register_setting
|
|
||||||
|
|
||||||
|
|
||||||
class Entity(MetadataPageMixin, Page):
|
class Entity(MetadataPageMixin, Page):
|
||||||
|
@ -38,13 +37,3 @@ class Entity(MetadataPageMixin, Page):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
|
|
||||||
@register_setting
|
|
||||||
class SocialMediaSettings(BaseSetting):
|
|
||||||
flickr = models.URLField(help_text="Flickr Profile URL")
|
|
||||||
freenode = models.CharField(help_text="Freenode Username", max_length=15)
|
|
||||||
github = models.URLField(help_text="GitHub Profile URL")
|
|
||||||
reddit = models.URLField(help_text="Reddit Profile URL")
|
|
||||||
twitter = models.CharField(help_text='Twitter Username', max_length=15)
|
|
||||||
youtube = models.URLField(help_text='Youtube Channel URL')
|
|
||||||
|
|
|
@ -3,6 +3,11 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<p class="social">
|
<p class="social">
|
||||||
|
<a href="https://github.com/RealOrangeOne/"><i class="fa fa-github"></i></a>
|
||||||
|
<a href="https://twitter.com/RealOrangeOne/"><i class="fa fa-twitter"></i></a>
|
||||||
|
<a href="https://reddit.com/u/RealOrangeOne/"><i class="fa fa-reddit"></i></a>
|
||||||
|
<a href="https://youtube.com/TheOrangeOneOfficial/"><i class="fa fa-youtube"></i></a>
|
||||||
|
<a href="https://flickr.com/photos/TheOrangeOne/"><i class="fa fa-flickr"></i></a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in a new issue