Skip to content

Commit

Permalink
[#540] Fixes primer page for references in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmartin committed Apr 16, 2013
1 parent ad379bf commit 0328008
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 74 deletions.
138 changes: 79 additions & 59 deletions ckan/templates/development/primer.html
@@ -1,75 +1,95 @@
{% extends "base.html" %}
{% extends "page.html" %}

{% block page %}
{% include "header.html" %}
<div role="main" style="padding: 20px;">
{% snippet 'development/snippets/breadcrumb.html', stage=1 %}
{% snippet 'development/snippets/breadcrumb.html', stage=2 %}
{% snippet 'development/snippets/breadcrumb.html', stage=3 %}
{% block toolbar %}
{% snippet 'development/snippets/breadcrumb.html', stage=1 %}
{% snippet 'development/snippets/breadcrumb.html', stage=2 %}
{% snippet 'development/snippets/breadcrumb.html', stage=3 %}
{% endblock %}

{% snippet 'development/snippets/toolbar.html' %}
{% block actions_content %}
{% snippet 'development/snippets/actions.html' %}
{% endblock %}

{% snippet 'development/snippets/module.html', heading='Heading One' %}
{% snippet 'development/snippets/module.html', heading='Heading Two', heading_level=2 %}
{% snippet 'development/snippets/module.html', heading='Heading Three', heading_level=3 %}
{% snippet 'development/snippets/module.html', heading='Heading with link', heading_link=true %}
{% snippet 'development/snippets/module.html', heading='Heading with action', heading_action=true %}
{% snippet 'development/snippets/module.html', heading='Heading with icon', heading_icon=true %}
{% snippet 'development/snippets/module.html', heading='Module with footer', footer=true %}
{% snippet 'development/snippets/module.html', heading='Narrow Module (sidebar)', classes=['module-narrow'] %}
{% snippet 'development/snippets/module.html', heading='Narrow Shallow Module (sidebar text)', classes=['module-narrow', 'module-shallow'] %}
{% block secondary_content %}
{% snippet 'development/snippets/context.html' %}

{% snippet 'development/snippets/list.html', heading='Simple List' %}
<div class="module module-narrow module-shallow">
<h2 class="module-heading"><i class="icon-info-sign"></i> Helper text</h2>
<div class="module-content">{{ lipsum(1) }}</div>
</div>

{% snippet 'development/snippets/nav.html', heading='Navigation' %}
{% snippet 'development/snippets/nav.html', heading='Active Navigation', show_active=true %}
{% snippet 'development/snippets/nav.html', heading='Icon Navigation', show_icons=true %}
{% snippet 'development/snippets/nav.html', heading='Navigation' %}
{% snippet 'development/snippets/nav.html', heading='Active Navigation', show_active=true %}
{% snippet 'development/snippets/nav.html', heading='Icon Navigation', show_icons=true %}
{% snippet 'development/snippets/facet.html', heading='Facet List', show_icons=true %}
{% endblock %}

{% snippet 'development/snippets/facet.html', heading='Facet List', show_icons=true %}
{% block primary_content %}
{% snippet 'development/snippets/page_header.html' %}

{% snippet 'development/snippets/simple-input.html', heading='Facet List', show_icons=true %}
<div class="module-content">
<span class="control-group search-giant">
<input type="text" class="search" name="q" value="" autocomplete="off" placeholder="Search something...">
<button type="submit"><i class="icon-search"></i> <span>Search</span></button>
</span>
</div>

{% snippet 'development/snippets/form.html' %}
{% snippet 'development/snippets/form.html', error=['This field has an error'] %}
<div class="module-content">
<h1 class="page-heading">Top level heading (h1)</h1>
<h2>Some Rendered Markdown (h2)</h2>
<div class="embedded-content">
<h1>Heading 1</h1>
{{ lipsum(1) }}
<h2>Heading 2</h2>
{{ lipsum(1) }}
<h3>Heading 3</h3>
{{ lipsum(1) }}
</div>
</div>

<section class="module">
{% snippet 'development/snippets/page_header.html' %}
<div class="module-content">
<h1 class="page-heading">Top level heading (h1)</h1>
<h2>Some Rendered Markdown (h2)</h2>
<div class="embedded-content">
<h1>Heading 1</h1>
{{ lipsum(1) }}
<h2>Heading 2</h2>
{{ lipsum(1) }}
<h3>Heading 3</h3>
{{ lipsum(1) }}
</div>
</div>
</section>
<div class="module-content">
<hr>
<h2>Forms</h2>
</div>
{% snippet 'development/snippets/form.html' %}
{% snippet 'development/snippets/form.html', error=['This field has an error'] %}

{% snippet 'development/snippets/form_stages.html' %}
<div class="module-content">
<hr>
<h2>Form stages</h2>
</div>
{% snippet 'development/snippets/form_stages.html' %}


{% snippet 'snippets/package_grid.html', packages=[
{'name': "test", 'title': 'Test', 'notes': lipsum(1), 'tracking_summary':{'recent': 10}},
{'name': "test", 'title': 'Test', 'notes': lipsum(0), 'tracking_summary':{'recent': 5}},
{'name': "test", 'title': 'Test', 'notes': lipsum(1), 'tracking_summary':{'recent': 10}},
{'name': "test", 'title': 'Test', 'notes': lipsum(1), 'tracking_summary':{'recent': 10}}
] %}
<div class="module-content m-bottom">
<h2>Datasets</h2>
<hr>
{% snippet 'snippets/package_list.html', packages=[
{'name': "test", 'title': 'Dataset #1', 'notes': lipsum(1), 'tracking_summary':{'recent': 10}},
{'name': "test", 'title': 'Dataset #2', 'notes': lipsum(0), 'tracking_summary':{'recent': 5}},
{'name': "test", 'title': 'Dataset #3', 'notes': lipsum(1), 'tracking_summary':{'recent': 10}},
{'name': "test", 'title': 'Dataset #4', 'notes': lipsum(1), 'tracking_summary':{'recent': 10}}
] %}
</div>

{% snippet 'development/snippets/media_grid.html', groups=[
{'name': "test", 'display_name': 'Test', 'type': 'group', 'description': lipsum(0), 'packages': 0},
{'name': "test", 'display_name': 'Test', 'type': 'group', 'description': lipsum(1), 'packages': 1},
{'name': "test", 'display_name': 'Test', 'type': 'group', 'description': lipsum(1), 'packages': 10},
{'name': "test", 'display_name': 'Test', 'type': 'group', 'description': lipsum(1), 'packages': 200}
] %}
<div class="module-content p-top">
<hr class="m-top">
<h2>Media Grid</h2>
</div>
{% snippet 'development/snippets/media_grid.html', groups=[
{'name': "test", 'display_name': 'Group #1', 'type': 'group', 'description': lipsum(0), 'packages': 0},
{'name': "test", 'display_name': 'Group #2', 'type': 'group', 'description': lipsum(1), 'packages': 1},
{'name': "test", 'display_name': 'Group #3', 'type': 'group', 'description': lipsum(1), 'packages': 10},
{'name': "test", 'display_name': 'Group #4', 'type': 'group', 'description': lipsum(1), 'packages': 200},
{'name': "test", 'display_name': 'Group #5', 'type': 'group', 'description': lipsum(1), 'packages': 10},
{'name': "test", 'display_name': 'Group #6', 'type': 'group', 'description': lipsum(0), 'packages': 5}
] %}

{% snippet 'development/snippets/pagination.html', total=5, current=1 %}
{% snippet 'development/snippets/pagination.html', total=5, current=2 %}
{% snippet 'development/snippets/pagination.html', total=5, current=3 %}
{% snippet 'development/snippets/pagination.html', total=5, current=4 %}
{% snippet 'development/snippets/pagination.html', total=5, current=5 %}
<div class="module-content">
<h2>Pagination</h2>
</div>
{% snippet 'development/snippets/pagination.html', total=5, current=1 %}
{% snippet 'development/snippets/pagination.html', total=5, current=3 %}
{% snippet 'development/snippets/pagination.html', total=5, current=5 %}

{% include "footer.html" %}
{% endblock %}
2 changes: 2 additions & 0 deletions ckan/templates/development/snippets/actions.html
@@ -0,0 +1,2 @@
<li><a class="btn" href="#"><i class="icon-wrench"></i> Button</a></li>
<li><a class="btn btn-primary" href="#"><i class="icon-wrench"></i> Primary Button</a></li>
24 changes: 24 additions & 0 deletions ckan/templates/development/snippets/context.html
@@ -0,0 +1,24 @@
<div class="module context-info">
<section class="module-content">
<div class="image">
<a href="#">
<img src="{{ h.url_for_static('/base/images/placeholder-organization.png') }}" width="200">
</a>
</div>
<h1 class="heading">{{ title }}</h1>
<p>
{{ h.markdown_extract(lipsum(1), 160) }}
<a href="#">read more</a>
</p>
<div class="nums">
<dl>
<dt>Stat #1</dt>
<dd>{{ h.SI_number_span(11111) }}</dd>
</dl>
<dl>
<dt>Stat #2</dt>
<dd>{{ h.SI_number_span(111) }}</dd>
</dl>
</div>
</section>
</div>
6 changes: 3 additions & 3 deletions ckan/templates/development/snippets/facet.html
@@ -1,6 +1,6 @@
<section class="module module-narrow" style="width: 280px">
{% with items=(("First", false), ("Second", true), ("Third", true), ("Fourth", false), ("Last", false)) %}
<h2 class="module-heading"><i class="icon-medium icon-filter"></i> Facet List <a href="{{ h.remove_field(name) }}" class="action">Clear All</a></h2>
<section class="module module-narrow">
{% with items=(("First", true), ("Second", false), ("Third", true), ("Fourth", false), ("Last", false)) %}
<h2 class="module-heading"><i class="icon-medium icon-filter"></i> Facet List <a href="#" class="action">Clear All</a></h2>
<nav>
<ul class="unstyled nav nav-simple nav-facet">
{% for value, active in items %}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/development/snippets/media_grid.html
@@ -1,4 +1,4 @@
<section class="module" style="width: 650px">
<section class="module">
<div class="module-content">
{% snippet 'group/snippets/group_list.html', groups=groups %}
</div>
Expand Down
6 changes: 3 additions & 3 deletions ckan/templates/development/snippets/nav.html
@@ -1,6 +1,6 @@
<section class="module module-narrow" style="width: 280px">
{% with items=(("First", false), ("Second", true), ("Third", true), ("Fourth", false), ("Last", false)) %}
<h1 class="module-heading">{{ heading }}</h1>
<section class="module module-narrow">
{% with items=(("First", true), ("Second", false), ("Third", true), ("Fourth", false), ("Last", false)) %}
<h2 class="module-heading">{{ heading }}</h2>
<nav>
<ul class="unstyled nav nav-simple">
{% for value, active in items %}
Expand Down
13 changes: 5 additions & 8 deletions ckan/templates/development/snippets/page_header.html
@@ -1,13 +1,10 @@
{% with items=(
h.literal('<li>') + h.link_to('In-active Tab', '#') + h.literal('</li>'),
h.literal('<li class="active">') + h.link_to('Active Tab', '#') + h.literal('</li>'),
h.literal('<li>') + h.link_to('In-active Tab', '#') + h.literal('</li>'),
h.literal('<li>') + h.link_to('In-active Tab', '#') + h.literal('</li>'),
) %}
{% with items=(("First", true), ("Second", false), ("Third", false)) %}
<header class="module-content page-header">
<ul class="nav nav-tabs">
{% for item in items %}
{{ item }}
{% for value, active in items %}
<li{{ ' class=active' if active }}>
<a href="#"><i class="icon-cog"></i> {{ value }}</a>
</li>
{% endfor %}
</ul>
</header>
Expand Down

0 comments on commit 0328008

Please sign in to comment.