Added in contact, chat and mailing list templates
This commit is contained in:
parent
f7197f59f7
commit
2cef5bf87a
|
@ -47,6 +47,7 @@ LOCAL_APPS = (
|
|||
# custom users app
|
||||
'mhackspace.users.apps.UsersConfig',
|
||||
'mhackspace.feeds',
|
||||
'mhackspace.contact',
|
||||
# Your stuff: custom apps go here
|
||||
)
|
||||
|
||||
|
|
|
@ -71,3 +71,7 @@ TEST_RUNNER = 'django.test.runner.DiscoverRunner'
|
|||
|
||||
# Your local stuff: Below this line define 3rd party library settings
|
||||
# ------------------------------------------------------------------------------
|
||||
CAPTCHA = {
|
||||
'secret': '',
|
||||
'site': ''
|
||||
}
|
||||
|
|
|
@ -7,10 +7,15 @@ from django.conf.urls.static import static
|
|||
from django.contrib import admin
|
||||
from django.views.generic import TemplateView
|
||||
from django.views import defaults as default_views
|
||||
from mhackspace.contact.views import contact
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', TemplateView.as_view(template_name='pages/home.html'), name='home'),
|
||||
url(r'^about/$', TemplateView.as_view(template_name='pages/about.html'), name='about'),
|
||||
url(r'^chat/$', TemplateView.as_view(template_name='pages/chat.html'), name='chat'),
|
||||
url(r'^mailing-list/$', TemplateView.as_view(template_name='pages/mailing-list.html'), name='group'),
|
||||
|
||||
url(r'^contact/$', contact, name='contact'),
|
||||
|
||||
# Django Admin, use {% url 'admin:index' %}
|
||||
url(settings.ADMIN_URL, admin.site.urls),
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
from django import forms
|
||||
|
||||
TYPES = (
|
||||
('general', 'General'),
|
||||
('donate', 'Donate equipment money or time'),
|
||||
('event', 'Event')
|
||||
)
|
||||
|
||||
class ContactForm(forms.Form):
|
||||
contact_name = forms.CharField(required=True)
|
||||
contact_email = forms.EmailField(required=True)
|
||||
subject = forms.CharField(required=True)
|
||||
message = forms.CharField(
|
||||
required=True,
|
||||
widget=forms.Textarea
|
||||
)
|
||||
type = forms.MultipleChoiceField(
|
||||
required=True,
|
||||
widget=forms.Select,
|
||||
choices=TYPES)
|
|
@ -0,0 +1,11 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from django import template
|
||||
from mhackspace.feeds.models import Feed
|
||||
from scaffold.readers.rss_reader import feed_reader
|
||||
from django.conf import settings
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.inclusion_tag('partials/recapture.html')
|
||||
def google_capture():
|
||||
return settings.CAPTCHA
|
|
@ -0,0 +1,10 @@
|
|||
from django.shortcuts import render
|
||||
from mhackspace.contact.forms import ContactForm
|
||||
|
||||
# add to your views
|
||||
def contact(request):
|
||||
form_class = ContactForm
|
||||
|
||||
return render(request, 'pages/contact.html', {
|
||||
'form': form_class,
|
||||
})
|
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
|
@ -12,7 +12,7 @@
|
|||
<!--[if lt IE 9]>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<link rel="icon" type="image/png" href="/static/images/favicon.png">
|
||||
{% block css %}
|
||||
<!-- Latest compiled and minified Bootstrap 4 Alpha 4 CSS -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/css/bootstrap.min.css" integrity="sha384-2hfp1SzUoho7/TsGGGDaFdsuuDL0LX2hnUp6VkX3CUQ2K4K+xjboZdsXyp4oUHZj" crossorigin="anonymous">
|
||||
|
@ -23,7 +23,6 @@
|
|||
<link href="{% static 'css/project.css' %}" rel="stylesheet">
|
||||
{% endcompress %}
|
||||
{% endblock %}
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -43,16 +42,16 @@
|
|||
<a class="nav-link" href="{% url 'home' %}">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'home' %}">Chat</a>
|
||||
<a class="nav-link" href="{% url 'chat' %}">Chat</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'home' %}">Donate</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'home' %}">Contat</a>
|
||||
<a class="nav-link" href="{% url 'contact' %}">Contact</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'home' %}">Mailing List</a>
|
||||
<a class="nav-link" href="{% url 'group' %}">Mailing List</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'home' %}">Login</a>
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
{% extends "base.html" %}
|
||||
{% load feed_views %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Introduction</h2>
|
||||
|
||||
Pop in and say hi, please be patient users tend to idle, but will likely respond given a chance.
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<iframe src="https://webchat.freenode.net?channels=%23maidstone-hackspace&uio=MTE9MjU207" style="width:100%;height:400px;"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
|
@ -0,0 +1,21 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load recapture %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Contact us</h2>
|
||||
|
||||
<form method="POST" action="{% url 'account_change_password' %}" class="password_change">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
{{ google_capture }}
|
||||
<button class="btn btn-primary" type="submit" name="action">{% trans "Send" %}</button>
|
||||
</form>
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
{{ block.super }}
|
||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||
{% endblock %}
|
|
@ -0,0 +1,15 @@
|
|||
{% extends "base.html" %}
|
||||
{% load feed_views %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Mailing list</h2>
|
||||
<iframe id="forum_embed" src="javascript:void(0)" style="background-color:#fff;width:100%;" scrolling="no" frameborder="0" width="900" height="700"></iframe>
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
{{ block.super }}
|
||||
<script type="text/javascript">
|
||||
document.getElementById("forum_embed").src = "https://groups.google.com/forum/embed/?place=forum/maidstone-hackspace" + "&showsearch=true&showpopout=true&parenturl=" + encodeURIComponent(window.location.href);
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -0,0 +1 @@
|
|||
<div class="g-recaptcha" data-sitekey="{{ site }}"></div>
|
Loading…
Reference in New Issue