Moved "static" pages to the basics app

This commit is contained in:
Gergely Polonkai 2013-10-01 23:40:42 +02:00
parent 414ff5b4a4
commit 4560c925fc
10 changed files with 53 additions and 20 deletions

0
basics/__init__.py Normal file
View File

View File

@ -0,0 +1,12 @@
{% extends "front_base.html" %}
{% load static from staticfiles %}
{% block title %} - Disclaimer{% endblock %}
{% block content %}
<h3>Disclaimer</h3>
<p>The articles and thoughts on this site all originate from me, unless otherwise stated. Please use them with this statement in your mind. If you use anything, please put a backlink on your site to the given article(s) or the main page.</p>
<p>The social media icons on the right are from <a href="http://komodomedia.com/"><img src="{% static "images/komodomedia_azure_16.png" %}" alt="komodomedia.com" target="_blank" /> komodomedia.com</a>.</p>
<p>Some design ideas, like the arrows under the menu items are from a friend, <a href="http://www.d4untless.com/">Judit Pásti</a>.
{% endblock content %}

16
basics/tests.py Normal file
View File

@ -0,0 +1,16 @@
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)

8
basics/urls.py Normal file
View File

@ -0,0 +1,8 @@
from django.conf.urls import patterns, url
from basics import views
urlpatterns = patterns('',
url(r'^resume', views.resume, name='resume'),
url(r'^about', views.about, name='about'),
url(r'^disclaimer', views.disclaimer, name='disclaimer'),
)

10
basics/views.py Normal file
View File

@ -0,0 +1,10 @@
from django.shortcuts import render
def resume(request):
return render(request, 'resume.html', {})
def about(request):
return render(request, 'basics/about.html', {})
def disclaimer(request):
return render(request, 'basics/disclaimer.html', {})

View File

@ -6,7 +6,4 @@ urlpatterns = patterns('',
url(r'^feed$', views.feed, name='feed'),
url(r'^tag/(?P<tag>.*)$', views.taglist, name='taglist'),
url(r'^(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/(?P<slug>[^/]+)$', views.read, name='read'),
url(r'^resume', views.resume, name='resume'),
url(r'^about', views.resume, name='about'),
url(r'^disclaimer', views.resume, name='disclaimer'),
)

View File

@ -21,11 +21,3 @@ def taglist(request, tag):
def feed(request):
return render(request, 'blog/feed.xml', {})
def resume(request):
return render(request, 'resume.html', {})
def about(request):
return renden(request, 'about.html', {})
def disclaimer(request):
return renden(request, 'disclaimer.html', {})

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

View File

@ -42,9 +42,9 @@
<div id="menu">
<div id="tagcloud-button"><img alt="" src="{% static "images/tagcloud.png" %}" /></div>
<ul>
<li {% if currentMenu == 'resume' %} class="active"{% endif %}><a href="{% url 'blog:resume' %}">Resume</a></li>
<li {% if currentMenu == 'resume' %} class="active"{% endif %}><a href="{% url 'basics:resume' %}">Resume</a></li>
<li {% if currentMenu == 'blog' %} class="active"{% endif %}><a href="{% url 'blog:index' %}">Blog</a></li>
<li {% if currentMenu == 'about' %} class="active"{% endif %}><a href="{% url 'blog:about' %}">About me</a></li>
<li {% if currentMenu == 'about' %} class="active"{% endif %}><a href="{% url 'basics:about' %}">About me</a></li>
</ul>
<br class="clear" />
</div>
@ -62,7 +62,7 @@
<div id="bottombar-wrapper">
<div id="bottombar-padding"></div>
<div id="bottombar"{% if app.environment == 'dev' %} style="bottom: 40px;"{% endif %}>
:: Copyright &copy; 2012, Gergely Polonkai :: <a href="{% url 'blog:disclaimer' %}">Disclaimer</a> ::
:: Copyright &copy; 2012, Gergely Polonkai :: <a href="{% url 'basics:disclaimer' %}">Disclaimer</a> ::
</div>
</div>
<a href="https://github.com/gergelypolonkai" id="github-ribbon" target="_blank"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png" alt="Fork me on GitHub"></a>

View File

@ -6,11 +6,9 @@ admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'blog.views.mainpage', name='home'),
# url(r'^$', 'gergelypolonkai_django.views.home', name='home'),
url(r'^blog/', include('blog.urls', namespace='blog')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('basics.urls', namespace='basics')),
)