Luke Plant avatar Luke Plant committed b3f74d5

Basic django-cms implementation.

Comments (0)

Files changed (7)

christchurch/settings.py

 
 TIME_ZONE = "Europe/London"
 
+LANGUAGES = [('en', 'en')]
+DEFAULT_LANGUAGE = 0
+
 LANGUAGE_CODE = 'en-gb'
 
 SITE_ID = 1
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
+    'cms.middleware.page.CurrentPageMiddleware',
+    'cms.middleware.user.CurrentUserMiddleware',
+    'cms.middleware.toolbar.ToolbarMiddleware',
+    'cms.middleware.media.PlaceholderMediaMiddleware',
+)
+
+TEMPLATE_CONTEXT_PROCESSORS = (
+    'django.core.context_processors.auth',
+    'django.core.context_processors.i18n',
+    'django.core.context_processors.request',
+    'django.core.context_processors.media',
+    'cms.context_processors.media',
 )
 
 ROOT_URLCONF = 'christchurch.urls'
     'django.contrib.admin',
     'south',
     'christchurch',
+    'cms',
+    'menus',
+    'mptt',
+    'appmedia',
+    'south',
+    'cms.plugins.text',
+    'cms.plugins.picture',
+    'cms.plugins.link',
+    'cms.plugins.file',
+    'cms.plugins.snippet',
+    'cms.plugins.googlemap',
+)
+
+CMS_TEMPLATES = (
+    ('standard.html', 'Standard Template'),
 )
 
 LOGGING = {

christchurch/static/christchurch/css/style.css

+/* v1.0 | 20080212 */
+/* -- RESET -- */
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, font, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td {
+        margin: 0;
+        padding: 0;
+        border: 0;
+        outline: 0;
+        font-size: 100%;
+        vertical-align: baseline;
+        background: transparent;
+}
+body {
+        line-height: 1;
+}
+ol, ul {
+        list-style: none;
+}
+blockquote, q {
+        quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+        content: '';
+        content: none;
+}
+
+/* remember to highlight inserts somehow! */
+ins {
+        text-decoration: none;
+}
+del {
+        text-decoration: line-through;
+}
+
+/* tables still need 'cellspacing="0"' in the markup */
+table {
+        border-collapse: collapse;
+        border-spacing: 0;
+}
+/* -- END RESET -- */
+
+/* RESTORE */
+
+ul {
+        list-style-type: disc;
+        padding-left: 30px;
+	margin-bottom: 1em;
+}
+
+ol {
+        list-style-type: decimal;
+        padding-left: 30px;
+	margin-bottom: 1em;
+}
+
+li {
+        display: list-item;
+	margin-top: 0.4em;
+}
+
+
+ul ul, ol ul {
+        list-style-type: circle;
+}
+
+ol ol ul, ol ul ul, ul ol ul, ul ul ul {
+        list-style-type: square;
+}
+
+p {
+    margin-bottom: 1em;
+}
+
+blockquote {
+    margin-left: 2em;
+    margin-bottom: 1em;
+}
+
+/* END RESTORE */
+
+body {
+    color: white;
+    font-size: 14px;
+    font-family: Georgia;
+    line-height: normal;
+    margin: 0 0;
+    padding: 0 0;
+
+    background-image: url(../img/background.jpg);
+    background-color: #cbcbcb;
+    background-repeat: repeat-x;
+    background-position: 0px 120px;
+
+}
+
+#header, #body, #footer {
+    margin: 0px auto;
+    width: 110ex;
+    max-width: 100%;
+
+}
+
+#header {
+    background: white;
+    color: black;
+}
+
+#headercont {
+    background-image: url(../img/topbg.jpg);
+}
+
+#body {
+    background-color: white;
+    color: black;
+}
+
+#bodycont {
+}
+
+
+#bodyinner {
+    padding: 1em 3em 3em 3em;
+}
+
+#headertext {
+    font-family: Verdana, sans-serif;
+    font-size: 2em;
+    text-align: center;
+    padding: 0.3em;
+    background: #282828;
+    color: white;
+
+}
+
+#headeraddress {
+    margin-top: 3px;
+    text-align: center;
+}
+
+#headerformerly {
+    text-align: center;
+    padding-bottom: 6px;
+}
+
+#footerinner {
+    text-align: center;
+    font-size: small;
+    font-style: italic;
+    padding-bottom: 0em;
+    background-color: #101010;
+    color: white;
+    padding: 0.5em;
+}
+
+h1, h2, h3, h4, h5, h6 {
+   margin-bottom: 0.8em;
+   padding-top: 0.8em;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    font-family: Verdana, sans-serif;
+}
+
+h1, h2, h3  {
+    font-weight: bold;
+}
+
+h2, h3 {
+    font-style: italic;
+}
+
+h1 {
+    margin-left: -1.4em;
+}
+
+h2 {
+    margin-left: -1em;
+}
+
+
+h1 { font-size: 1.2em; }
+h2 { font-size: 1.1em; }
+h3 { font-size: 1.0em; }
+
+/* NAVBAR */
+#navbarcont {
+    margin: 0;
+    padding: 0.5em 0;
+    border-top: 1px solid #993366;
+    border-bottom: 1px solid #993366;
+    color: black;
+    background-color: white;
+}
+
+#navbarcont ul
+{
+    text-align: center;
+    padding: 0px;
+    font-family: verdana, sans-serif;
+    margin-bottom: 0;
+}
+
+#navbarcont ul li { 
+    display: inline; 
+    list-style-type: none;
+    margin: 0;
+}
+
+#navbarcont ul li a
+{
+    padding: 0.5em 1em;
+    color: #660033;
+    text-decoration: none;
+}
+
+#navbarcont ul li.here a {
+    background-color: #660033;
+    color: #fff;
+    border-top: 1px solid #660033;
+    border-bottom: 1px solid #660033;
+}
+
+#navbarcont ul li a:hover
+{
+    background-color: #993366;
+    color: #fff;
+    border-top: 1px solid #993366;
+    border-bottom: 1px solid #993366;
+}
+
+/* GENERAL */
+
+a:link, a:visited {
+    color: #660033;
+    text-decoration: underline;
+}
+
+a:hover {
+    color: #993366;
+    text-decoration: underline;
+}
+
+#footer a:link,
+#footer a:visited {
+    color: #d0d0d0;
+}
+
+#footer a:hover {
+    color: white;
+}
+
+h2.homepage {
+    text-align: center;
+    font-size: 1.6em;
+    color: #660033;
+    margin-bottom: 0.5em;
+    margin-top: 0.1em;
+}
+
+h1.homepage {
+   font-size: 2em;
+   font-weight: bold;
+   margin: 0em 0 0.2em 0;
+   padding: 0;
+}
+
+.servicetime {
+    font-weight: bold;
+}
+
+.programme td {
+    padding: 1px;
+    vertical-align: top;
+}
+
+.programme tr {
+    border-top: 1px solid #660033;
+
+}
+.programme tr.day {
+    border-top: 0px solid #660033;
+
+}
+
+.programme tr.day td {
+    padding-top: 0.1em;
+}
+
+td h3 {
+    margin-top: 0;
+    padding-top: 0;
+}
+
+.imgfloatright {
+    float: right;
+    margin-left: 5px;
+    margin-bottom: 5px;
+}
+
+.imgfloatleft {
+    float: left;
+    margin-right: 5px;
+    margin-bottom: 5px;
+}
+
+.col1, col2 {
+    width: 40%;
+    float: left;
+}
+.col2 {
+    margin-left: 50%;
+}
+
+.columns h2, .columns h3
+{
+    padding-top: 0.1em;
+    margin-left: 0;
+}
+
+.columns h2
+{
+    border-bottom: 1px solid #888;
+}
+
+.columns {
+    clear: both;
+}
+
+#photochanger {
+    width: 450px;
+    height: 200px;
+    border: 2px solid #444;
+    overflow: hidden;
+    background-color: black;
+}
+
+.photocont {
+    float: right;
+    margin-bottom: 20px;
+    margin-left: 5px;
+}
Add a comment to this file

christchurch/static/christchurch/img/background.jpg

Added
New image
Add a comment to this file

christchurch/static/christchurch/img/topbg.jpg

Added
New image

christchurch/templates/standard.html

+{% load cms_tags %}
+<!doctype html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+  <title>{{ request.current_page.get_title }} :: Christ Church, Bradford</title>
+  <meta name="keywords" content="Christ church, Bradford, church, evangelical, reformed, christchurch, Yorkshire, UK, Pollard Park">
+  <link rel="StyleSheet" href="/static/christchurch/css/style.css" type="text/css">
+  {% plugins_media %}
+
+</head>
+
+
+<body>
+  <div id="headercont">
+    <div id="header">
+      <div id="headertext">Christ Church, Bradford</div>
+      <div id="headeraddress">2 - 4 Leyton Drive, Off Ley Fleaks Road, Bradford, BD10 8RQ</div>
+      <div id="headerformerly">(Formerly: Pollard Park Evangelical Church)</div>
+    </div>
+  </div>
+  <div id="navbarcont">
+    <ul id="navbar">
+      <li><a href="/">Home</a></li>
+      <li><a href="/sunday/">Sunday</a></li>
+      <li><a href="/events/">Events</a></li>
+      <li><a href="/sermons/">Sermons</a></li>
+      <li><a href="/people/">People</a></li>
+      <li><a href="/directions/">Directions</a></li>
+      <li><a href="/teachings/">Teachings</a></li>
+      <li><a href="/contactus/">Contact us</a></li>
+    </ul>
+  </div>
+  <div id="bodycont">
+    <div id="body">
+      <div id="bodyinner">
+	{% block content %}
+          {% placeholder "main" %}
+        {% endblock %}
+      </div>
+    </div>
+    <div id="footer">
+      <div id="footerinner">
+	<a href="/">Home</a>
+	| <a href="/sitemap/">Site map</a>
+	| <a href="/contactus/">Contact us</a>
+      </div>
+    </div>
+  </div>
+</body>
+
+<body>
+</body>
+</html>

christchurch/urls.py

 from django.conf.urls.defaults import patterns, include, url
+from django.contrib import admin
+from django.conf import settings
 
-# Uncomment the next two lines to enable the admin:
-from django.contrib import admin
 admin.autodiscover()
 
 urlpatterns = patterns('',
-    # Examples:
-    # url(r'^$', 'christchurch.views.home', name='home'),
-    # url(r'^christchurch/', include('christchurch.foo.urls')),
+    url(r'^admin/', include(admin.site.urls)),
+    url(r'^', include('cms.urls')),
+)
 
-    # Uncomment the admin/doc line below to enable admin documentation:
-    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
+if settings.DEVBOX:
+    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
+    # appmedia
+    urlpatterns += patterns('',
+                           (r'^' + settings.MEDIA_URL.lstrip('/'), include('appmedia.urls')),
+    )
 
-    # Uncomment the next line to enable the admin:
-    url(r'^admin/', include(admin.site.urls)),
-)
+    # staticfiles and usermedia
+
+    urlpatterns += patterns('',
+                            (r'^usermedia/(?P<path>.*)$', 'django.views.static.serve',
+                             {'document_root': settings.MEDIA_ROOT}),
+    )
+
+    urlpatterns += staticfiles_urlpatterns()
 
     with virtualenv(version.venv_dir):
         with cd(version.project_dir):
-            run_venv("./manage.py collectstatic -v 0 --settings=christchurch.settings --noinput")
+            # django-cms requires appmedia, which overlaps a lot with Django's
+            # own 'statcifiles', but with different conventions (appmedia looks
+            # for 'media' directories and copies to MEDIA_ROOT, Django looks for
+            # 'static' and copies to STATIC_ROOT).  The easiest way to hack it
+            # is to create a symlink 'static' pointing to 'media' for the cms
+            # app. TODO!
+            run_venv("./manage.py collectstatic -v 0 --noinput")
 
     run("chmod -R ugo+r %s" % version.static_dir)
 
 def _update_db(target, version):
     with virtualenv(version.venv_dir):
         with cd(version.project_dir):
-            run_venv("./manage.py syncdb --settings=christchurch.settings")
-            run_venv("./manage.py migrate --all --settings=christchurch.settings")
+            run_venv("./manage.py syncdb")
+            run_venv("./manage.py migrate --all")
 
 
 def _deploy(target):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.