Compare commits
No commits in common. "b24f42689b30c2ad64002bbfed5b77ea061ed888" and "bc33331889695379a02d49b7dcfe014217fa1d19" have entirely different histories.
b24f42689b
...
bc33331889
|
@ -145,9 +145,6 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'data/images')
|
||||||
|
|
||||||
IMAGE_PREFIX = 'http://studio.camp/images/'
|
IMAGE_PREFIX = 'http://studio.camp/images/'
|
||||||
|
|
||||||
CONTACT_FROM_EMAIL = 'contact@studio.camp'
|
|
||||||
CONTACT_TO_EMAIL = ['contact@studio.camp']
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from local_settings import *
|
from local_settings import *
|
||||||
except:
|
except:
|
||||||
|
|
|
@ -187,9 +187,3 @@ table thead, table tbody, table tfoot {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
label, button {
|
|
||||||
color: #ffffff !important;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
background: #99999 !important;
|
|
||||||
}
|
|
||||||
|
|
|
@ -36,8 +36,6 @@ urlpatterns = [
|
||||||
url(r'directions.html', RedirectView.as_view(url='/directions/')),
|
url(r'directions.html', RedirectView.as_view(url='/directions/')),
|
||||||
url(r'campstudio.html', RedirectView.as_view(url='/directions/')),
|
url(r'campstudio.html', RedirectView.as_view(url='/directions/')),
|
||||||
|
|
||||||
url(r'^contact/$', views.contact),
|
|
||||||
|
|
||||||
url(r'^texts/index/$', views.section_list, {'section': 'Texts'}, name='texts_list'),
|
url(r'^texts/index/$', views.section_list, {'section': 'Texts'}, name='texts_list'),
|
||||||
url(r'^events/index/$', views.section_list, {'section': 'Events'}, name='events_list'),
|
url(r'^events/index/$', views.section_list, {'section': 'Events'}, name='events_list'),
|
||||||
url(r'^projects/index/$', views.section_list, {'section': 'Projects'}, name='projects_list'),
|
url(r'^projects/index/$', views.section_list, {'section': 'Projects'}, name='projects_list'),
|
||||||
|
@ -46,8 +44,8 @@ urlpatterns = [
|
||||||
url(r'^texts/(?P<shortname>.+)/$', views.texts, name='texts'),
|
url(r'^texts/(?P<shortname>.+)/$', views.texts, name='texts'),
|
||||||
url(r'^events/(?P<shortname>.+)/$', views.events, name='events'),
|
url(r'^events/(?P<shortname>.+)/$', views.events, name='events'),
|
||||||
url(r'^projects/(?P<shortname>.+)/$', views.projects, name='projects'),
|
url(r'^projects/(?P<shortname>.+)/$', views.projects, name='projects'),
|
||||||
url(r'^works/(?P<shortname>.+)/$', views.works, name='work'),
|
url(r'^works/(?P<shortname>.+)/$', views.works, name='works'),
|
||||||
url(r'^works/$', views.works, name='works'),
|
url(r'^works/$', views.works),
|
||||||
url(r'^projects/$', views.projects),
|
url(r'^projects/$', views.projects),
|
||||||
url(r'^events/$', views.events),
|
url(r'^events/$', views.events),
|
||||||
url(r'^texts/$', views.texts),
|
url(r'^texts/$', views.texts),
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
from django import forms
|
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
class ContactForm(forms.Form):
|
|
||||||
name = forms.CharField(label='Name', required=True)
|
|
||||||
email = forms.EmailField(label='E-Mail', required=True)
|
|
||||||
message = forms.CharField(label='Message', widget=forms.Textarea, required=True)
|
|
|
@ -1,4 +1,3 @@
|
||||||
{% load available_content%}
|
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html class="no-js" lang="en">
|
<html class="no-js" lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -22,10 +21,10 @@
|
||||||
<ul class="vertical-menu">
|
<ul class="vertical-menu">
|
||||||
<li><a href="/">HOME</a></li>
|
<li><a href="/">HOME</a></li>
|
||||||
<li><a href="/about">ABOUT</a></li>
|
<li><a href="/about">ABOUT</a></li>
|
||||||
{% available_content as sections %}
|
<li><a href="/projects">PROJECTS</a></li>
|
||||||
{% for url, title in sections %}
|
<li><a href="/events">EVENTS</a></li>
|
||||||
<li><a href="{Purl}}">{{title}}</a></li>
|
<li><a href="/works">WORKS</a></li>
|
||||||
{% endfor %}
|
<li><a href="/texts">TEXTS</a></li>
|
||||||
<li><a href="/contact">CONTACT</a></li>
|
<li><a href="/contact">CONTACT</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
{% extends 'base.html' %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="large-8 medium-8 columns special-column">
|
|
||||||
<div class="index-text">
|
|
||||||
{% if sent %}
|
|
||||||
<p>Thanks for getting in touch!</p>
|
|
||||||
{% else %}
|
|
||||||
<form method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
{{form}}
|
|
||||||
<br>
|
|
||||||
<input type="submit" value="Send Message">
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
|
@ -1,20 +0,0 @@
|
||||||
from django import template
|
|
||||||
from django.urls import reverse
|
|
||||||
|
|
||||||
from ..models import Content
|
|
||||||
|
|
||||||
|
|
||||||
register = template.Library()
|
|
||||||
|
|
||||||
|
|
||||||
@register.assignment_tag
|
|
||||||
def available_content():
|
|
||||||
sections = []
|
|
||||||
|
|
||||||
for type in ['projects', 'events', 'works', 'texts']:
|
|
||||||
if Content.objects.filter(type__name=type, published=True).exists():
|
|
||||||
sections.append([
|
|
||||||
reverse('works'),
|
|
||||||
type.capitalize()
|
|
||||||
])
|
|
||||||
return sections
|
|
|
@ -3,21 +3,18 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.core.mail import EmailMessage
|
|
||||||
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.http import HttpResponse, Http404
|
from django.http import HttpResponse, Http404
|
||||||
from django.shortcuts import get_object_or_404, render, redirect
|
from django.shortcuts import get_object_or_404, render, redirect
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.views.generic.list import ListView
|
from django.views.generic.list import ListView
|
||||||
|
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||||
|
|
||||||
from photologue.views import GalleryListView
|
from photologue.views import GalleryListView
|
||||||
from photologue.models import Photo, Gallery
|
from photologue.models import Photo, Gallery
|
||||||
|
|
||||||
from .models import Content, ContentContent
|
from .models import Content, ContentContent
|
||||||
from . import forms
|
|
||||||
|
|
||||||
ITEMS_PER_PAGE = 30
|
ITEMS_PER_PAGE = 30
|
||||||
|
|
||||||
|
@ -168,26 +165,6 @@ def page(request, shortname):
|
||||||
raise Http404
|
raise Http404
|
||||||
return render(request, 'page.html', {'content': content})
|
return render(request, 'page.html', {'content': content})
|
||||||
|
|
||||||
def contact(request):
|
|
||||||
context = {}
|
|
||||||
if request.method == 'POST':
|
|
||||||
form = forms.ContactForm(request.POST)
|
|
||||||
if form.is_valid():
|
|
||||||
name = form.cleaned_data['name']
|
|
||||||
email = form.cleaned_data['email']
|
|
||||||
message = form.cleaned_data['message']
|
|
||||||
subject = '{} has left a message on studio.camp'.format(name)
|
|
||||||
from_ = settings.CONTACT_FROM_EMAIL
|
|
||||||
to = settings.CONTACT_TO_EMAIL
|
|
||||||
msg = EmailMessage(subject, message, from_, to, reply_to=[email])
|
|
||||||
msg.send(fail_silently=True)
|
|
||||||
#msg.send()
|
|
||||||
context['sent'] = True
|
|
||||||
else:
|
|
||||||
form = forms.ContactForm()
|
|
||||||
context['form'] = form
|
|
||||||
return render(request, 'contact.html', context)
|
|
||||||
|
|
||||||
|
|
||||||
def limit_content(content, q):
|
def limit_content(content, q):
|
||||||
if q:
|
if q:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user