...
 
Commits (2)
......@@ -14,7 +14,7 @@ services:
- staticfiles:/static/
app:
image: hsumd/hsumd_app
# image: hsumd/hsumd_app
restart: always
build: ./website
expose:
......@@ -35,4 +35,4 @@ services:
volumes:
certs:
staticfiles:
\ No newline at end of file
staticfiles:
from django.contrib import admin
from .models import AboutUs, Featurette, Lifemember
from .models import AboutUs, ContactCard, Featurette, Lifemember
# Register your models here.
admin.site.register(Lifemember)
admin.site.register(AboutUs)
admin.site.register(Featurette)
\ No newline at end of file
admin.site.register(Featurette)
admin.site.register(ContactCard)
# Generated by Django 2.2 on 2019-04-19 19:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frontpage', '0017_aboutus'),
]
operations = [
migrations.CreateModel(
name='ContactCard',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('heading', models.CharField(max_length=30, verbose_name='Heading')),
('sub_heading', models.CharField(max_length=100, verbose_name='Subheading')),
('icon', models.CharField(max_length=30, null=True, verbose_name='Icon')),
],
),
]
......@@ -20,4 +20,12 @@ class Featurette(models.Model):
icon = models.CharField('Icon', max_length=30, null=True)
def __str__(self):
return self.heading
\ No newline at end of file
return self.heading
class ContactCard(models.Model):
heading = models.CharField('Heading', max_length=30)
sub_heading = models.CharField('Subheading', max_length=100)
icon = models.CharField('Icon', max_length=30, null=True)
def __str__(self):
return self.heading
.feature-icon {
font-size: 3em;
}
......@@ -54,6 +54,9 @@
<li class="nav-item">
<a class="nav-link" href="{% url 'lifemembers'%}">Life Members</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'contactus'%}">Contact Us</a>
</li>
</ul>
</div>
</nav>
......
{% extends "frontpage/basic_template.html" %}
{% block custom-css %}
{% load static %}
<link rel="stylesheet" href="{% static 'css/aboutus.css' %}">
{% endblock %}
{% block content %}
<body class="text-white bg-info body-image">
<div class="album">
<div class="container-fluid py-5 bg-info mx-auto">
<h2 class="text-center">We'd love to hear from you!</h2>
<div class="container py-5 mx-auto col-md-10 offset-md-1">
<div class="row">
{% for card in contactcards %}
<div class="col-md-4 my-2">
<div class="card text-dark mb-4 shadow h-100 bg-secondary">
<div class="card-body align-middle text-center text-light">
<h3 class="card-heading text-center">{{ card.heading }}</h2>
<i class="{{ card.icon }} p-4 feature-icon"></i>
<p class="lead text-center">{{ card.sub_heading }}</p>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</body>
{% endblock %}
......@@ -5,4 +5,5 @@ from . import views
urlpatterns = [
path('', views.index, name='index'),
path('lifemembers.html', views.lifemembers, name='lifemembers'),
path('contactus.html', views.contactus, name='contactus'),
]
from django.http import HttpResponse
from django.shortcuts import render
from .models import Featurette, AboutUs, Lifemember
from .models import Featurette, ContactCard, AboutUs, Lifemember
# Create your views here.
def index(request):
......@@ -30,3 +30,10 @@ def lifemembers(request):
return render(request, 'frontpage/lifemembers.html', context)
def contactus(request):
contactcards = (contactcard for contactcard in ContactCard.objects.order_by('id'))
context = {
'contactcards': contactcards
}
return render(request, 'frontpage/contactus.html', context)