creates heros automagically, added loc model, and other things!
|
@ -39,6 +39,7 @@ INSTALLED_APPS = [
|
|||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'widget_tweaks',
|
||||
'django_cleanup'
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
@ -123,3 +124,10 @@ STATIC_URL = '/static/'
|
|||
STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, "static"),
|
||||
]
|
||||
|
||||
CRISPY_TEMPLATE_PACK = 'bootstrap4'
|
||||
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||
MEDIA_URL = '/media/'
|
||||
|
||||
PROJECT_PATH = os.path.abspath(os.path.dirname(__name__))
|
|
@ -15,9 +15,13 @@ Including another URLconf
|
|||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from django.conf.urls.static import static
|
||||
from django.conf import settings
|
||||
|
||||
urlpatterns = [
|
||||
path ('admin/', admin.site.urls),
|
||||
path ('', include('homepage.urls')),
|
||||
path ('admin/', include('admin.urls')),
|
||||
path( 'adminpanel/', admin.site.urls),
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
@ -1,7 +1,8 @@
|
|||
from django.contrib import admin
|
||||
from .models import Poll, Answer
|
||||
from .models import Poll, Answer, Location
|
||||
|
||||
# Register your models here.
|
||||
|
||||
admin.site.register(Location)
|
||||
admin.site.register(Poll)
|
||||
admin.site.register(Answer)
|
|
@ -1,16 +1,16 @@
|
|||
from django import forms
|
||||
from django.contrib.auth.models import User
|
||||
import re
|
||||
from .models import Answer, EMOTION_CHOICES
|
||||
|
||||
class PollForm(forms.ModelForm):
|
||||
hi = forms.CharField(max_length=200, required=True)
|
||||
lo = forms.CharField(max_length=200, required=True)
|
||||
emotion = forms.ChoiceField(widget=forms.RadioSelect, choices=EMOTION_CHOICES, required=True)
|
||||
name = forms.CharField(max_length=100)
|
||||
place = forms.CharField(max_length=100)
|
||||
question = forms.CharField(max_length=200)
|
||||
|
||||
class Meta:
|
||||
model = Answer
|
||||
from django import forms
|
||||
from django.contrib.auth.models import User
|
||||
import re
|
||||
from .models import Answer, EMOTION_CHOICES
|
||||
|
||||
class PollForm(forms.ModelForm):
|
||||
hi = forms.CharField(max_length=200, required=True)
|
||||
lo = forms.CharField(max_length=200, required=True)
|
||||
emotion = forms.ChoiceField(widget=forms.RadioSelect, choices=EMOTION_CHOICES, required=True)
|
||||
name = forms.CharField(max_length=100)
|
||||
place = forms.CharField(max_length=100)
|
||||
question = forms.CharField(max_length=200)
|
||||
|
||||
class Meta:
|
||||
model = Answer
|
||||
fields = ['hi', 'lo', 'emotion', 'name', 'place', 'question']
|
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 3.0.8 on 2020-08-25 21:41
|
||||
# Generated by Django 3.1 on 2020-08-26 17:28
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
@ -12,23 +12,31 @@ class Migration(migrations.Migration):
|
|||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Location',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(blank=True, max_length=20, null=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Poll',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('askHi', models.BooleanField(default=True)),
|
||||
('HiText', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('askLo', models.BooleanField(default=True)),
|
||||
('LoText', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('askEmotion', models.BooleanField(default=True)),
|
||||
('EmotionText', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('askName', models.BooleanField(default=True)),
|
||||
('NameText', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('askPlace', models.BooleanField(default=True)),
|
||||
('PlaceText', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('askQuestion', models.BooleanField(default=True)),
|
||||
('QuestionText', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('ask_hi', models.BooleanField(default=True)),
|
||||
('hi_text', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('ask_lo', models.BooleanField(default=True)),
|
||||
('lo_text', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('ask_emotion', models.BooleanField(default=True)),
|
||||
('emotion_text', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('ask_name', models.BooleanField(default=True)),
|
||||
('name_text', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('ask_place', models.BooleanField(default=True)),
|
||||
('place_text', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('ask_question', models.BooleanField(default=False)),
|
||||
('question_text', models.CharField(blank=True, max_length=50, null=True)),
|
||||
('pub_date', models.DateTimeField(verbose_name='date published')),
|
||||
('location', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.location')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
|
@ -37,9 +45,11 @@ class Migration(migrations.Migration):
|
|||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('hi', models.CharField(blank=True, max_length=200, null=True)),
|
||||
('lo', models.CharField(blank=True, max_length=200, null=True)),
|
||||
('name', models.CharField(blank=True, max_length=200, null=True)),
|
||||
('place', models.CharField(blank=True, max_length=200, null=True)),
|
||||
('poll', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.Poll')),
|
||||
('emotion', models.CharField(blank=True, choices=[('happy', 'Happy'), ('meh', 'Meh'), ('sad', 'Sad')], default='meh', max_length=8, null=True)),
|
||||
('name', models.CharField(blank=True, max_length=100, null=True)),
|
||||
('place', models.CharField(blank=True, max_length=100, null=True)),
|
||||
('question', models.CharField(blank=True, max_length=200, null=True)),
|
||||
('poll', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.poll')),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 3.0.8 on 2020-08-25 21:41
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='answer',
|
||||
name='emotion',
|
||||
field=models.CharField(blank=True, max_length=200, null=True),
|
||||
),
|
||||
]
|
38
homepage/migrations/0002_auto_20200826_1732.py
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Generated by Django 3.1 on 2020-08-26 17:32
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='poll',
|
||||
name='emotion_text',
|
||||
field=models.CharField(blank=True, default='how are you feeling today?', max_length=50, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='poll',
|
||||
name='hi_text',
|
||||
field=models.CharField(blank=True, default='What was the <span class="hi">Hi</span> of this we', max_length=50, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='poll',
|
||||
name='lo_text',
|
||||
field=models.CharField(blank=True, default='What was the <span class="lo">Lo</span> of this we', max_length=50, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='poll',
|
||||
name='name_text',
|
||||
field=models.CharField(blank=True, default="what's your name?", max_length=50, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='poll',
|
||||
name='place_text',
|
||||
field=models.CharField(blank=True, default='where are you from?', max_length=50, null=True),
|
||||
),
|
||||
]
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 3.0.8 on 2020-08-25 22:20
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0002_answer_emotion'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='answer',
|
||||
name='emotion',
|
||||
field=models.CharField(blank=True, choices=[('happy', 'Happy'), ('meh', 'Meh'), ('sad', 'Sad')], default='meh', max_length=8, null=True),
|
||||
),
|
||||
]
|
19
homepage/migrations/0003_auto_20200826_1738.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 3.1 on 2020-08-26 17:38
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0002_auto_20200826_1732'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='poll',
|
||||
name='location',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='homepage.location'),
|
||||
),
|
||||
]
|
|
@ -1,73 +0,0 @@
|
|||
# Generated by Django 3.0.8 on 2020-08-25 22:33
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0003_auto_20200825_2220'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='askEmotion',
|
||||
new_name='ask_emotion',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='askHi',
|
||||
new_name='ask_hi',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='askLo',
|
||||
new_name='ask_lo',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='askName',
|
||||
new_name='ask_name',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='askPlace',
|
||||
new_name='ask_place',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='askQuestion',
|
||||
new_name='ask_question',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='EmotionText',
|
||||
new_name='emotion_text',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='HiText',
|
||||
new_name='hi_text',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='LoText',
|
||||
new_name='lo_text',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='NameText',
|
||||
new_name='name_text',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='PlaceText',
|
||||
new_name='place_text',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='poll',
|
||||
old_name='QuestionText',
|
||||
new_name='question_text',
|
||||
),
|
||||
]
|
23
homepage/migrations/0004_auto_20200826_1831.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 3.1 on 2020-08-26 18:31
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0003_auto_20200826_1738'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='location',
|
||||
name='hero',
|
||||
field=models.ImageField(default='hero.png', upload_to='heros'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='location',
|
||||
name='slug',
|
||||
field=models.CharField(blank=True, max_length=20, null=True),
|
||||
),
|
||||
]
|
18
homepage/migrations/0005_auto_20200826_1843.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1 on 2020-08-26 18:43
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0004_auto_20200826_1831'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='hero',
|
||||
field=models.ImageField(default='hero.png', upload_to='heros/<django.db.models.fields.CharField>-hero.png'),
|
||||
),
|
||||
]
|
18
homepage/migrations/0006_auto_20200826_1858.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1 on 2020-08-26 18:58
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0005_auto_20200826_1843'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='hero',
|
||||
field=models.ImageField(default='hero.png', upload_to='heros'),
|
||||
),
|
||||
]
|
18
homepage/migrations/0007_location_hero_mobile.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1 on 2020-08-26 19:20
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('homepage', '0006_auto_20200826_1858'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='location',
|
||||
name='hero_mobile',
|
||||
field=models.ImageField(default='hero-mobile.png', upload_to='heros'),
|
||||
),
|
||||
]
|
|
@ -1,22 +1,67 @@
|
|||
from django.db import models
|
||||
|
||||
import os
|
||||
|
||||
from django.core.files import File
|
||||
|
||||
from django.conf import settings
|
||||
from django.templatetags.static import static
|
||||
from django.utils.text import slugify
|
||||
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class Location (models.Model):
|
||||
name = models.CharField(max_length=20, blank=True, null=True)
|
||||
slug = models.CharField(max_length=20, blank=True, null=True)
|
||||
|
||||
hero = models.ImageField(default="hero.png", upload_to='heros')
|
||||
hero_mobile = models.ImageField(default="hero-mobile.png", upload_to='heros')
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
self.slug = slugify(self.name)
|
||||
self.hero = f'heros/hero-{self.slug}.png'
|
||||
self.hero_mobile = f'heros/hero-{self.slug}-mobile.png'
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
output = f'{settings.PROJECT_PATH}/media/heros/hero-{self.slug}.png'
|
||||
mobile_output = f'{settings.PROJECT_PATH}/media/heros/hero-{self.slug}-mobile.png'
|
||||
|
||||
img = Image.open(settings.PROJECT_PATH + static("css/res/hero.png"))
|
||||
draw = ImageDraw.Draw(img)
|
||||
font = ImageFont.truetype(settings.PROJECT_PATH + static("css/fonts/Shorelines-Script-Bold.otf"), 80)
|
||||
draw.text((1050,450), self.slug, (255,255,255), font=font)
|
||||
img.save(output)
|
||||
|
||||
img = Image.open(settings.PROJECT_PATH + static("css/res/hero-mobile.png"))
|
||||
draw = ImageDraw.Draw(img)
|
||||
font = ImageFont.truetype(settings.PROJECT_PATH + static("css/fonts/Shorelines-Script-Bold.otf"), 80)
|
||||
draw.text((420,860), self.slug, (255,255,255), font=font)
|
||||
img.save(mobile_output)
|
||||
|
||||
|
||||
|
||||
class Poll (models.Model):
|
||||
location = models.OneToOneField(Location, on_delete=models.CASCADE)
|
||||
|
||||
ask_hi = models.BooleanField(default=True)
|
||||
hi_text = models.CharField(max_length=50, blank=True, null=True)
|
||||
hi_text = models.CharField(max_length=50, blank=True, null=True, default='What was the <span class="hi">Hi</span> of this we')
|
||||
|
||||
ask_lo = models.BooleanField(default=True)
|
||||
lo_text = models.CharField(max_length=50, blank=True, null=True)
|
||||
lo_text = models.CharField(max_length=50, blank=True, null=True, default='What was the <span class="lo">Lo</span> of this we')
|
||||
|
||||
ask_emotion = models.BooleanField(default=True)
|
||||
emotion_text = models.CharField(max_length=50, blank=True, null=True)
|
||||
emotion_text = models.CharField(max_length=50, blank=True, null=True, default="how are you feeling today?")
|
||||
|
||||
ask_name = models.BooleanField(default=True)
|
||||
name_text = models.CharField(max_length=50, blank=True, null=True)
|
||||
name_text = models.CharField(max_length=50, blank=True, null=True, default="what's your name?")
|
||||
|
||||
ask_place = models.BooleanField(default=True)
|
||||
place_text = models.CharField(max_length=50, blank=True, null=True)
|
||||
place_text = models.CharField(max_length=50, blank=True, null=True, default="where are you from?")
|
||||
|
||||
ask_question = models.BooleanField(default=False)
|
||||
question_text = models.CharField(max_length=50, blank=True, null=True)
|
||||
|
@ -24,7 +69,7 @@ class Poll (models.Model):
|
|||
pub_date = models.DateTimeField('date published')
|
||||
|
||||
def __str__(self):
|
||||
return 'Current Poll'
|
||||
return f"{self.location.name}'s Poll"
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
|
||||
|
||||
<!-- Stylesheet -->
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'css/styles.css' %}">
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" href="{% static 'icon/favicon.ico' %}" type="image/x-icon">
|
||||
<link rel="icon" href="{% static 'icon/favicon.ico' %}" type="image/x-icon">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
|
||||
|
||||
<title>HiLo Arlington</title>
|
||||
|
||||
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
||||
<script>
|
||||
function onSubmit(token) {
|
||||
document.getElementById("poll").submit();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
{% block content %}{% endblock content %}
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
|
||||
<script src="{% static 'js/main.js' %}" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
|
||||
|
||||
<!-- Stylesheet -->
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'css/styles.css' %}">
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" href="{% static 'icon/favicon.ico' %}" type="image/x-icon">
|
||||
<link rel="icon" href="{% static 'icon/favicon.ico' %}" type="image/x-icon">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
|
||||
|
||||
<title>HiLo Arlington</title>
|
||||
|
||||
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
||||
<script>
|
||||
function onSubmit(token) {
|
||||
document.getElementById("poll").submit();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
{% block content %}{% endblock content %}
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
|
||||
<script src="{% static 'js/main.js' %}" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% extends 'homepage/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
{% extends 'homepage/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
{% enblock %}
|
|
@ -3,5 +3,6 @@ from . import views
|
|||
|
||||
urlpatterns = [
|
||||
path ('', views.homepage, name="homepage"),
|
||||
path ('<slug:slug>/', views.homepage),
|
||||
path ('finish/', views.finish, name="finish")
|
||||
]
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
from django.shortcuts import render, redirect
|
||||
from django.contrib import messages
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.http import HttpResponseNotFound
|
||||
|
||||
from .forms import PollForm
|
||||
from .models import Poll
|
||||
from .models import Poll, Location
|
||||
|
||||
# Create your views here.
|
||||
|
||||
def homepage (request):
|
||||
poll = get_object_or_404(Poll)
|
||||
def homepage (request, slug="arlington"):
|
||||
location = get_object_or_404(Location, slug=slug)
|
||||
|
||||
try:
|
||||
poll = location.poll
|
||||
except:
|
||||
return HttpResponseNotFound(f'404: No poll was found for {location}!')
|
||||
|
||||
if poll.ask_hi:
|
||||
hi_text = poll.hi_text
|
||||
|
@ -69,4 +75,5 @@ def homepage (request):
|
|||
return render(request, 'homepage/index.html', context=context)
|
||||
|
||||
def finish (request):
|
||||
pass
|
||||
pass
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
argparse
|
||||
django
|
||||
django-widget-tweaks
|
||||
pip-chill
|
||||
python
|
||||
wsgiref
|
||||
argparse==1.4.0
|
||||
django==3.1
|
||||
django-cleanup==5.0.0
|
||||
django-widget-tweaks==1.4.8
|
||||
pillow==7.2.0
|
||||
pip-chill==1.0.0
|
||||
|
|
BIN
static/css/fonts/Shorelines-Script-Bold.otf
Normal file
BIN
static/css/res/Shorelines-Script-Bold.otf
Normal file
Before Width: | Height: | Size: 4.1 MiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 26 KiB |
BIN
static/css/res/wys-hero-mobile.png
Normal file
After Width: | Height: | Size: 4.1 MiB |
BIN
static/css/res/wys-hero.png
Normal file
After Width: | Height: | Size: 1.4 MiB |
|
@ -1,179 +1,179 @@
|
|||
@charset "UTF-8";
|
||||
@font-face {
|
||||
src: url("./fonts/Hanson-Bold.ttf");
|
||||
font-family: "Hanson-Bold"; }
|
||||
@font-face {
|
||||
src: url("./fonts/WildYouth-Regular.otf");
|
||||
font-family: "WildYouth"; }
|
||||
@font-face {
|
||||
src: url("./fonts/FuturaPTMedium.otf");
|
||||
font-family: "Futura";
|
||||
font-weight: normal;
|
||||
font-style: normal; }
|
||||
@font-face {
|
||||
src: url("./fonts/FuturaPTLight.otf");
|
||||
font-family: "Futura-Light"; }
|
||||
@font-face {
|
||||
src: url("./fonts/FuturaPTHeavy.otf");
|
||||
font-family: "Futura-Heavy"; }
|
||||
html {
|
||||
background-color: #333;
|
||||
font-family: "Hanson-Bold", "Arial", sans-serif;
|
||||
overflow-x: none; }
|
||||
|
||||
body {
|
||||
overflow-y: scroll;
|
||||
/* Keep scroll functionality */
|
||||
-ms-overflow-style: none;
|
||||
/* IE and Edge */
|
||||
scrollbar-width: none;
|
||||
/* Firefox */ }
|
||||
|
||||
body::-webkit-scrollbar {
|
||||
display: none; }
|
||||
|
||||
.hero {
|
||||
color: #333 !important;
|
||||
background-color: #333 !important;
|
||||
background-image: url("res/hilo-hero-text.png");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-attachment: fixed; }
|
||||
@media (max-width: 768px) {
|
||||
.hero {
|
||||
background-image: url("res/hilo-hero-text-mobile.png"); } }
|
||||
|
||||
.arrow {
|
||||
cursor: pointer;
|
||||
width: 70px;
|
||||
margin: 0 auto;
|
||||
margin-top: 70vh;
|
||||
height: 100px; }
|
||||
|
||||
.arrow:after {
|
||||
content: "";
|
||||
margin-top: 70vh;
|
||||
width: 70px;
|
||||
height: 100px;
|
||||
position: absolute;
|
||||
background-image: url("res/arrow.svg");
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
-webkit-animation: 3s infinite ease;
|
||||
animation: 3s infinite ease;
|
||||
animation-name: การเคลื่อนไหวที่-1; }
|
||||
@keyframes การเคลื่อนไหวที่-1 {
|
||||
0%,
|
||||
100% {
|
||||
top: 50px; }
|
||||
50% {
|
||||
top: 80px; } }
|
||||
.vh-25 {
|
||||
height: 25vh; }
|
||||
|
||||
.vh-50 {
|
||||
height: 50vh; }
|
||||
|
||||
.banner {
|
||||
color: white;
|
||||
background-image: url("res/banner.png");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-attachment: fixed; }
|
||||
|
||||
.info-col {
|
||||
background-color: #fff; }
|
||||
|
||||
.info-header {
|
||||
color: white;
|
||||
font-family: "Hanson-Bold", "Arial", sans-serif;
|
||||
text-stroke: 3px #305899;
|
||||
-webkit-text-stroke: 3px #305899; }
|
||||
@media (max-width: 768px) {
|
||||
.info-header {
|
||||
font-size: 1.25em;
|
||||
text-stroke: 2px #305899;
|
||||
-webkit-text-stroke: 2px #305899; } }
|
||||
|
||||
.info {
|
||||
font-size: .8em;
|
||||
color: #2b5291;
|
||||
font-family: "Hanson-Bold", "Arial", sans-serif; }
|
||||
@media (max-width: 768px) {
|
||||
.info {
|
||||
font-size: .75em; } }
|
||||
|
||||
#insta-section {
|
||||
background-color: #333; }
|
||||
|
||||
.bg-colored:before {
|
||||
right: -999em;
|
||||
background: #0b3b52;
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 999em;
|
||||
top: 0;
|
||||
bottom: 0; }
|
||||
|
||||
.poll {
|
||||
color: white;
|
||||
background-image: url("res/gradient-mobile.png");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-attachment: fixed;
|
||||
font-family: "Hanson-Bold", "Arial", sans-serif;
|
||||
font-weight: lighter;
|
||||
font-size: .75em; }
|
||||
@media (max-width: 768px) {
|
||||
.poll {
|
||||
background-image: url("res/gradient-mobile.png"); } }
|
||||
|
||||
.short-answer {
|
||||
font-size: 1.2em; }
|
||||
|
||||
.title {
|
||||
color: #42b8c7;
|
||||
font-size: 1.45em; }
|
||||
|
||||
.subtitle {
|
||||
color: #42b8c7;
|
||||
font-size: 1.15em; }
|
||||
|
||||
label {
|
||||
font-size: 1.25em; }
|
||||
|
||||
.emote img {
|
||||
width: 25vw;
|
||||
height: auto; }
|
||||
|
||||
.btn {
|
||||
color: #2b5291;
|
||||
border-image-repeat: none; }
|
||||
|
||||
.hi {
|
||||
color: #48B93E;
|
||||
font-family: "WildYouth", "Hanson-Bold", "Arial", sans-serif; }
|
||||
|
||||
.lo {
|
||||
color: #E34848;
|
||||
font-family: "WildYouth", "Hanson-Bold", "Arial", sans-serif; }
|
||||
|
||||
[type=radio] {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0; }
|
||||
|
||||
/* IMAGE STYLES */
|
||||
[type=radio] + img {
|
||||
cursor: pointer; }
|
||||
|
||||
/* CHECKED STYLES */
|
||||
[type=radio]:checked + img {
|
||||
outline: 2px solid #2b5291; }
|
||||
|
||||
/*# sourceMappingURL=styles.css.map */
|
||||
@charset "UTF-8";
|
||||
@font-face {
|
||||
src: url("./fonts/Hanson-Bold.ttf");
|
||||
font-family: "Hanson-Bold"; }
|
||||
@font-face {
|
||||
src: url("./fonts/WildYouth-Regular.otf");
|
||||
font-family: "WildYouth"; }
|
||||
@font-face {
|
||||
src: url("./fonts/FuturaPTMedium.otf");
|
||||
font-family: "Futura";
|
||||
font-weight: normal;
|
||||
font-style: normal; }
|
||||
@font-face {
|
||||
src: url("./fonts/FuturaPTLight.otf");
|
||||
font-family: "Futura-Light"; }
|
||||
@font-face {
|
||||
src: url("./fonts/FuturaPTHeavy.otf");
|
||||
font-family: "Futura-Heavy"; }
|
||||
html {
|
||||
background-color: #333;
|
||||
font-family: "Hanson-Bold", "Arial", sans-serif;
|
||||
overflow-x: none; }
|
||||
|
||||
body {
|
||||
overflow-y: scroll;
|
||||
/* Keep scroll functionality */
|
||||
-ms-overflow-style: none;
|
||||
/* IE and Edge */
|
||||
scrollbar-width: none;
|
||||
/* Firefox */ }
|
||||
|
||||
body::-webkit-scrollbar {
|
||||
display: none; }
|
||||
|
||||
.hero {
|
||||
color: #333 !important;
|
||||
background-color: #333 !important;
|
||||
background-image: url("res/hilo-hero-text.png");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-attachment: fixed; }
|
||||
@media (max-width: 768px) {
|
||||
.hero {
|
||||
background-image: url("res/hilo-hero-text-mobile.png"); } }
|
||||
|
||||
.arrow {
|
||||
cursor: pointer;
|
||||
width: 70px;
|
||||
margin: 0 auto;
|
||||
margin-top: 70vh;
|
||||
height: 100px; }
|
||||
|
||||
.arrow:after {
|
||||
content: "";
|
||||
margin-top: 70vh;
|
||||
width: 70px;
|
||||
height: 100px;
|
||||
position: absolute;
|
||||
background-image: url("res/arrow.svg");
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
-webkit-animation: 3s infinite ease;
|
||||
animation: 3s infinite ease;
|
||||
animation-name: การเคลื่อนไหวที่-1; }
|
||||
@keyframes การเคลื่อนไหวที่-1 {
|
||||
0%,
|
||||
100% {
|
||||
top: 50px; }
|
||||
50% {
|
||||
top: 80px; } }
|
||||
.vh-25 {
|
||||
height: 25vh; }
|
||||
|
||||
.vh-50 {
|
||||
height: 50vh; }
|
||||
|
||||
.banner {
|
||||
color: white;
|
||||
background-image: url("res/banner.png");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-attachment: fixed; }
|
||||
|
||||
.info-col {
|
||||
background-color: #fff; }
|
||||
|
||||
.info-header {
|
||||
color: white;
|
||||
font-family: "Hanson-Bold", "Arial", sans-serif;
|
||||
text-stroke: 3px #305899;
|
||||
-webkit-text-stroke: 3px #305899; }
|
||||
@media (max-width: 768px) {
|
||||
.info-header {
|
||||
font-size: 1.25em;
|
||||
text-stroke: 2px #305899;
|
||||
-webkit-text-stroke: 2px #305899; } }
|
||||
|
||||
.info {
|
||||
font-size: .8em;
|
||||
color: #2b5291;
|
||||
font-family: "Hanson-Bold", "Arial", sans-serif; }
|
||||
@media (max-width: 768px) {
|
||||
.info {
|
||||
font-size: .75em; } }
|
||||
|
||||
#insta-section {
|
||||
background-color: #333; }
|
||||
|
||||
.bg-colored:before {
|
||||
right: -999em;
|
||||
background: #0b3b52;
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 999em;
|
||||
top: 0;
|
||||
bottom: 0; }
|
||||
|
||||
.poll {
|
||||
color: white;
|
||||
background-image: url("res/gradient-mobile.png");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-attachment: fixed;
|
||||
font-family: "Hanson-Bold", "Arial", sans-serif;
|
||||
font-weight: lighter;
|
||||
font-size: .75em; }
|
||||
@media (max-width: 768px) {
|
||||
.poll {
|
||||
background-image: url("res/gradient-mobile.png"); } }
|
||||
|
||||
.short-answer {
|
||||
font-size: 1.2em; }
|
||||
|
||||
.title {
|
||||
color: #42b8c7;
|
||||
font-size: 1.45em; }
|
||||
|
||||
.subtitle {
|
||||
color: #42b8c7;
|
||||
font-size: 1.15em; }
|
||||
|
||||
label {
|
||||
font-size: 1.25em; }
|
||||
|
||||
.emote img {
|
||||
width: 25vw;
|
||||
height: auto; }
|
||||
|
||||
.btn {
|
||||
color: #2b5291;
|
||||
border-image-repeat: none; }
|
||||
|
||||
.hi {
|
||||
color: #48B93E;
|
||||
font-family: "WildYouth", "Hanson-Bold", "Arial", sans-serif; }
|
||||
|
||||
.lo {
|
||||
color: #E34848;
|
||||
font-family: "WildYouth", "Hanson-Bold", "Arial", sans-serif; }
|
||||
|
||||
[type=radio] {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0; }
|
||||
|
||||
/* IMAGE STYLES */
|
||||
[type=radio] + img {
|
||||
cursor: pointer; }
|
||||
|
||||
/* CHECKED STYLES */
|
||||
[type=radio]:checked + img {
|
||||
outline: 2px solid #2b5291; }
|
||||
|
||||
/*# sourceMappingURL=styles.css.map */
|
||||
|
|