Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
116 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters