Permalink
Browse files

Index page

  • Loading branch information...
1 parent c4683bd commit f1fcfdf74905b504ef8108d75747c1c3de8de584 @piumosso piumosso committed Jul 31, 2011
View
26 djangodocs/livedocs/static/css/dashboard.css
@@ -12,18 +12,22 @@
* @section Dashboard
*/
-.b-dashboard {}
-.b-dashboard__section {
- display: inline-block;
- width: 24%;
- vertical-align: top;
+.b-dashboard {
+}
+.b-dashboard__panel {
+ float: left;
+ width: 39%;
+ padding: 5%
}
-.b-dashboard__section-link {
- font-size: 160%;
+.b-dashboard .b-dashboard__panel:first-child {
+ margin-top: 2em;
}
-.b-dashboard__item {
- padding-left: 2em;
+.b-dashboard__section {
+ margin-bottom: 2em;
+ line-height: 1.4;
+ font-size: 140%;
}
-.b-dashboard__item-link {
- font-size: 120%;
+.b-dashboard__section-header {
+ font-size: 142%;
+ padding-bottom: 1em;
}
View
50 djangodocs/livedocs/static/css/typo.css
@@ -63,6 +63,12 @@
font-size: 140%;
background: #e2eef6;
}
+
+
+/**
+ * @subsection Lists
+ */
+
.b-content ul {
list-style: disc;
}
@@ -78,6 +84,12 @@
.b-content li * {
font-size: 100%!important;
}
+
+
+/**
+ * @subsection Heghlight
+ */
+
.b-content .highlight-python,
.b-content .highlight-html,
.b-content .highlight {
@@ -107,6 +119,12 @@
.m-search-focus .b-content .highlight {
background: #fffff0;
}
+
+
+/**
+ * @subsection Defenition lists
+ */
+
.b-content dl {
line-height: 1.4;
}
@@ -124,6 +142,12 @@
.b-content dd:last-child :last-child {
margin-bottom: 0px;
}
+
+
+/**
+ * @subsection Version added
+ */
+
.b-content .versionadded {
font-size: 120%;
font-style: italic;
@@ -132,6 +156,12 @@
.b-content .versionadded a {
color: #11721a!important;
}
+
+
+/**
+ * @subsection Warnings
+ */
+
.b-content .admonition {
padding-left: 60px;
background: url(../images/warning.png) 0px 0px no-repeat;
@@ -144,6 +174,26 @@
/**
+ * @subsection Tables
+ */
+
+.b-content table {
+ width: 100%;
+ margin: 1.54em 0px;
+ line-height: 1.4;
+ font-size: 140%;
+}
+.b-content td,
+.b-content th {
+ text-align: left;
+ padding: 0.6em 1em;
+}
+.b-content th {
+ background: #e2eef6;
+}
+
+
+/**
* @subsection Pygments
*/
View
13 djangodocs/livedocs/templates/livedocs/_dashboard.html
@@ -0,0 +1,13 @@
+
+<section class="b-dashboard">
+ {% for panel in panels %}
+ <div class="b-dashboard__panel">
+ {% for item in panel %}
+ <article class="b-dashboard__section">
+ <h1 class="b-dashboard__section-header">{{ item.title }}</h1>
+ {{ item.content|safe }}
+ </article>
+ {% endfor %}
+ </div>
+ {% endfor %}
+</section>
View
29 djangodocs/livedocs/templates/livedocs/search.html
@@ -1,8 +1,13 @@
{% extends 'livedocs/layout/layout.html' %}
+
+
{% load mptt_tags %}
+{% load dashboard %}
+
{% block title %} {{ title|striptags }} {% endblock %}
+
{% block content %}
<section class="l-content b-content">
{% if document_items %}
@@ -17,25 +22,7 @@ <h1 id="{{ node.slug }}">{{ node.title }}</h1>
</section>
{% endblock %}
+
{% block dashboard %}
- {% comment %}
- <section class="b-dashboard">
- {% for root_item in root_items %}
- <div class="b-dashboard__section">
- <a href="{{ root_item.get_absolute_url }}"
- class="b-dashboard__section-link">
- {{ root_item.title }}
- </a>
- {% for secondary_item in root_item.get_children %}
- <div class="b-dashboard__item">
- <a href="{{ secondary_item.get_absolute_url }}"
- class="b-dashboard__item-link">
- {{ secondary_item.title }}
- </a>
- </div>
- {% endfor %}
- </div>
- {% endfor %}
- </section>
- {% endcomment %}
-{% endblock %}
+ {% dashboard %}
+{% endblock %}
View
30 djangodocs/livedocs/templatetags/dashboard.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*
+from django import template
+from livedocs.models import Item
+
+
+register = template.Library()
+
+
+@register.inclusion_tag('livedocs/_dashboard.html', takes_context=True)
+def dashboard(context):
+ panels_data = [
+ ['index/s-the-model-layer', 'index/s-the-template-layer', 'index/s-the-view-layer', 'index/forms', ],
+ ['index/s-other-batteries-included'],
+ ]
+
+ panels = []
+ for panel in panels_data:
+ items = []
+ for path in panel:
+ try:
+ item = Item.objects.get(path=path,
+ version__name=context['current_version'],
+ level=3)
+ items.append(item)
+ except Item.DoesNotExist, Item.MultipleObjectsReturned:
+ pass
+
+ panels.append(items)
+
+ return {'panels': panels}
View
3 djangodocs/livedocs/views.py
@@ -116,9 +116,6 @@ def get(self, request, *args, **kwargs):
context['title'] = 'No results'
#raise Exception(context['document_items'])
- dashboard_root_item = Item.objects.get(path='index', version__name=context['current_version'])
- context['root_items'] = dashboard_root_item.get_descendants()
-
return context

0 comments on commit f1fcfdf

Please sign in to comment.