From 1afcd6bf994e53c4da549236d22daca2dc14c9e9 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Thu, 26 Jul 2007 13:52:46 +0000 Subject: [PATCH] We've now got a sane template structure. webtemplates/base.html is the parent of all pages. index.html in that directory is the default page, and sub-directories from there will hold the templates for various applications. Notice how in index.html and the file in the news directory are put together. It's really simple, see the Template documentation on djangoproject.com for more in-depth details. --- apps/news/views.py | 4 +- apps/website/views.py | 1 + webtemplates/prosimii/base.html | 74 ++------ webtemplates/prosimii/index.html | 190 +++++++-------------- webtemplates/prosimii/news/show_entry.html | 66 +++++++ 5 files changed, 147 insertions(+), 188 deletions(-) create mode 100644 webtemplates/prosimii/news/show_entry.html diff --git a/apps/news/views.py b/apps/news/views.py index f4b221e148..0535f4ffe1 100755 --- a/apps/news/views.py +++ b/apps/news/views.py @@ -15,8 +15,8 @@ def show_news(request, entry_id): #news_entries = NewsEntry.objects.all().order_by('-date_posted')[:10] pagevars = { - "page_title": "Front Page", + "page_title": "News Entry", } context_instance = RequestContext(request) - return render_to_response('base.html', pagevars, context_instance) + return render_to_response('news/show_entry.html', pagevars, context_instance) diff --git a/apps/website/views.py b/apps/website/views.py index 046dbebfd0..640c2d1643 100644 --- a/apps/website/views.py +++ b/apps/website/views.py @@ -27,6 +27,7 @@ def page_index(request): pagevars = { "page_title": "Front Page", + "no_sidebar": True, "news_entries": news_entries, "players_connected_recent": recent_players, "num_players_connected": functions_db.get_connected_players().count(), diff --git a/webtemplates/prosimii/base.html b/webtemplates/prosimii/base.html index 1aada3d657..e6131dea29 100644 --- a/webtemplates/prosimii/base.html +++ b/webtemplates/prosimii/base.html @@ -7,10 +7,17 @@ - + {% if no_sidebar %} + + {% else %} + + {% endif %} + {% block header_ext %} + {% endblock %} + {{game_name}} @@ -46,7 +53,7 @@
Navigation: - Home | + Home | About | Documentation | Staff List | @@ -55,67 +62,12 @@
- -

This page’s menu:

- - + {% block sidebar %}{% endblock %}
-

Alternative Layout

-

This is an alternative layout of Prosimii. Notice the presence of a - side menu on the left of page. If you are viewing this page in a fully standards-compliant browser, the side - menu will scroll with the page. If you are viewing in Internet Explorer, however, the menu - will appear stationary.

- -

The following text is essentially the same as the previous page except elaborated.

- -

Improved Cross-browser Compatibility

-

Before Prosimii, I did not test my designs in Opera prior to submitting - them to OSWD. As a result, these templates don’t render properly in that browser. In - contrast, Prosimii has been fully tested in - Opera (7.01), Gecko - (Mozilla Firefox 0.10.1) - and Internet Explorer (6.0) for consistent rendering.

- -

This means that people using standards-compliant browsers - will see the same format and layout of your page.

- -

Comprehensive Stylesheets

-
-
More robust screen stylesheet
-
The improved cross-browser consistency is a result of - Prosimii’s more comprehensive screen stylesheet. Major style - parameters are explicitly defined in the stylesheet, resulting in less dependence on - browser-determined defaults and thus fewer rendering idiosyncrasies.
-
Addition of a print media stylesheet
-
Prosimii has a print media stylesheet that styles the page in a - format appropriate for black and white printing. To see the effect of this stylesheet, - select print preview from the - file menu, or direct this page to a printer (NB: print only - this frame if you are viewing this template in a multi-frame document). Alternatively, - if you're using Firefox, use the stylesheet switcher - in the bottom right-hand corner of the browser window.
-
- -

Accessibility Features

-

Prosimii incorporates accessibility features for people with impaired - vision. The template tentatively conforms to the - WCAG double A rating and - § 508 guidelines for web content - accessibility. The relative simplicity of the template’s underlying markup ensures that - your page can be easily transformed for rendering in aural, tactile (braille) and other - non-visual user agents.

- -

Additionally, the majority of document metrics (widths, lengths and spacings) are font-size - relative. This means that a user can increase the default font size of your page (using their - browser) without compromising it’s layout.

+ {% block content %} + {% endblock %}
@@ -127,4 +79,4 @@ - + diff --git a/webtemplates/prosimii/index.html b/webtemplates/prosimii/index.html index c80501730b..1bce140248 100644 --- a/webtemplates/prosimii/index.html +++ b/webtemplates/prosimii/index.html @@ -1,137 +1,77 @@ - +{% extends "base.html" %} - - - - - +{% block sidebar %} +{% endblock %} - - - +{% block header_ext %} +{% endblock %} - {{game_name}} - +{% block content %} +
+
+

Welcome!

+

Welcome to your new installation of Evennia, your friendly + neighborhood next-generation MUD server. You'll want to customize + this file, webtemplates/prosimii/index.html, to have a more + valid welcome message. Should you have any questions, concerns, + ideas, or bug reports, head over to the + Evennia community and + speak up!

+
- - - +
+

Latest News

+ {% for entry in news_entries %} + {{entry.title}} +

{{entry.date_posted|time}}

+

{{entry.body|truncatewords:20}}

+ {% endfor %} - + - +
-
-

{{game_name}}

-
- -   -
+
-
+
+

Players

+

+ There are currently {{num_players_connected}} connected, + and a total of {{num_players_registered}} registered. Of these, {{num_players_registered_recent}} were created this week, and {{num_players_connected_recent}} have connected within the last seven days. +

+
- -
+
+

Recently Connected

+
    + {% for player in players_connected_recent %} +
  • {{player.username}} -- {{player.last_login|timesince}} ago
  • + {% endfor %} +
+

+
-
- Navigation: - Home | - About | - Documentation | - Staff List | - Admin Interface -
-
+
+

Database Stats

+
    +
  • {{num_players}} players
  • +
  • {{num_rooms}} rooms
  • +
  • {{num_things}} things
  • +
  • {{num_exits}} exits
  • +
+
- +
+

Evennia

+

Evennia is MUD server built in + Python, on top of the + Twisted and + Django frameworks. This + combination of technology allows for the quick and easy creation + of games, as simple as complex as one desires.

+
-
-
-
-

Welcome!

-

Welcome to your new installation of Evennia, your friendly - neighborhood next-generation MUD server. You'll want to customize - this file, webtemplates/prosimii/index.html, to have a more - valid welcome message. Should you have any questions, concerns, - ideas, or bug reports, head over to the - Evennia community and - speak up!

-
- -
-

Latest News

- {% for entry in news_entries %} - {{entry.title}} -

{{entry.date_posted|time}}

-

{{entry.body|truncatewords:20}}

- {% endfor %} - - - -

-
-
- -
- -
-

Players

-

- There are currently {{num_players_connected}} connected, - and a total of {{num_players_registered}} registered. Of these, {{num_players_registered_recent}} were created this week, and {{num_players_connected_recent}} have connected within the last seven days. -

-
- -
-

Recently Connected

-
    - {% for player in players_connected_recent %} -
  • {{player.username}} -- {{player.last_login|timesince}} ago
  • - {% endfor %} -
-

-
- -
-

Database Stats

-
    -
  • {{num_players}} players
  • -
  • {{num_rooms}} rooms
  • -
  • {{num_things}} things
  • -
  • {{num_exits}} exits
  • -
-
- -
-

Evennia

-

Evennia is MUD server built in - Python, on top of the - Twisted and - Django frameworks. This - combination of technology allows for the quick and easy creation - of games, as simple as complex as one desires.

-
-
-
- - - - - - +
+{% endblock %} \ No newline at end of file diff --git a/webtemplates/prosimii/news/show_entry.html b/webtemplates/prosimii/news/show_entry.html new file mode 100644 index 0000000000..c3a26b9714 --- /dev/null +++ b/webtemplates/prosimii/news/show_entry.html @@ -0,0 +1,66 @@ +{% extends "base.html" %} + +{% block header_ext %} +{% endblock %} + +{% block sidebar %} +

This page’s menu:

+ +{% endblock %} + +{% block content %} +

Alternative Layout

+

This is an alternative layout of Prosimii. Notice the presence of a + side menu on the left of page. If you are viewing this page in a fully standards-compliant browser, the side + menu will scroll with the page. If you are viewing in Internet Explorer, however, the menu + will appear stationary.

+ +

The following text is essentially the same as the previous page except elaborated.

+ +

Improved Cross-browser Compatibility

+

Before Prosimii, I did not test my designs in Opera prior to submitting + them to OSWD. As a result, these templates don’t render properly in that browser. In + contrast, Prosimii has been fully tested in + Opera (7.01), Gecko + (Mozilla Firefox 0.10.1) + and Internet Explorer (6.0) for consistent rendering.

+ +

This means that people using standards-compliant browsers + will see the same format and layout of your page.

+ +

Comprehensive Stylesheets

+
+
More robust screen stylesheet
+
The improved cross-browser consistency is a result of + Prosimii’s more comprehensive screen stylesheet. Major style + parameters are explicitly defined in the stylesheet, resulting in less dependence on + browser-determined defaults and thus fewer rendering idiosyncrasies.
+
Addition of a print media stylesheet
+
Prosimii has a print media stylesheet that styles the page in a + format appropriate for black and white printing. To see the effect of this stylesheet, + select print preview from the + file menu, or direct this page to a printer (NB: print only + this frame if you are viewing this template in a multi-frame document). Alternatively, + if you're using Firefox, use the stylesheet switcher + in the bottom right-hand corner of the browser window.
+
+ +

Accessibility Features

+

Prosimii incorporates accessibility features for people with impaired + vision. The template tentatively conforms to the + WCAG double A rating and + § 508 guidelines for web content + accessibility. The relative simplicity of the template’s underlying markup ensures that + your page can be easily transformed for rendering in aural, tactile (braille) and other + non-visual user agents.

+ +

Additionally, the majority of document metrics (widths, lengths and spacings) are font-size + relative. This means that a user can increase the default font size of your page (using their + browser) without compromising it’s layout.

+{% endblock %} \ No newline at end of file