Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lot's of tweaks to the group, user and package read pages and new sni…
…pper for page_header
- Loading branch information
1 parent
115e703
commit f561cba
Showing
12 changed files
with
321 additions
and
297 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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% with items=(("First tab", "#", "info-sign", true), ("Second tab", "#", "info-sign", false) ) %} | ||
{% snippet 'snippets/page_header.html', items=items %} | ||
{% endwith %} |
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,10 @@ | ||
{% extends "page.html" %} | ||
{% extends "group/read_base.html" %} | ||
|
||
{% block subtitle %}{{ c.group_dict.display_name }}{% endblock %} | ||
|
||
{% block breadcrumb_content %} | ||
<li>{% link_for _('Groups'), controller='group', action='index' %}</li> | ||
<li class="active">{% link_for c.group_dict.display_name|truncate(35), controller='group', action='read', id=c.group_dict.name %}</li> | ||
{% endblock %} | ||
|
||
{% block actions_content %} | ||
{% if h.check_access('group_update', {'id': c.group_dict.id}) %} | ||
<li>{% link_for _('Add Dataset to Group'), controller='package', action='new', group=c.group_dict.id, class_='btn', icon='plus' %}</li> | ||
<li>{% link_for _('Edit'), controller='group', action='edit', id=c.group_dict.name, class_='btn', icon='wrench' %}</li> | ||
{% endif %} | ||
<li>{{ h.follow_button('group', c.group_dict.id) }}</li> | ||
{% endblock %} | ||
|
||
{% block primary_content %} | ||
<section class="module"> | ||
{% block package_header %} | ||
<header class="module-content page-header"> | ||
<ul class="nav nav-tabs"> | ||
<li{% if c.action == 'read' %} class="active"{% endif %}> | ||
{% link_for _('Datasets'), controller='group', action='read', id=c.group_dict.name, icon='sitemap' %} | ||
</li> | ||
<li{% if c.action == 'activity' %} class="active"{% endif %}> | ||
{% link_for _('Activity Stream'), controller='group', action='activity', id=c.group_dict.name, icon='time' %} | ||
</li> | ||
<li{% if c.action == 'followers' %} class="active"{% endif %}> | ||
{% link_for _('Followers'), controller='group', action='followers', id=c.group_dict.name, icon='group' %} | ||
</li> | ||
<li{% if c.action == 'admins' %} class="active"{% endif %}> | ||
{% link_for _('Administrators'), controller='group', action='admins', id=c.group_dict.name, icon='cog' %} | ||
</li> | ||
<li{% if c.action == 'about' %} class="active"{% endif %}> | ||
{% link_for _('About'), controller='group', action='about', id=c.group_dict.name, icon='info-sign' %} | ||
</li> | ||
</ul> | ||
</header> | ||
{% endblock %} | ||
{% block primary_content_inner %} | ||
<div class="module-content"> | ||
{% include "package/snippets/search_form.html" %} | ||
</div> | ||
{{ c.page.pager(q=c.q) }} | ||
{% endblock %} | ||
</section> | ||
{% endblock %} | ||
|
||
{% block secondary_content %} | ||
<div class="module profile-info"> | ||
<section class="module-content"> | ||
<div class="avatar"> | ||
<a href="{{ c.group_dict.url }}"> | ||
<img src="{{ c.group_dict.image_url or h.url_for_static('/base/images/placeholder-group.png') }}" width="200" height="125" alt="{{ c.group_dict.name }}" /> | ||
</a> | ||
</div> | ||
<h1 class="heading">{{ c.group_dict.display_name }}</h1> | ||
{% if c.group_dict.description %} | ||
<p> | ||
{{ h.markdown_extract(c.group_dict.description, 180) }} | ||
{% link_for _('read more'), controller='group', action='about', id=c.group_dict.name %} | ||
</p> | ||
{% else %} | ||
<p class="empty">{{ _('There is no description for this group') }}</p> | ||
{% endif %} | ||
<div class="nums"> | ||
<dl> | ||
<dt>{{ _('Followers') }}</dt> | ||
<dd>{{ c.group_dict.num_followers }}</dd> | ||
</dl> | ||
<dl> | ||
<dt>{{ _('Datasets') }}</dt> | ||
<dd>{{ c.group_dict.packages|length }}</dd> | ||
</dl> | ||
</div> | ||
</section> | ||
{% block primary_content_inner %} | ||
<div class="module-content"> | ||
{% include "package/snippets/search_form.html" %} | ||
</div> | ||
|
||
{{ h.snippet('snippets/facet_list.html', title='Tags', name='tags', extras={'id':c.group_dict.id}) }} | ||
{{ h.snippet('snippets/facet_list.html', title='Formats', name='res_format', extras={'id':c.group_dict.id}) }} | ||
{% endblock %} | ||
|
||
{% block links %} | ||
{{ super() }} | ||
{% include "group/snippets/feeds.html" %} | ||
{{ c.page.pager(q=c.q) }} | ||
{% endblock %} |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{% extends "page.html" %} | ||
|
||
{% block subtitle %}{{ c.group_dict.display_name }}{% endblock %} | ||
|
||
{% block breadcrumb_content %} | ||
<li>{% link_for _('Groups'), controller='group', action='index' %}</li> | ||
<li class="active">{% link_for c.group_dict.display_name|truncate(35), controller='group', action='read', id=c.group_dict.name %}</li> | ||
{% endblock %} | ||
|
||
{% block actions_content %} | ||
{% if h.check_access('group_update', {'id': c.group_dict.id}) %} | ||
<li>{% link_for _('Add Dataset to Group'), controller='package', action='new', group=c.group_dict.id, class_='btn', icon='plus' %}</li> | ||
<li>{% link_for _('Edit'), controller='group', action='edit', id=c.group_dict.name, class_='btn', icon='wrench' %}</li> | ||
{% endif %} | ||
<li>{{ h.follow_button('group', c.group_dict.id) }}</li> | ||
{% endblock %} | ||
|
||
{% block primary_content %} | ||
<section class="module"> | ||
{% block package_header %} | ||
<header class="module-content page-header"> | ||
<ul class="nav nav-tabs"> | ||
<li{% if c.action == 'read' %} class="active"{% endif %}> | ||
{% link_for _('Datasets'), controller='group', action='read', id=c.group_dict.name, icon='sitemap' %} | ||
</li> | ||
<li{% if c.action == 'activity' %} class="active"{% endif %}> | ||
{% link_for _('Activity Stream'), controller='group', action='activity', id=c.group_dict.name, icon='time' %} | ||
</li> | ||
<li{% if c.action == 'followers' %} class="active"{% endif %}> | ||
{% link_for _('Followers'), controller='group', action='followers', id=c.group_dict.name, icon='group' %} | ||
</li> | ||
<li{% if c.action == 'admins' %} class="active"{% endif %}> | ||
{% link_for _('Administrators'), controller='group', action='admins', id=c.group_dict.name, icon='cog' %} | ||
</li> | ||
<li{% if c.action == 'about' %} class="active"{% endif %}> | ||
{% link_for _('About'), controller='group', action='about', id=c.group_dict.name, icon='info-sign' %} | ||
</li> | ||
</ul> | ||
</header> | ||
{% endblock %} | ||
{% block primary_content_inner %} | ||
<div class="module-content"> | ||
{% include "package/snippets/search_form.html" %} | ||
</div> | ||
{{ c.page.pager(q=c.q) }} | ||
{% endblock %} | ||
</section> | ||
{% endblock %} | ||
|
||
{% block secondary_content %} | ||
<div class="module profile-info"> | ||
<section class="module-content"> | ||
<div class="avatar"> | ||
<a href="{{ c.group_dict.url }}"> | ||
<img src="{{ c.group_dict.image_url or h.url_for_static('/base/images/placeholder-group.png') }}" width="200" height="125" alt="{{ c.group_dict.name }}" /> | ||
</a> | ||
</div> | ||
<h1 class="heading">{{ c.group_dict.display_name }}</h1> | ||
{% if c.group_dict.description %} | ||
<p> | ||
{{ h.markdown_extract(c.group_dict.description, 180) }} | ||
{% link_for _('read more'), controller='group', action='about', id=c.group_dict.name %} | ||
</p> | ||
{% else %} | ||
<p class="empty">{{ _('There is no description for this group') }}</p> | ||
{% endif %} | ||
<div class="nums"> | ||
<dl> | ||
<dt>{{ _('Followers') }}</dt> | ||
<dd>{{ c.group_dict.num_followers }}</dd> | ||
</dl> | ||
<dl> | ||
<dt>{{ _('Datasets') }}</dt> | ||
<dd>{{ c.group_dict.packages|length }}</dd> | ||
</dl> | ||
</div> | ||
</section> | ||
</div> | ||
|
||
{{ h.snippet('snippets/facet_list.html', title='Tags', name='tags', extras={'id':c.group_dict.id}) }} | ||
{{ h.snippet('snippets/facet_list.html', title='Formats', name='res_format', extras={'id':c.group_dict.id}) }} | ||
{% endblock %} | ||
|
||
{% block links %} | ||
{{ super() }} | ||
{% include "group/snippets/feeds.html" %} | ||
{% endblock %} |
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,37 @@ | ||
{% extends "page.html" %} | ||
{% extends "package/read_base.html" %} | ||
|
||
{% set pkg = c.pkg_dict %} | ||
|
||
{% block subtitle %}{{ pkg.title or pkg.name }}{% endblock %} | ||
|
||
{% block breadcrumb_content %} | ||
{% set dataset = pkg.title or pkg.name %} | ||
<li>{% link_for _('Datasets'), controller='package', action='search', highlight_actions = 'new index' %}</li> | ||
<li class="active"><a href="" title="{{ dataset }}">{{ dataset|truncate(35) }}</a></li> | ||
{% endblock %} | ||
|
||
{% block actions_content %} | ||
{# NOTE: Not implemented in stage 1 #} | ||
{# <li>{% link_for _('History'), controller='package', action='history', id=pkg.name, class_='btn', icon='undo' %}</li> #} | ||
{% if h.check_access('package_update', {'id':pkg.id }) %} | ||
<li>{% link_for _('Edit'), controller='package', action='edit', id=pkg.name, class_='btn btn-primary', icon='wrench' %}</li> | ||
{% endif %} | ||
<li>{{ h.follow_button('dataset', pkg.id) }}</li> | ||
{% endblock %} | ||
|
||
{% block primary_content %} | ||
{% block package_revision_info %} | ||
{% if c.pkg_revision_id %} | ||
<div class="module info"> | ||
<p class="module-content"> | ||
{% set timestamp = h.render_datetime(c.pkg_revision_timestamp, with_hours=True) %} | ||
{% set url = h.url(controller='package', action='read', id=pkg.name) %} | ||
|
||
{% if c.pkg_revision_not_latest %} | ||
{% trans timestamp=timestamp, url=url %}This is an old revision of this dataset, as edited at {{ timestamp }}. It may differ significantly from the <a href="{{ url }}">current revision</a>.{% endtrans %} | ||
{% else %} | ||
{% trans timestamp=timestamp %}This is the current revision of this dataset, as edited at {{ timestamp }}.{% endtrans %} | ||
{% endif %} | ||
{% block primary_content_inner %} | ||
|
||
{% block package_description %} | ||
<section class="module-content"> | ||
<h1>{{ pkg.title or pkg.name }} | ||
{% if pkg.state.startswith('draft') %} | ||
[{{ _('Draft') }}] | ||
{% endif %} | ||
</h1> | ||
{% if c.pkg_notes_formatted %} | ||
<div class="notes embedded-content"> | ||
{{ c.pkg_notes_formatted }} | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
<article class="module prose"> | ||
|
||
{% block package_header %} | ||
<header class="module-content page-header"> | ||
<ul class="nav nav-tabs"> | ||
<li{% if c.action == 'read' %} class="active"{% endif %}> | ||
{% link_for _('Dataset'), controller='package', action='read', id=pkg.name, icon='sitemap' %} | ||
</li> | ||
<li{% if c.action == 'followers' %} class="active"{% endif %}> | ||
{% link_for _('Followers'), controller='package', action='followers', id=pkg.name, icon='group' %} | ||
</li> | ||
<li{% if c.action == 'related' %} class="active"{% endif %}> | ||
{% link_for _('Related'), controller='related', action='list', id=pkg.name, icon='picture' %} | ||
</li> | ||
</ul> | ||
</header> | ||
{% endblock %} | ||
|
||
{% block package_content %} | ||
|
||
{% block package_description %} | ||
<section class="module-content"> | ||
<h1>{{ pkg.title or pkg.name }} | ||
{% if pkg.state.startswith('draft') %} | ||
[{{ _('Draft') }}] | ||
{% endif %} | ||
</h1> | ||
{% if c.pkg_notes_formatted %} | ||
<div class="notes embedded-content"> | ||
{{ c.pkg_notes_formatted }} | ||
</div> | ||
{% endif %} | ||
<span class="insert-comment-thread"></span> | ||
</section> | ||
{% endblock %} | ||
|
||
{% block package_resources %} | ||
{% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %} | ||
{% endblock %} | ||
|
||
{% block package_tags %} | ||
{% snippet "package/snippets/tags.html", tags=pkg.tags %} | ||
{% endblock %} | ||
|
||
{% block package_additional_info %} | ||
{% snippet "package/snippets/additional_info.html", pkg_dict=pkg %} | ||
{% endblock %} | ||
|
||
{% endblock %} | ||
</article> | ||
{% endblock %} | ||
|
||
{% block secondary_content %} | ||
|
||
{% block secondary_help_content %}{% endblock %} | ||
|
||
{% block package_groups %} | ||
{% for group in pkg.groups %} | ||
{% snippet "snippets/group.html", group=group, truncate=70 %} | ||
{% endfor %} | ||
{% endif %} | ||
<span class="insert-comment-thread"></span> | ||
</section> | ||
{% endblock %} | ||
|
||
{% block package_social %} | ||
{% snippet "snippets/social.html" %} | ||
{% block package_resources %} | ||
{% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %} | ||
{% endblock %} | ||
|
||
{% block package_related %} | ||
{% snippet "snippets/related.html", item=c.pkg.related|last, pkg_name=pkg.name %} | ||
{% block package_tags %} | ||
{% snippet "package/snippets/tags.html", tags=pkg.tags %} | ||
{% endblock %} | ||
|
||
{% block package_license %} | ||
{% snippet "snippets/license.html", pkg_dict=pkg %} | ||
{% block package_additional_info %} | ||
{% snippet "package/snippets/additional_info.html", pkg_dict=pkg %} | ||
{% endblock %} | ||
|
||
{% endblock %} |
Oops, something went wrong.