Fixed #223 -- Changed breadcrumbs in admin doc templates to use relative, not absolute, URLs. Thanks, Drew Amato

git-svn-id: http://code.djangoproject.com/svn/django/trunk@337 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-07-29 15:25:31 +00:00
parent daf8467b37
commit d4a9a4f83a
9 changed files with 53 additions and 67 deletions

View File

@ -1,6 +1,6 @@
{% extends "base_site" %} {% extends "base_site" %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; <a href="/doc/">Documentation</a> &rsaquo; Bookmarklets</div>{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; <a href="../">Documentation</a> &rsaquo; Bookmarklets</div>{% endblock %}
{% block title %}Documentation bookmarklets{% endblock %} {% block title %}Documentation bookmarklets{% endblock %}
@ -10,19 +10,19 @@
toolbar, or right-click the link and add it to your bookmarks. Now you can 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 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 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 as "internal" (talk to your system administrator if you aren't sure if
your computer is "internal").</p> your computer is "internal").</p>
<div id="content-main"> <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> <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> <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> <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> <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> <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> <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> <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> <p>As above, but opens the admin page in a new window.</p>
</div> </div>

View File

@ -1,6 +1,6 @@
{% extends "base_site" %} {% extends "base_site" %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; Documentation</div>{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Documentation</div>{% endblock %}
{% block title %}Documentation{% endblock %} {% block title %}Documentation{% endblock %}
@ -11,19 +11,19 @@
<div id="content-main"> <div id="content-main">
<h3><a href="tags/">Tags</a></h3> <h3><a href="tags/">Tags</a></h3>
<p>List of all the template tags and their functions.</p> <p>List of all the template tags and their functions.</p>
<h3><a href="filters/">Filters</a></h3> <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> <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> <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> <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> <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> <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> <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> <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> <h3><a href="bookmarklets/">Bookmarklets</a></h3>
<p>Tools for your browser to quickly access admin functionality.</p> <p>Tools for your browser to quickly access admin functionality.</p>
</div> </div>

View File

@ -1,6 +1,6 @@
{% extends "base_site" %} {% extends "base_site" %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; Documentation</div>{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">Home</a> &rsaquo; Documentation</div>{% endblock %}
{% block title %}Please install docutils{% endblock %} {% block title %}Please install docutils{% endblock %}
@ -10,7 +10,7 @@
<div id="content-main"> <div id="content-main">
<h3>The admin documentation system requires Python's <a href="http://docutils.sf.net/">docutils</a> library.</h3> <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> <p>Please ask your administrators to install <a href="http://docutils.sf.net/">docutils</a>.</p>
</div> </div>

View File

@ -12,7 +12,7 @@
{% endblock %} {% 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 breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> &rsaquo; <a href="../../">Documentation</a> &rsaquo; <a href="../">Models</a> &rsaquo; {{ name }}</div>{% endblock %}
{% block title %}Model: {{ name }}{% endblock %} {% block title %}Model: {{ name }}{% endblock %}

View File

@ -1,44 +1,44 @@
{% extends "base_site" %} {% extends "base_site" %}
{% block coltype %}colSM{% endblock %} {% block coltype %}colSM{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; <a href="/doc/">Documentation</a> &rsaquo; Models</div>{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; <a href="../">Documentation</a> &rsaquo; Models</div>{% endblock %}
{% block title %}Models{% endblock %} {% block title %}Models{% endblock %}
{% block content %} {% block content %}
<h1>Models Documentation</h1> <h1>Models Documentation</h1>
<div id="content-main"> <div id="content-main">
{% regroup models|dictsort:"module" by module as grouped_models %} {% regroup models|dictsort:"module" by module as grouped_models %}
{% for group in grouped_models %} {% for group in grouped_models %}
<div class="module"> <div class="module">
<h2 id='{{ group.grouper }}'>{{ group.grouper }}</h2> <h2 id='{{ group.grouper }}'>{{ group.grouper }}</h2>
<table class="xfull"> <table class="xfull">
{% for model in group.list %} {% for model in group.list %}
<tr> <tr>
<th><a href="{{ model.name }}/">{{ model.class }}</a></th> <th><a href="{{ model.name }}/">{{ model.class }}</a></th>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
</div> </div>
{% endfor %} {% 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> </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 %} {% endblock %}

View File

@ -1,12 +1,8 @@
{% extends "base_site" %} {% extends "base_site" %}
{% block coltype %}colSM{% endblock %} {% block coltype %}colSM{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; <a href="../">Documentation</a> &rsaquo; filters</div>{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; <a href="/doc/">Documentation</a> &rsaquo; filters</div>{% endblock %}
{% block title %}Template filters{% endblock %} {% block title %}Template filters{% endblock %}

View File

@ -1,12 +1,8 @@
{% extends "base_site" %} {% extends "base_site" %}
{% block coltype %}colSM{% endblock %} {% block coltype %}colSM{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; <a href="../">Documentation</a> &rsaquo; Tags</div>{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; <a href="/doc/">Documentation</a> &rsaquo; Tags</div>{% endblock %}
{% block title %}Template tags{% endblock %} {% block title %}Template tags{% endblock %}

View File

@ -1,8 +1,8 @@
{% extends "base_site" %} {% extends "base_site" %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; <a href="/doc/">Documentation</a> &rsaquo; <a href="/doc/views/">Views</a> &rsaquo; {{ name }}</div>{% endblock %}
{% block title %}View: {{ name }}{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../../">Home</a> &rsaquo; <a href="../../">Documentation</a> &rsaquo; <a href="../">Views</a> &rsaquo; {{ name }}</div>{% endblock %}
{% block title %}View: {{ name }}{% endblock %}
{% block content %} {% block content %}
@ -11,16 +11,16 @@
<h2 class="subhead">{{ summary }}</h2> <h2 class="subhead">{{ summary }}</h2>
<p>{{ body }}</p> <p>{{ body }}</p>
{% if meta.Context %} {% if meta.Context %}
<h3>Context:</h3> <h3>Context:</h3>
<p>{{ meta.Context }}</p> <p>{{ meta.Context }}</p>
{% endif %} {% endif %}
{% if meta.Templates %} {% if meta.Templates %}
<h3>Templates:</h3> <h3>Templates:</h3>
<p>{{ meta.Templates }}</p> <p>{{ meta.Templates }}</p>
{% endif %} {% endif %}
<p class="small"><a href="../">&lsaquo; Back to Views Documentation</a></p> <p class="small"><a href="../">&lsaquo; Back to Views Documentation</a></p>
{% endblock %} {% endblock %}

View File

@ -2,20 +2,15 @@
{% block coltype %}colSM{% endblock %} {% block coltype %}colSM{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="/">Home</a> &rsaquo; <a href="/doc/">Documentation</a> &rsaquo; Views</div>{% endblock %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">Home</a> &rsaquo; <a href="../">Documentation</a> &rsaquo; Views</div>{% endblock %}
{% block title %}Views{% endblock %} {% block title %}Views{% endblock %}
{% block content %} {% block content %}
<h1>View documentation</h1> <h1>View documentation</h1>
<div id="content-main">
<div id="content-main">
{% regroup views|dictsort:"site_id" by site as views_by_site %} {% regroup views|dictsort:"site_id" by site as views_by_site %}
{% for site_views in views_by_site %} {% for site_views in views_by_site %}
@ -32,8 +27,7 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
{% endblock %} {% endblock %}
@ -49,4 +43,4 @@
</ul> </ul>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}