Skip to content

Commit

Permalink
Added default Django admin templates
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@92 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Jul 16, 2005
1 parent 40b8afa commit 52f5c94
Show file tree
Hide file tree
Showing 20 changed files with 634 additions and 0 deletions.
11 changes: 11 additions & 0 deletions templates/admin/404.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends "base_site" %}

{% block title %}Page not found{% endblock %}

{% block content %}

<h2>Page not found</h2>

<p>We're sorry, but the requested page could not be found.</p>

{% endblock %}
11 changes: 11 additions & 0 deletions templates/admin/500.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends "base_site" %}

{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; Server error</div>{% endblock %}

{% block title %}Server error (500){% endblock %}

{% block content %}
<h1>Server Error <em>(500)</em></h1>
<p>There's been an error. It's been reported to the site administrators via e-mail and should be fixed shortly. Thanks for your patience.</p>

{% endblock %}
42 changes: 42 additions & 0 deletions templates/admin/admin_object_history.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,42 @@
{% extends "base_site" %}

{% block breadcrumbs %}
<div class="breadcrumbs"><a href="../../../../">Home</a> &rsaquo; <a href="../../">{{ module_name }}</a> &rsaquo; <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo; History</div>
{% endblock %}

{% block content %}

<div id="content-main">
<div class="module">

{% if action_list %}

<table id="change-history">
<thead>
<tr>
<th>Date/time</th>
<th>User</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for action in action_list %}
<tr>
<th>{{ action.action_time|date:"N j, Y, P" }}</th>
<td>{{ action.get_user.username }}{% if action.get_user.first_name %} ({{ action.get_user.first_name }} {{ action.get_user.last_name }}){% endif %}</td>
<td>{{ action.change_message}}</td>
</tr>
{% endfor %}
</tbody>
</table>

{% else %}

<p>This object doesn't have a change history. It probably wasn't added via this admin site.</p>

{% endif %}

</div>
</div>

{% endblock %}
51 changes: 51 additions & 0 deletions templates/admin/base.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}/m/css/base.css{% endblock %}" />
{% block extrastyle %}{% endblock %}
{% block extrahead %}{% endblock %}
</head>

<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}">

<!-- Container -->
<div id="container">

{% if not is_popup %}
<!-- Header -->
<div id="header">
<div id="branding">
{% block branding %}{% endblock %}
</div>
{% if not user.is_anonymous %}
<div id="user-tools">Welcome, <strong>{% if user.first_name %}{{ user.first_name }}{% else %}{{ user.username }}{% endif %}</strong>. <br /><a href="/password_change/">Change password</a> / <a href="/logout/">Logout</a></div>
{% endif %}
{% block nav-global %}{% endblock %}
<br class="clear" />
</div>
<!-- END Header -->
{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a>{% if title %} &rsaquo; {{ title }}{% endif %}</div>{% endblock %}
{% endif %}

{% if messages %}
<ul class="messagelist">{% for message in messages %}<li>{{ message }}</li>{% endfor %}</ul>
{% endif %}

<!-- Content -->
<div id="content" class="{% block coltype %}colM{% endblock %}">
{% block pretitle %}{% endblock %}
{% if title %}<h1>{{ title }}</h1>{% endif %}
{% block content %}{{ content }}{% endblock %}
{% block sidebar %}{% endblock %}
<br class="clear" />
</div>
<!-- END Content -->

<div id="footer"></div>
</div>
<!-- END Container -->

</body>
</html>
10 changes: 10 additions & 0 deletions templates/admin/base_site.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends "base" %}

{% block title %}{{ title }} | Django site admin{% endblock %}

{% block branding %}
<h1 id="site-name">Django administration</h1>
<h2 id="site-url"><a href="http://www.mysite.com/">mysite.com</a></h2>
{% endblock %}

{% block nav-global %}{% endblock %}
34 changes: 34 additions & 0 deletions templates/admin/changelist_generic.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,34 @@
{% extends "base_site" %}

{% block bodyclass %}change-list{% endblock %}

{% block content %}

{% if not hide_add_link %}
<ul class="object-tools"><li><a href="/{{ admin_url }}/add/" class="addlink">Add {{ object_name }}</a></li></ul>
{% endif %}

<div id="content-main">
<div class="module">

{% if toplinks %}
<ul class="toplinks">
{% for toplink in toplinks %}
<li><a href="{{ toplink.link }}/">{{ toplink.text }}/</a></li>
{% endfor %}
</ul>
<hr />
{% endif %}

{% if changelist %}
<ul class="changelist">
{% for obj in changelist %}
<li class="{% cycle row1,row2 %}"><a href="/{{ admin_url }}/change/{{ obj.id }}/" title="Click to change">{{ obj|striptags|escape }}</a></li>
{% endfor %}
</ul>
{% endif %}

</div>
</div>

{% endblock %}
21 changes: 21 additions & 0 deletions templates/admin/delete_confirmation_generic.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,21 @@
{% extends "base_site" %}

{% block content %}

{% if perms_lacking %}
<p>Deleting the {{ object_name }} "{{ object }}" would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:</p>
<ul>
{% for obj in perms_lacking %}
<li>{{ obj }}</li>
{% endfor %}
</ul>
{% else %}
<p>Are you sure you want to delete the {{ object_name }} "{{ object }}"? All of the following related items will be deleted:</p>
<ul>{{ deleted_objects|unordered_list }}</ul>
<form action="" method="post">
<input type="hidden" name="post" value="yes" />
<input type="submit" value="Yes, I'm sure" />
</form>
{% endif %}

{% endblock %}
30 changes: 30 additions & 0 deletions templates/admin/doc/bookmarklets.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends "base_site" %}

{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; <a href="/doc/">Documentation</a> &rsaquo; Bookmarklets</div>{% endblock %}

{% block title %}Documentation bookmarklets{% endblock %}

{% block content %}

<p class="help">To install bookmarklets, drag the link to your bookmarks
toolbar, or right-click the link and add it to your bookmarks. Now you can
select the bookmarklet from any page in the site. Note that some of these
bookmarklets require you to be viewing the site from a computer designated
as "internal" (talk to your system administrator if you aren't sure if
your computer is "internal").</p>

<div id="content-main">
<h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('HEAD',location.href,false);x.send(null);try{view=x.getResponseHeader('x-view');}catch(e){alert('No view found for this page');return;}if(view=="undefined"){alert("No view found for this page");}document.location='{{ admin_url }}/doc/views/'+view+'/';})()">Documentation for this page</a></h3>
<p>Jumps you from any page to the documentation for the view that generates that page.</p>

<h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{type=x.getResponseHeader('x-object-type');id=x.getResponseHeader('x-object-id');}catch(e){type='(none)';id='(none)';}d=document;b=d.body;e=d.createElement('div');e.id='xxxhhh';s=e.style;s.position='absolute';s.left='10px';s.top='10px';s.font='10px monospace';s.border='1px black solid';s.padding='4px';s.backgroundColor='#eee';e.appendChild(d.createTextNode('Type: '+type));e.appendChild(d.createElement('br'));e.appendChild(d.createTextNode('ID: '+id));e.appendChild(d.createElement('br'));l=d.createElement('a');l.href='#';l.onclick=function(){b.removeChild(e);};l.appendChild(d.createTextNode('[close]'));l.style.textDecoration='none';e.appendChild(l);b.appendChild(e);})();">Show object ID</a></h3>
<p>Shows the content-type and unique ID for pages that represent a single object.</p>

<h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}document.location='{{ admun_url }}/'+type.split('.').join('/')+'/'+id+'/';})()">Edit this object (current window)</a></h3>
<p>Jumps to the admin page for pages that represent a single object.</p>

<h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){var x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){var x=new XMLHttpRequest()}else{return;}x.open('GET',location.href,false);x.send(null);try{var type=x.getResponseHeader('x-object-type');var id=x.getResponseHeader('x-object-id');}catch(e){return;}window.open('{{ admun_url }}/'+type.split('.').join('/')+'/'+id+'/');})()">Edit this object (new window)</a></h3>
<p>As above, but opens the admin page in a new window.</p>
</div>

{% endblock %}
31 changes: 31 additions & 0 deletions templates/admin/doc/index.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,31 @@
{% extends "base_site" %}

{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; Documentation</div>{% endblock %}

{% block title %}Documentation{% endblock %}

{% block content %}

<h1>Documentation</h1>

<div id="content-main">
<h3><a href="tags/">Tags</a></h3>
<p>List of all the template tags and their functions.</p>

<h3><a href="filters/">Filters</a></h3>
<p>Filters are actions which can be applied to variables in a template to alter the output.</p>

<h3><a href="models/">Models</a></h3>
<p>Models are descriptions of all the objects in the system and their associated fields. Each model has a list of fields which can be accessed as template variables.</p>

<h3><a href="views/">Views</a></h3>
<p>Each page on the public site is generated by a view. The view defines which template is used to generate the page and which objects are available to that template.</p>

<h3><a href="views/">Views</a></h3>
<p>Each page on the public site is generated by a view. The view defines which template is used to generate the page and which objects are available to that template.</p>

<h3><a href="bookmarklets/">Bookmarklets</a></h3>
<p>Tools for your browser to quickly access admin functionality.</p>
</div>

{% endblock %}
17 changes: 17 additions & 0 deletions templates/admin/doc/missing_docutils.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "base_site" %}

{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; Documentation</div>{% endblock %}

{% block title %}Please install docutils{% endblock %}

{% block content %}

<h1>Documentation</h1>

<div id="content-main">
<h3>The admin documentation system requires Python's <a href="http://docutils.sf.net/">docutils</a> library.</h3>

<p>Please ask your administrators to install <a href="http://docutils.sf.net/">docutils</a>.</p>
</div>

{% endblock %}
46 changes: 46 additions & 0 deletions templates/admin/doc/model_detail.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,46 @@
{% extends "base_site" %}

{% block extrahead %}

{{ block.super }}

<style type="text/css">

.module table { width:100%; }

</style>

{% endblock %}

{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; <a href="/doc/">Documentation</a> &rsaquo; <a href="/doc/models/">Models</a> &rsaquo; {{ name }}</div>{% endblock %}

{% block title %}Model: {{ name }}{% endblock %}

{% block content %}
<div id="content-main">
<h1>{{ summary }}</h1>

<div class="module">
<table class="model">
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for field in fields|dictsort:"name" %}
<tr>
<td>{{ field.name }}</td>
<td>{{ field.data_type }}</td>
<td>{{ field.verbose|default:"" }}{% if field.help_text %} - {{ field.help_text }}{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

<p class="small"><a href="../">&lsaquo; Back to Models Documentation</p>
</div>
{% endblock %}
44 changes: 44 additions & 0 deletions templates/admin/doc/model_index.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,44 @@
{% extends "base_site" %}

{% block coltype %}colSM{% endblock %}

{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; <a href="/doc/">Documentation</a> &rsaquo; Models</div>{% endblock %}

{% block title %}Models{% endblock %}

{% block content %}

<h1>Models Documentation</h1>

<div id="content-main">
{% regroup models|dictsort:"module" by module as grouped_models %}
{% for group in grouped_models %}
<div class="module">
<h2 id='{{ group.grouper }}'>{{ group.grouper }}</h2>

<table class="xfull">
{% for model in group.list %}
<tr>
<th><a href="{{ model.name }}/">{{ model.class }}</a></th>
</tr>
{% endfor %}
</table>
</div>
{% endfor %}

</div>
{% endblock %}

{% block sidebar %}
<div id="content-related" class="sidebar">
<div class="module">
<h2>Model Groups Quick List</h2>
<ul>
{% regroup models|dictsort:"module" by module as grouped_models %}
{% for group in grouped_models %}
<li><a href="#{{ group.grouper }}">{{ group.grouper }}</a></li>
{% endfor %}
</ul>
</div>
</div>
{% endblock %}
Loading

0 comments on commit 52f5c94

Please sign in to comment.