mirror of
https://github.com/evennia/evennia.git
synced 2026-03-26 01:36:32 +01:00
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.
This commit is contained in:
parent
a3ac4ff17c
commit
1afcd6bf99
5 changed files with 147 additions and 188 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -7,10 +7,17 @@
|
|||
<meta name="author" content="haran" />
|
||||
<meta name="generator" content="haran" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{{media_url}}css/prosimii-screen-alt.css" media="screen" title="Prosimii (alternative)" />
|
||||
{% if no_sidebar %}
|
||||
<link rel="stylesheet" type="text/css" href="{{media_url}}css/prosimii-screen.css" media="screen" title="Prosimii" />
|
||||
{% else %}
|
||||
<link rel="stylesheet" type="text/css" href="{{media_url}}css/prosimii-screen-alt.css" media="screen" title="Prosimii (Sidebar)" />
|
||||
{% endif %}
|
||||
<link rel="stylesheet alternative" type="text/css" href="{{media_url}}css/prosimii-print.css" media="screen" title="Print Preview" />
|
||||
<link rel="stylesheet" type="text/css" href="{{media_url}}css/prosimii-print.css" media="print" />
|
||||
|
||||
{% block header_ext %}
|
||||
{% endblock %}
|
||||
|
||||
<title>{{game_name}}</title>
|
||||
</head>
|
||||
|
||||
|
|
@ -46,7 +53,7 @@
|
|||
|
||||
<div class="subHeader">
|
||||
<span class="doNotDisplay">Navigation:</span>
|
||||
<a href="./index.html">Home</a> |
|
||||
<a href="/">Home</a> |
|
||||
<a href="./index.html">About</a> |
|
||||
<a href="./index.html">Documentation</a> |
|
||||
<a href="./index.html">Staff List</a> |
|
||||
|
|
@ -55,67 +62,12 @@
|
|||
</div>
|
||||
|
||||
<!-- ##### Side Menu ##### -->
|
||||
|
||||
<p class="doNotDisplay doNotPrint">This page’s menu:</p>
|
||||
<ul id="side-bar">
|
||||
<li><a href="#alt-layout" title="Alternative layout">Alt. layout</a></li>
|
||||
<li><a href="#compatibility" title="Improved cross-browser compatibility">Compatibility</a></li>
|
||||
<li><a href="#stylesheets" title="Comprehensive stylesheets">Stylesheets</a></li>
|
||||
<li><a href="#accessibility" title="Accessibility features">Accessibility</a></li>
|
||||
</ul>
|
||||
|
||||
{% block sidebar %}{% endblock %}
|
||||
<!-- ##### Main Copy ##### -->
|
||||
|
||||
<div id="main-copy">
|
||||
<h1 id="alt-layout">Alternative Layout</h1>
|
||||
<p>This is an alternative layout of <span lang="la">Prosimii</span>. Notice the presence of a
|
||||
side menu on the left of page. If you are viewing this page in a <span class="titleTip"
|
||||
title="eg: a Gecko family member or Opera">fully standards-compliant browser</span>, the side
|
||||
menu will scroll with the page. If you are viewing in Internet Explorer, however, the menu
|
||||
will appear stationary.</p>
|
||||
|
||||
<p>The following text is essentially the same as the previous page except elaborated.</p>
|
||||
|
||||
<h1 id="compatibility">Improved Cross-browser Compatibility</h1>
|
||||
<p>Before <span lang="la">Prosimii</span>, 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, <span lang="la">Prosimii</span> has been fully tested in
|
||||
<a href="http://www.opera.com">Opera</a> (7.01), Gecko
|
||||
(<a href="http://www.mozilla.org">Mozilla</a> <a href="http://www.getfirefox.com">Firefox</a> 0.10.1)
|
||||
and Internet Explorer (6.0) for consistent rendering.</p>
|
||||
|
||||
<p>This means that people using <span class="titleTip" title="eg: Mozilla 1+, Opera 7+, Netscape 6+, Internet Explorer 6+">standards-compliant browsers</span>
|
||||
will see the same format and layout of your page.</p>
|
||||
|
||||
<h1 id="stylesheets">Comprehensive Stylesheets</h1>
|
||||
<dl>
|
||||
<dt>More robust screen stylesheet</dt>
|
||||
<dd>The improved cross-browser consistency is a result of
|
||||
<span lang="la">Prosimii’s</span> 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.</dd>
|
||||
<dt>Addition of a print media stylesheet</dt>
|
||||
<dd><span lang="la">Prosimii</span> 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 <span class="smallCaps">print preview</span> from the
|
||||
<span class="smallCaps">file</span> 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 <a href="http://www.getfirefox.com">Firefox</a>, use the stylesheet switcher
|
||||
in the bottom right-hand corner of the browser window.</dd>
|
||||
</dl>
|
||||
|
||||
<h1 id="accessibility">Accessibility Features</h1>
|
||||
<p><span lang="la">Prosimii</span> incorporates accessibility features for people with impaired
|
||||
vision. The template tentatively conforms to the <a href="http://www.w3.org/TR/WCAG10">
|
||||
<acronym title="Web Content Accessibility Guidelines">WCAG</acronym> double A rating</a> and
|
||||
<a href="http://www.access-board.gov/508.htm">§ 508</a> 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.</p>
|
||||
|
||||
<p>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.</p>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
<!-- ##### Footer ##### -->
|
||||
|
|
@ -127,4 +79,4 @@
|
|||
</span>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,137 +1,77 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
{% extends "base.html" %}
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-AU">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
|
||||
<meta name="author" content="haran" />
|
||||
<meta name="generator" content="haran" />
|
||||
{% block sidebar %}
|
||||
{% endblock %}
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{{media_url}}css/prosimii-screen.css" media="screen, tv, projection" title="Default" />
|
||||
<link rel="stylesheet alternative" type="text/css" href="{{media_url}}css/prosimii-print.css" media="screen" title="Print Preview" />
|
||||
<link rel="stylesheet" type="text/css" href="{{media_url}}css/prosimii-print.css" media="print" />
|
||||
{% block header_ext %}
|
||||
{% endblock %}
|
||||
|
||||
<title>{{game_name}}</title>
|
||||
</head>
|
||||
{% block content %}
|
||||
<div class="rowOfBoxes">
|
||||
<div class="twoThirds noBorderOnLeft">
|
||||
<h1>Welcome!</h1>
|
||||
<p>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
|
||||
<a href="http://evennia.com">Evennia community</a> and
|
||||
speak up!</p>
|
||||
</div>
|
||||
|
||||
<body>
|
||||
<!-- For non-visual user agents: -->
|
||||
<div id="top"><a href="#main-copy" class="doNotDisplay doNotPrint">Skip to main content.</a></div>
|
||||
<div class="oneThird">
|
||||
<h1>Latest News</h1>
|
||||
{% for entry in news_entries %}
|
||||
<a href="/news/show/{{entry.id}}" class="newsHeading">{{entry.title}}</a>
|
||||
<p class="newsDate">{{entry.date_posted|time}}</p>
|
||||
<p class="newsSummary">{{entry.body|truncatewords:20}}</p>
|
||||
{% endfor %}
|
||||
|
||||
<!-- ##### Header ##### -->
|
||||
<div class="more"><a href="./index.html">More News »</a></div>
|
||||
|
||||
<div id="header">
|
||||
<div class="superHeader">
|
||||
<span>Related Sites:</span>
|
||||
<a href="http://evennia.com" title="The Python-based MUD server">Evennia</a> |
|
||||
<a href="http://www.oswd.org/userinfo.phtml?user=haran" title="Other designs by haran">haran’s Designs</a>
|
||||
</div>
|
||||
<p class="filler"><!-- Filler para to extend left vertical line --></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="midHeader">
|
||||
<h1 class="headerTitle" lang="la">{{game_name}}</h1>
|
||||
<div class="headerSubTitle" title="Slogan">
|
||||
<!-- Insert a slogan here if you want -->
|
||||
|
||||
</div>
|
||||
<div class="rowOfBoxes dividingBorderAbove">
|
||||
|
||||
<br class="doNotDisplay doNotPrint" />
|
||||
<div class="quarter noBorderOnLeft">
|
||||
<h1>Players</h1>
|
||||
<p>
|
||||
There are currently <strong>{{num_players_connected}}</strong> connected,
|
||||
and a total of <strong>{{num_players_registered}}</strong> registered. Of these, <strong>{{num_players_registered_recent}}</strong> were created this week, and <strong>{{num_players_connected_recent}}</strong> have connected within the last seven days.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="headerLinks">
|
||||
<span class="doNotDisplay">Tools:</span>
|
||||
<a href="/login">Log In «</a>
|
||||
<span class="doNotDisplay">|</span>
|
||||
<a href="/register">Register «</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="quarter">
|
||||
<h1>Recently Connected</h1>
|
||||
<ul>
|
||||
{% for player in players_connected_recent %}
|
||||
<li>{{player.username}} -- <em>{{player.last_login|timesince}} ago</em></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p class="filler"><!-- Filler para to extend left vertical line --></p>
|
||||
</div>
|
||||
|
||||
<div class="subHeader">
|
||||
<span class="doNotDisplay">Navigation:</span>
|
||||
<a href="./index.html">Home</a> |
|
||||
<a href="./index.html">About</a> |
|
||||
<a href="./index.html">Documentation</a> |
|
||||
<a href="./index.html">Staff List</a> |
|
||||
<a href="/admin/">Admin Interface</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="quarter">
|
||||
<h1>Database Stats</h1>
|
||||
<ul>
|
||||
<li>{{num_players}} players</li>
|
||||
<li>{{num_rooms}} rooms</li>
|
||||
<li>{{num_things}} things</li>
|
||||
<li>{{num_exits}} exits</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- ##### Main Copy ##### -->
|
||||
<div class="quarter">
|
||||
<h1>Evennia</h1>
|
||||
<p><a href="http://evennia.com">Evennia</a> is MUD server built in
|
||||
<a href="http://python.org">Python</a>, on top of the
|
||||
<a href="http://twistedmatrix.com">Twisted</a> and
|
||||
<a href="http://djangoproject.com">Django</a> frameworks. This
|
||||
combination of technology allows for the quick and easy creation
|
||||
of games, as simple as complex as one desires.</p>
|
||||
</div>
|
||||
|
||||
<div id="main-copy">
|
||||
<div class="rowOfBoxes">
|
||||
<div class="twoThirds noBorderOnLeft">
|
||||
<h1>Welcome!</h1>
|
||||
<p>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
|
||||
<a href="http://evennia.com">Evennia community</a> and
|
||||
speak up!</p>
|
||||
</div>
|
||||
|
||||
<div class="oneThird">
|
||||
<h1>Latest News</h1>
|
||||
{% for entry in news_entries %}
|
||||
<a href="/news/show/{{entry.id}}" class="newsHeading">{{entry.title}}</a>
|
||||
<p class="newsDate">{{entry.date_posted|time}}</p>
|
||||
<p class="newsSummary">{{entry.body|truncatewords:20}}</p>
|
||||
{% endfor %}
|
||||
|
||||
<div class="more"><a href="./index.html">More News »</a></div>
|
||||
|
||||
<p class="filler"><!-- Filler para to extend left vertical line --></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rowOfBoxes dividingBorderAbove">
|
||||
|
||||
<div class="quarter noBorderOnLeft">
|
||||
<h1>Players</h1>
|
||||
<p>
|
||||
There are currently <strong>{{num_players_connected}}</strong> connected,
|
||||
and a total of <strong>{{num_players_registered}}</strong> registered. Of these, <strong>{{num_players_registered_recent}}</strong> were created this week, and <strong>{{num_players_connected_recent}}</strong> have connected within the last seven days.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="quarter">
|
||||
<h1>Recently Connected</h1>
|
||||
<ul>
|
||||
{% for player in players_connected_recent %}
|
||||
<li>{{player.username}} -- <em>{{player.last_login|timesince}} ago</em></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p class="filler"><!-- Filler para to extend left vertical line --></p>
|
||||
</div>
|
||||
|
||||
<div class="quarter">
|
||||
<h1>Database Stats</h1>
|
||||
<ul>
|
||||
<li>{{num_players}} players</li>
|
||||
<li>{{num_rooms}} rooms</li>
|
||||
<li>{{num_things}} things</li>
|
||||
<li>{{num_exits}} exits</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="quarter">
|
||||
<h1>Evennia</h1>
|
||||
<p><a href="http://evennia.com">Evennia</a> is MUD server built in
|
||||
<a href="http://python.org">Python</a>, on top of the
|
||||
<a href="http://twistedmatrix.com">Twisted</a> and
|
||||
<a href="http://djangoproject.com">Django</a> frameworks. This
|
||||
combination of technology allows for the quick and easy creation
|
||||
of games, as simple as complex as one desires.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ##### Footer ##### -->
|
||||
|
||||
<div id="footer">
|
||||
<span class="doNotPrint">
|
||||
Powered by
|
||||
<a href="http://evennia.com">Evennia</a><br />
|
||||
</span>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</div>
|
||||
{% endblock %}
|
||||
66
webtemplates/prosimii/news/show_entry.html
Normal file
66
webtemplates/prosimii/news/show_entry.html
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block header_ext %}
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
<p class="doNotDisplay doNotPrint">This page’s menu:</p>
|
||||
<ul id="side-bar">
|
||||
<li><a href="#alt-layout" title="Alternative layout">Alt. layout</a></li>
|
||||
<li><a href="#compatibility" title="Improved cross-browser compatibility">Compatibility</a></li>
|
||||
<li><a href="#stylesheets" title="Comprehensive stylesheets">Stylesheets</a></li>
|
||||
<li><a href="#accessibility" title="Accessibility features">Accessibility</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 id="alt-layout">Alternative Layout</h1>
|
||||
<p>This is an alternative layout of <span lang="la">Prosimii</span>. Notice the presence of a
|
||||
side menu on the left of page. If you are viewing this page in a <span class="titleTip"
|
||||
title="eg: a Gecko family member or Opera">fully standards-compliant browser</span>, the side
|
||||
menu will scroll with the page. If you are viewing in Internet Explorer, however, the menu
|
||||
will appear stationary.</p>
|
||||
|
||||
<p>The following text is essentially the same as the previous page except elaborated.</p>
|
||||
|
||||
<h1 id="compatibility">Improved Cross-browser Compatibility</h1>
|
||||
<p>Before <span lang="la">Prosimii</span>, 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, <span lang="la">Prosimii</span> has been fully tested in
|
||||
<a href="http://www.opera.com">Opera</a> (7.01), Gecko
|
||||
(<a href="http://www.mozilla.org">Mozilla</a> <a href="http://www.getfirefox.com">Firefox</a> 0.10.1)
|
||||
and Internet Explorer (6.0) for consistent rendering.</p>
|
||||
|
||||
<p>This means that people using <span class="titleTip" title="eg: Mozilla 1+, Opera 7+, Netscape 6+, Internet Explorer 6+">standards-compliant browsers</span>
|
||||
will see the same format and layout of your page.</p>
|
||||
|
||||
<h1 id="stylesheets">Comprehensive Stylesheets</h1>
|
||||
<dl>
|
||||
<dt>More robust screen stylesheet</dt>
|
||||
<dd>The improved cross-browser consistency is a result of
|
||||
<span lang="la">Prosimii’s</span> 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.</dd>
|
||||
<dt>Addition of a print media stylesheet</dt>
|
||||
<dd><span lang="la">Prosimii</span> 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 <span class="smallCaps">print preview</span> from the
|
||||
<span class="smallCaps">file</span> 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 <a href="http://www.getfirefox.com">Firefox</a>, use the stylesheet switcher
|
||||
in the bottom right-hand corner of the browser window.</dd>
|
||||
</dl>
|
||||
|
||||
<h1 id="accessibility">Accessibility Features</h1>
|
||||
<p><span lang="la">Prosimii</span> incorporates accessibility features for people with impaired
|
||||
vision. The template tentatively conforms to the <a href="http://www.w3.org/TR/WCAG10">
|
||||
<acronym title="Web Content Accessibility Guidelines">WCAG</acronym> double A rating</a> and
|
||||
<a href="http://www.access-board.gov/508.htm">§ 508</a> 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.</p>
|
||||
|
||||
<p>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.</p>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue