Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Commit

Permalink
Merge standard template into demo
Browse files Browse the repository at this point in the history
  • Loading branch information
tswicegood committed Apr 24, 2012
1 parent fe1d84e commit 051dc86
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 98 deletions.
3 changes: 1 addition & 2 deletions armstrong/cli/templates/demo/settings/defaults.py
@@ -1,6 +1,4 @@
# Django settings for {{ project_name }} project.
import os

from .helpers import project_dir


Expand Down Expand Up @@ -68,6 +66,7 @@
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
project_dir("static"),
)

# List of finder classes that know how to find static files in
Expand Down
@@ -0,0 +1,37 @@
<h2>Everything Worked!</h2>

<p>
Welcome to your new <a href="http://armstrongcms.org/">Armstrong</a>
powered website. Thank you for checking out Armstrong.
</p>

<p>
This placeholder content is being displayed in place of real content
because the appropriate data was not found inside your configured
database. There are two ways you could fix this:
</p>

<ol>
<li>
Log in to the <a href="{% url admin:index %}">admin</a> and create some
new content.
</li>

<li>
Run <code>armstrong load_demo_data</code> inside your project
which will scrape the last 10 days worth of content from
<a href="http://en.wikinews.org/wiki">WikiNews</a>.
</li>
</ol>

<p>
We recommend the latter option if you're just starting out with
Armstrong and would like to kick the tires.
</p>


{% comment %}
TODO: Add Where to next? section
TODO: Add link to "Getting Started for Developers" once complete
TODO: Add link to "Getting Started for Journalists" once complete
{% endcomment %}
33 changes: 22 additions & 11 deletions armstrong/cli/templates/demo/templates/base.html
Expand Up @@ -12,26 +12,28 @@
<!-- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<title>Your Armstrong Project</title>
<title>{% block title %}Your Armstrong Project{% endblock %}</title>
<meta name="description" content="">
<meta name="author" content="">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

{% block extra_head %}
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
{% endblock %}

{% block css %}
<!-- CSS
================================================== -->
<link rel="stylesheet" href="{{ STATIC_URL }}css/base.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/skeleton.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/layout.css">

{% comment %}TODO: Remove these styles {% endcomment %}
<style>
.container .half.column {
width: 50%;
}

.container article .image { margin: 0 0 20px 0;}
.container article .image.left { margin: 4px 20px 20px 0; float: left; }
Expand All @@ -43,46 +45,55 @@
article.big p { font-size: larger; }
article.half p { font-size: smaller; }
</style>
{% endblock %}

{% block favicons %}
<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="{{ STATIC_URL }}images/favicon.ico">
<link rel="apple-touch-icon" href="{{ STATIC_URL }}images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="{{ STATIC_URL }}images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="{{ STATIC_URL }}images/apple-touch-icon-114x114.png">
{% endblock %}

</head>

<body>

<div class="container">

<header class="sixteen columns row">
{% block header %}
<h1>Welcome to Armstrong!</h1>
{% endblock %}
</header>

<section class="row">
<section class="one-third column">
<section class="four columns">
{% block sidemenu %}
<a href='{% url front_page %}'>Home</a>
<a href='{% url home %}'>Home</a>
{% section_menu section_view='section_view' %}
{% endblock %}
</section>

<section id="content" class="two-thirds column">
<section id="content" class="twelve columns">
{% block content %}
{% endblock %}
</section>
</section>

</div>
<!-- JavaScript at the bottom for fast page loading -->

{% block scripts %}
<!-- JavaScript at the bottom for fast page loading -->
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{{ STATIC_URL }}javascript/jquery-1.7.1.min.js"><\/script>')</script>
<script src="{{ STATIC_URL }}javascript/jquery.masonry.min.js"></script>
<script>
$(document).ready(function() {
{% block scripts_on_ready %}
$("section#the-rest").masonry({itemSelector: "article"});
{% endblock %}
});
</script>
{% endblock %}
</body>
</html>
4 changes: 3 additions & 1 deletion armstrong/cli/templates/demo/templates/front_page.html
Expand Up @@ -9,6 +9,8 @@
{% render_next "standard" %}
{% render_next "standard" %}
{% render_next "standard" %}
{% render_remainder "half" %}
<section id="the-rest">
{% render_remainder "half" %}
</section>
{% endrender_iter %}
{% endblock %}
93 changes: 25 additions & 68 deletions armstrong/cli/templates/demo/templates/index.html
@@ -1,68 +1,25 @@
{% comment %}
This is based on Skeleton (getskeleton.com)
{% endcomment %}
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>
<head>

<!-- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<title>Your Armstrong Project</title>
<meta name="description" content="">
<meta name="author" content="">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<!-- CSS
================================================== -->
<link rel="stylesheet" href="{{ STATIC_URL }}css/base.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/skeleton.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/layout.css">

<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="{{ STATIC_URL }}images/favicon.ico">
<link rel="apple-touch-icon" href="{{ STATIC_URL }}images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="{{ STATIC_URL }}images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="{{ STATIC_URL }}images/apple-touch-icon-114x114.png">

</head>

<body>
<div id="container">

<header class="sixteen columns">
<h1>Your Armstrong Project</h1>
</header>

<section class="sixteen column" role="main">
<h2>Everything Worked!</h2>
<p>
Thanks for checking out Armstrong! This is a static template
that you can edit to fit your needs, or remove entirely if you
want something else.
</p>
<p>
Please check out
<a href="http://github.com/armstrong/">our GitHub page</a>
for more information on what to do next.
</p>
</section>

<footer>
</footer>
</div> <!--! end of #container -->
<!-- JavaScript at the bottom for fast page loading -->
</body>
</html>

{% extends "base.html" %}
{% load layout_helpers %}

{% block content %}
{% comment %}
Note, this `if well` statement is only here to enable the
welcome page for an Armstrong site that does not have any
data in it. For production sites, this may be unnecessary.
{% endcomment %}

{% if well %}
{% render_iter well.items|slice:":15" %}
{% render_next "big" %}
{% render_next "big" %}
{% render_next "standard" %}
{% render_next "standard" %}
{% render_next "standard" %}
<section id="the-rest">
{% render_remainder "half" %}
</section>
{% endrender_iter %}
{% else %}
{% include "armstrong/includes/welcome.html" %}
{% endif %}
{% endblock %}
@@ -1,11 +1,7 @@
{% load related_content %}
<article class="half alpha one-third column clearfix">
<article class="alpha six columns clearfix">
<h4>{{ object.title }}</h4>

<div class="image left">
{% lead_art object "article_small" %}
</div>

{% autoescape off %}
<p>
{{ object.summary }}
Expand Down
27 changes: 16 additions & 11 deletions armstrong/cli/templates/demo/urls/defaults.py
Expand Up @@ -15,6 +15,7 @@
from armstrong import hatband as admin
admin.autodiscover()

# TODO: Document why this is here
from .utils import get_url_for_model

urlpatterns = patterns('',
Expand All @@ -31,13 +32,17 @@
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),

# Below is an example well view that might be used to display a well named
# 'front_page' allowing for placement of content on the home page. The view
# works so long as there is a well with the title ``front_page`` present.
url(r'^$', QuerySetBackedWellView.as_view(well_title='front_page',
template_name="front_page.html",
queryset=Article.published.all()),
name='front_page'),
# ## Creating a standard "front page"
#
# Below is an example of an adhoc QuerySetBackedWellView. You should
# uncomment it if you used `armstrong load_demo_data` to create your
# initial data set.
#
url(r'^$',
QuerySetBackedWellView.as_view(well_title="front_page",
allow_empty=True, template_name="index.html",
queryset=Article.published.all()),
name="home"),

url(r'^section/(?P<full_slug>[-\w/]+)',
SimpleSectionView.as_view(template_name='section.html'),
Expand All @@ -53,10 +58,10 @@
name='all_articles_feed'),

url(r'^article/(?P<slug>[-\w]+)/', object_detail, {
'queryset': Article.published.all().select_subclasses(),
'template_name': 'article.html',
'slug_field': 'slug',
},
'queryset': Article.published.all().select_subclasses(),
'template_name': 'article.html',
'slug_field': 'slug',
},
name='article_detail'),
)

Expand Down
4 changes: 4 additions & 0 deletions armstrong/cli/templates/demo/urls/development.py
Expand Up @@ -13,3 +13,7 @@
# url(r'^$', '{{ project_name }}.views.debug', name='debug'),
# url(r'^{{ project_name }}/', include('{{ project_name }}.debug.urls')),
)

# Load staticfiles for testing purposes
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns += staticfiles_urlpatterns()

0 comments on commit 051dc86

Please sign in to comment.