Skip to content

Commit

Permalink
Start using flatblocks to make site generic and not specific to djang…
Browse files Browse the repository at this point in the history
…o packages
  • Loading branch information
saegey committed Mar 15, 2011
1 parent e6f3a2a commit b67828d
Show file tree
Hide file tree
Showing 10 changed files with 269 additions and 24 deletions.
83 changes: 83 additions & 0 deletions fixtures/flatblocks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[
{
"pk": 1,
"model": "flatblocks.flatblock",
"fields": {
"content": "Django Packages",
"header": "",
"slug": "site.name"
}
},
{
"pk": 2,
"model": "flatblocks.flatblock",
"fields": {
"content": "We're sorry but a server error has occurred. We've been notified and will look into it as soon as possible.\"\r\n<br />\r\nPerhaps you would like to <a href=\"http://github.com/djangopackages/djangopackages/issues\">create a ticket?</a>",
"header": "Server Error!",
"slug": "error.404"
}
},
{
"pk": 3,
"model": "flatblocks.flatblock",
"fields": {
"content": "We're sorry but a server error has occurred. We've been notified and will look into it as soon as possible.\"\r\n<br />\r\nPerhaps you would like to <a href=\"http://github.com/djangopackages/djangopackages/issues\">create a ticket?</a>",
"header": "Server Error!",
"slug": "error.500"
}
},
{
"pk": 4,
"model": "flatblocks.flatblock",
"fields": {
"content": "Django",
"header": "",
"slug": "site.package_type"
}
},
{
"pk": 5,
"model": "flatblocks.flatblock",
"fields": {
"content": "Django Packages is a directory of reusable apps, sites, tools, and more for your Django projects.",
"header": "",
"slug": "site.description"
}
},
{
"pk": 6,
"model": "flatblocks.flatblock",
"fields": {
"content": "We have sent you an e-mail. If you do not receive it within a few minutes, contact us at <a href=\"mailto:[email protected]\">[email protected]</a>.",
"header": "",
"slug": "email.text"
}
},
{
"pk": 7,
"model": "flatblocks.flatblock",
"fields": {
"content": "Hosted By:<a href=\"http://www.cartwheelweb.com/\">Cartwheel, LLC</a>. Powered by <a href=\"http://www.djangoproject.com/\">Django</a>, <a href=\"http://www.pinaxproject.com/\">Pinax</a> and <a href=\"/grids/g/this-site/\">these fine packages</a>.",
"header": "",
"slug": "footer.text"
}
},
{
"pk": 8,
"model": "flatblocks.flatblock",
"fields": {
"content": "&copy; 2010 <a href=\"http://pydanny.com\">Daniel Greenfeld</a> & <a href=\"http://www.audreymroy.com\">Audrey Roy</a>",
"header": "",
"slug": "copyright.text"
}
},
{
"pk": 9,
"model": "flatblocks.flatblock",
"fields": {
"content": "If you have any problems, please <a href=\"http://github.com/djangopackages/djangopackages/issues\">submit a ticket</a>.",
"header": "",
"slug": "issue.text"
}
}
]
167 changes: 167 additions & 0 deletions fixtures/flatpages.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions requirements/project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ bzr==2.3.1
launchpadlib==1.9.8
coverage==3.4
django-coverage==1.1.1
django-flatblocks==0.5.0
1 change: 1 addition & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
"tastypie",
"reversion",
"django_sorting",
"flatblocks",

# Pinax
"pinax.apps.account",
Expand Down
10 changes: 2 additions & 8 deletions templates/404.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
{% extends "site_base.html" %}

{% load i18n %}
{% load flatblock_tags %}

{% block head_title %}{% trans "Not Found" %}{% endblock %}

{% block body %}
<div id="error-404">
<img src="{{ STATIC_URL }}img/logo_501x316.png" />

<p>{% trans "We're sorry but that page could not be found." %}

Perhaps you would like to create a new
<a href="{% url add_package%}">package</a> or
<a href="{% url add_grid %}">grid?</a>

</p>
{% flatblock 'error.404' | blocktrans %}
</div>

{% endblock %}
9 changes: 2 additions & 7 deletions templates/500.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
{% extends "site_base.html" %}

{% load i18n %}
{% load flatblock_tags %}

{% block head_title %}{% trans "Server Error" %}{% endblock %}

{% block body %}
<div id="error-404">
<img src="{{ STATIC_URL }}img/logo_501x316.png" />

<h2>Server Error!</h2>

<p>{% trans "We're sorry but a server error has occurred. We've been notified and will look into it as soon as possible." %}
<br />
Perhaps you would like to <a href="http://github.com/djangopackages/djangopackages/issues">create a ticket?</a>
</p>
{% flatblock 'error.500' | blocktrans %}
</div>

{% endblock %}
3 changes: 2 additions & 1 deletion templates/account/includes/_trouble_ticket.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% load i18n %}
{% load flatblock_tags %}

<p>{% blocktrans %}If you have any problems, please <a href="http://github.com/djangopackages/djangopackages/issues">submit a ticket</a>.{% endblocktrans %}</p>
<p>{% plain_flatblock 'issue_text' | blocktrans %}</p>
3 changes: 2 additions & 1 deletion templates/account/password_reset_done.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

{% load i18n %}
{% load account_tags %}
{% load flatblock_tags %}

{% block head_title %}{% trans "Password Reset" %}{% endblock %}

Expand All @@ -12,5 +13,5 @@ <h1>{% trans "Password Reset" %}</h1>
<p><span class="warning">{% trans "Note" %}</span>: {% user_display user as user_display %}{% blocktrans %}you are already logged in as {{ user_display }}.{% endblocktrans %}</p>
{% endif %}

<p>{% blocktrans %}We have sent you an e-mail. If you do not receive it within a few minutes, contact us at <a href="mailto:[email protected]">[email protected]</a>.{% endblocktrans %}</p>
<p>{% plain_flatblock 'email.text' | blocktrans %}</p>
{% endblock %}
13 changes: 7 additions & 6 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{% load i18n %}
{% load ifsetting_tag account_tags openid_tags %}
{% load analytics %}
{% load flatblock_tags %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}" xml:lang="{{ LANGUAGE_CODE }}" lang="{{ LANGUAGE_CODE }}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>{% block head_title_base %}{% if SITE_NAME %}{{ SITE_NAME }} : {% endif %}{% block head_title %}{% endblock %}{% endblock %}</title>
<title>{% block head_title_base %}{% plain_flatblock 'site.name' | trans %} : {% block head_title %}{% endblock %}{% endblock %}</title>
<!--[if IE]><style>
div {
zoom: 1; /* trigger hasLayout */
Expand Down Expand Up @@ -49,7 +50,7 @@
{% endif %}
<div id="tabhead">
<div class="logo">
<img src="{{ STATIC_URL }}img/logo_squares.png" /><h1><a href="{% url home %}">Django Packages</a></h1>
<img src="{{ STATIC_URL }}img/logo_squares.png" /><h1><a href="{% url home %}">{% plain_flatblock 'site.name' | trans %}</a></h1>
</div>

<div class="login">
Expand Down Expand Up @@ -135,15 +136,15 @@
<div id="footer">
<div class="legal">
<hr /><br/>
&copy; 2010 <a href="http://pydanny.com">Daniel Greenfeld</a> & <a href="http://www.audreymroy.com">Audrey Roy</a>
- <a href="{% url about %}">{% trans "About" %}</a>
{% plain_flatblock 'copyright.text' | blocktrans %}
- <a href="/about/">{% trans "About" %}</a>
- <a href="/help/">{% trans "Help" %}</a>
- <a href="{% url terms %}">{% trans "Terms of Service" %}</a>
- <a href="/terms/">{% trans "Terms of Service" %}</a>
- <a href="/help/team/">Team</a>
- <a href="/api/v1/docs/">API</a>
- <a href="/help/syndication/">RSS / Atom</a>
<br />
{% trans "Hosted by" %} <a href="http://www.cartwheelweb.com/">Cartwheel, LLC</a>. {% trans "Powered by" %} <a href="http://www.djangoproject.com/">Django</a>, <a href="http://www.pinaxproject.com/">Pinax</a> and <a href="/grids/g/this-site/">these fine packages</a>.
{% plain_flatblock 'footer.text' | blocktrans %}
</div>
</div>

Expand Down
3 changes: 2 additions & 1 deletion templates/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% load i18n %}
{% load ifsetting_tag %}
{% load package_tags %}
{% load flatblock_tags %}

{% block extra_head %}
<link rel="stylesheet" href="{{ STATIC_URL }}css/home.css" />
Expand Down Expand Up @@ -78,7 +79,7 @@ <h2>random 5</h2>

<div id="home-leftcol">
<div id="home-borderlessbox">
<p>Django Packages is a directory of reusable apps, sites, tools, and more for your Django projects.</p>
<p>{% flatblock 'site.description' | blocktrans %}</p>
<br/>
<p><b>{{ package_count }}</b> packages and counting!</p>

Expand Down

0 comments on commit b67828d

Please sign in to comment.